I have a SBT project which I was publishing to Sonatype with no issue and I converted it to a multi-module SBT project. Now I want to:
publish the jar/javadoc/sources/pom file containing all the aggregated submodules to Sonatype (meaning that they should be signed with the sbt-pgp plugin)
publish each individual submodule to Sonatype as well
I tried to use the sbt assembly plugin for this but didn't manage to get very far. Do you have a sample Build.scala file which would show what is the best structure to accomplish this?
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.
I use the sbt assembly plugin for Casbah - https://github.com/mongodb/casbah
Casbah has a top level aggregate project but I also package a single all dependencies jar by adding an extra artifact to the build:
addArtifact(Artifact("casbah-alldep", "pom", "jar"), assembly),
See the build file for more info: https://github.com/mongodb/casbah/blob/master/project/CasbahBuild.scala
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With