Migrate from deprecated nexus-staging-maven-plugin to central-publishing-maven-plugin#53
Migrate from deprecated nexus-staging-maven-plugin to central-publishing-maven-plugin#53Copilot wants to merge 3 commits into
Conversation
…-maven-plugin Co-authored-by: garricko <1234201+garricko@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Migrates the release profile’s Maven Central publishing setup from the deprecated nexus-staging-maven-plugin to central-publishing-maven-plugin, updating the target endpoint and configuration keys.
Changes:
- Replaced
nexus-staging-maven-pluginwithcentral-publishing-maven-pluginin thereleaseprofile. - Updated
distributionManagementrepository id/url to the new “central” endpoint. - Updated plugin configuration (
serverId→publishingServerId,autoReleaseAfterClose→autoPublish) and removednexusUrl.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <distributionManagement> | ||
| <repository> | ||
| <id>ossrh</id> | ||
| <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> | ||
| <id>central</id> | ||
| <url>https://central.sonatype.com/api/v1/publisher</url> | ||
| </repository> | ||
| </distributionManagement> |
There was a problem hiding this comment.
The <distributionManagement><repository><url> is used by Maven’s deploy mechanism as a Maven repository base URL. https://central.sonatype.com/api/v1/publisher is a REST API endpoint (not a standard Maven repository layout), so mvn deploy in this profile is likely to fail when it attempts artifact uploads. Consider either (a) not overriding distributionManagement here and letting the central publishing plugin handle the upload/publish flow, or (b) configuring the build so the standard deploy step is skipped and publishing is performed only via the central publishing plugin’s goals (with distributionManagement not pointing at the API endpoint).
There was a problem hiding this comment.
@copilot apply changes based on this feedback by not overriding distributionManagement
There was a problem hiding this comment.
Removed the distributionManagement override from the release profile. The central-publishing-maven-plugin now handles the deployment flow through its own mechanism. (27ad16f)
Co-authored-by: garricko <1234201+garricko@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
The
nexus-staging-maven-pluginis deprecated. Maven Central now uses thecentral-publishing-maven-pluginfor artifact publication.Changes
Plugin replacement:
org.sonatype.plugins:nexus-staging-maven-plugin:1.6.6→org.sonatype.central:central-publishing-maven-plugin:0.6.0Configuration parameters:
serverId→publishingServerIdnexusUrl→ (removed)autoReleaseAfterClose→autoPublishRemoved distributionManagement override:
distributionManagementsection in the release profile has been removed to allow the central-publishing-maven-plugin to handle the deployment flow through its own mechanism, rather than using Maven's standard deploy process.All changes are scoped to the
releaseprofile. The GPG signing configuration remains unchanged.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.