2

We have an application that is extensible via modules. The (multi-project) SBT build produces a distribution artifact that is easy to deploy.

Some custom deployments for clients do require specific modules to be part of the build (in other words, an additional set of dependencies). I'm wondering what would be the best approach to create such custom builds - in other words, is there perhaps a way to extend the main Build and only add those dependencies?

Right now I am thinking of the following approach:

  • have the main application packaged (as ZIP) & released
  • in the custom build, fetch the ZIP file, extract it, magically add the additional JAR dependencies, and zip the artifact again ("magically" because I don't know how to get access to all JAR dependencies specified in the build)

But is there perhaps a more elegant way?

Robin Green
  • 32,079
  • 16
  • 104
  • 187
Manuel Bernhardt
  • 3,135
  • 2
  • 29
  • 36

1 Answers1

0

I think it would be easier to just declare a new sub-project along the main one that depends on it.

lazy val extra: Project = Project("extra", file("extra")) dependsOn(mainProject) settings(Seq(...))

Then on that package you can declare the extra dependencies. When you package this extra project everything should end up into the package automatically.

Tomas Lazaro
  • 315
  • 1
  • 8
  • Well, this is what we have now. But what I'd like is not to have these private sub-projects be exposed in the public Build. I.e. create a number of small, custom Builds, each referencing the necessary projects. – Manuel Bernhardt Aug 09 '12 at 09:44