-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Simplify Central deployment & update Release Process guide #2902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify Central deployment & update Release Process guide #2902
Conversation
| <snapshotRepository> | ||
| <id>sonatype-nexus-snapshots</id> | ||
| <url>https://central.sonatype.com/repository/maven-snapshots/</url> | ||
| </snapshotRepository> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think currently Gson publishes no snapshots, and if I understand it correctly that URL is also the default for central-publishing-maven-plugin.
Edit: See Constants.java in the plugin source (unofficial mirror code; this seems to match the official plugin code in the -sources.jar).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, yes.
| ## Configuring a machine for deployment to Sonatype Repository | ||
|
|
||
| This section was borrowed heavily from [Doclava release process](https://code.google.com/archive/p/doclava/wikis/ProcessRelease.wiki). | ||
|
|
||
| 1. Install/Configure GPG following this [guide](https://blog.sonatype.com/2010/01/how-to-generate-pgp-signatures-with-maven/). | ||
| 1. [Create encrypted passwords](https://maven.apache.org/guides/mini/guide-encryption.html). | ||
| 1. Create `~/.m2/settings.xml` similar to as described in [Doclava release process](https://code.google.com/p/doclava/wiki/ProcessRelease). | ||
| 1. Now for deploying a snapshot repository, use `mvn deploy`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this because it is most likely pretty outdated / there is probably better or more up to date information available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
Plugin only runs for `deploy` goal anyway so no need to have this in release profile. Additionally, the other modules (currently only `gson`) declare it as regular plugin, not inside a profile, as well.
…ory/maven-snapshots. @Marcono1234 notes [in a GSON PR](google/gson#2902 (comment)) that this appears to be the default. So let's not re-specify the default. (Compare cl/799337152.) If this CL goes well, I'll mail a similar CL (cl/805841232) for our other projects. RELNOTES=n/a PiperOrigin-RevId: 805842432
…ory/maven-snapshots. @Marcono1234 notes [in a GSON PR](google/gson#2902 (comment)) that this appears to be the default. So let's not re-specify the default. (Compare cl/799337152.) If this CL goes well, I'll mail a similar CL (cl/805841232) for our other projects. RELNOTES=n/a PiperOrigin-RevId: 805870501
eamonnmcmanus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this seems a lot simpler! I think we won't know 100% for sure whether it works until the next release, but we can adjust as necessary then. (I think it would be a bit annoying for users if we made a 2.13.3 release now just to check this.)
| <snapshotRepository> | ||
| <id>sonatype-nexus-snapshots</id> | ||
| <url>https://central.sonatype.com/repository/maven-snapshots/</url> | ||
| </snapshotRepository> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, yes.
| ## Configuring a machine for deployment to Sonatype Repository | ||
|
|
||
| This section was borrowed heavily from [Doclava release process](https://code.google.com/archive/p/doclava/wikis/ProcessRelease.wiki). | ||
|
|
||
| 1. Install/Configure GPG following this [guide](https://blog.sonatype.com/2010/01/how-to-generate-pgp-signatures-with-maven/). | ||
| 1. [Create encrypted passwords](https://maven.apache.org/guides/mini/guide-encryption.html). | ||
| 1. Create `~/.m2/settings.xml` similar to as described in [Doclava release process](https://code.google.com/p/doclava/wiki/ProcessRelease). | ||
| 1. Now for deploying a snapshot repository, use `mvn deploy`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
I tried with the "Testing Maven release workflow locally" steps in the Release Process guide, which is probably pretty close to how it behaves for a real release. But yes you are right, we can't be completely sure. Especially also in case the central-publishing-maven-plugin is updated in the meantime. |
|
Thanks again for doing this! |
Follow-up for #2900, trying to simplify the configuration and updating the Release Process guide.
The general approach that I used here is to declared the central-publishing-maven-plugin for the parent
pom.xml, but with<inherited>false</inherited>. Then only the submodules which should be deployed as well (currently onlygson) need to declare the plugin.That seems to work as desired and avoids having to apply central-publishing-maven-plugin configuration for all projects which should not be deployed.
However, it does require explicitly setting
skip=falsefor the maven-deploy-plugin. It seems otherwise for those modules which are not deployed (and don't have central-publishing-maven-plugin configured) the maven-deploy-plugin is not implicitly disabled.I have marked this as Draft for now to discuss some of the changes first, because they might have downsides. Also, feel free to do any other changes / simplifications independently; I will resolve the merge conflicts in this PR then.