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?

4

1 に答える 1

0

それに依存するメインプロジェクトに沿って新しいサブプロジェクトを宣言する方が簡単だと思います。

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

次に、そのパッケージで追加の依存関係を宣言できます。この余分なプロジェクトをパッケージ化すると、すべてが自動的にパッケージ化されます。

于 2012-08-03T17:42:44.300 に答える