gradle-nexus / publish-plugin

Gradle plugin for publishing to Nexus repositories
Apache License 2.0
401 stars 29 forks source link

need help for multi module project release #83

Closed christian-draeger closed 3 years ago

christian-draeger commented 3 years ago

hey i just stumbled over the plugin when @marcphilipp was tweeting about it in february. since i was in a bigger refactoring of the skrape{it} kotlin library at this time and made it a gradle multi-module project, i also have to think about how to release these modules. which lead me to the basically 2 questions and i hope one could help even if only 1 of the questions is directly related to the publish-plugin. ☺️

(general) question 1: now that i have multiple modules that i want to release each as well as an "Aggregator" that just ships all of them. An approach equal to what junit-jupiter is doing for instance. What would be the best approach in versioning when one of the modules would need a version bump because implementation has changed? either just increase the version number of this specific module and release it as well as the aggregator but leave the other module versions as they are or bump all module versions to avoid possible version incompatibilities and make clear they have been tested to play well together?

(publish-plugin) question 2: before skrape{it}'s multimodule refactoring the library was monolithic and there was one jar that has been released to sonatype nexus / maven central. to release it we used vanniktech/gradle-maven-publish-plugin which was chosen because of it's simplicity and it worked well so far BUT now it doesn't seem to work with multi-module projects as expected (add least the pom files dependency section i get is looking wrong) and i wanted to migrate to the gradle-nexus publish-plugin anyway. long story short,here i am 😁. i want to release the mentioned modules but was a bit lost while trying the plugin / try to understand the readme since it looked to me that some parts are missing (but don't know really). could you give any guidance on how to configure my gradle build to fulfill my described behavior? i couldn't find any hints on multi module projects in the docs as well as how the gpg signing, adding pom descriptions etc works.

an extended version of the readme example that clarifies how to add pom description and other pom meta data, signing the jar (gpg key location configuration), and if there are things that should be considered when dealing with multi-module project releases would be great. if one would be open to help me migrating skrape{it} to use gradle-nexus/publish-plugin would be awesome as well 😁

christian-draeger commented 3 years ago

ok just found #78 so at least how to add pom description etc is clear now

marcphilipp commented 3 years ago

What would be the best approach in versioning when one of the modules would need a version bump because implementation has changed? either just increase the version number of this specific module and release it as well as the aggregator but leave the other module versions as they are or bump all module versions to avoid possible version incompatibilities and make clear they have been tested to play well together?

You could just bump the version of the affected module and publish it along with the aggregator. In JUnit we always release all modules even those without changes. If nothing else that makes our lives easier and reduces the potential for confusion but it's really up to you.

ok just found #78 so at least how to add pom description etc is clear now

Does that mean your second question is fully answered? Fair point wrt. documentation. We've just discussed putting together a full example in #79.

I'm closing this issue for now as I think all questions have been answered and there's nothing left to do. Please speak up should you feel differently.