5

我有一个 SBT 项目,我将它发布到 Sonatype 没有问题,我将它转换为一个多模块 SBT 项目。现在我想:

  • 将包含所有聚合子模块的 jar/javadoc/sources/pom 文件发布到 Sonatype(这意味着它们应该使用 sbt-pgp 插件进行签名)

  • 也将每个单独的子模块发布到 Sonatype

我尝试为此使用sbt 程序集插件,但没有成功。您是否有一个示例 Build.scala 文件可以显示完成此任务的最佳结构是什么?

4

2 回答 2

3

I don't know if it's possible with currently available plugins, but using ScopeFilter, you might be able to create an artificial project that aggregates all sources, from there it's just the matter of calling publishSigned in there.

See how I aggregate source in sbt-unidoc.

Here's the proof of concept: https://github.com/eed3si9n/specs2/commit/18f6405c91cf995f621a84c65e05d66407ba4964

With the change I was able to run package, doc etc. You might have to aggregate *.class if you use macros.

于 2013-10-28T00:58:52.123 回答
1

我使用 Casbah 的 sbt 程序集插件 - https://github.com/mongodb/casbah

Casbah 有一个顶级聚合项目,但我还通过向构建添加额外的工件来打包单个所有依赖项 jar:

addArtifact(Artifact("casbah-alldep", "pom", "jar"), assembly),

有关更多信息,请参阅构建文件:https ://github.com/mongodb/casbah/blob/master/project/CasbahBuild.scala

于 2013-10-28T07:30:10.513 回答