Repository navigation
Fix snapshot publishing: server id mismatch in central-publishing-maven-plugin - #770
Merged
Merged
Conversation
central-publishing-maven-plugin was configured with publishingServerId=central, but distributionManagement's snapshotRepository (and the CI settings.xml) use the id sonatype-oss-snapshots. Since the plugin takes over the deploy phase, it couldn't resolve credentials for "central" and silently skipped the upload on every snapshot build, so pi4j-core and the plugins were never actually published despite CI reporting success. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The changed setting is not used by the configured snapshot path and instead affects release authentication.
Review effort: Balanced
Findings: 1
What changed in this PR
Updates Maven publishing credentials to address failed snapshot deployments.
Changes:
- Changes the Central publishing server ID to
sonatype-oss-snapshots.
| File | Description |
|---|---|
pom.xml |
Updates the publishing plugin’s server ID. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Oct 1, 2026
stefanhaustein
pushed a commit
to stefanhaustein/pi4j
that referenced
this pull request
Oct 2, 2026
The previous fix (Pi4J#770) was wrong — Copilot correctly pointed out that publishingServerId is never consulted for snapshot deploys once distributionManagement/snapshotRepository is defined, which it already was here. The real problem: central-publishing-maven-plugin (extensions=true) relies on an AbstractMavenLifecycleParticipant that mutates the raw POM Model at afterProjectsRead time to rebind the deploy phase to its own "publish" goal. Under this project's Maven 4.0.0-rc-5, that mutation does not propagate to the lifecycle executor, so neither the plugin's "publish" goal nor the default maven-deploy-plugin ends up bound to the deploy phase at all. `mvn deploy` therefore reports BUILD SUCCESS while uploading nothing, for every module, snapshot or release. Verified locally with a local staging deploy repository: zero deploy-phase executions with the plugin enabled, full reactor-wide deploy:deploy execution (pi4j-core and pi4j-plugin-ffm included) immediately after removing it. Since the actual release flow already goes through JReleaser (ci-release-to-maven.yml) independently of this plugin, and the existing distributionManagement/snapshotRepository config already has matching credentials in the CI-generated settings.xml, plain maven-deploy-plugin is sufficient for snapshot publishing. Also drops the plugin's now-dead reference in the unused "deploy" profile and its version property. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
IAmNickNack
pushed a commit
to IAmNickNack/pi4j
that referenced
this pull request
Oct 3, 2026
The previous fix (Pi4J#770) was wrong — Copilot correctly pointed out that publishingServerId is never consulted for snapshot deploys once distributionManagement/snapshotRepository is defined, which it already was here. The real problem: central-publishing-maven-plugin (extensions=true) relies on an AbstractMavenLifecycleParticipant that mutates the raw POM Model at afterProjectsRead time to rebind the deploy phase to its own "publish" goal. Under this project's Maven 4.0.0-rc-5, that mutation does not propagate to the lifecycle executor, so neither the plugin's "publish" goal nor the default maven-deploy-plugin ends up bound to the deploy phase at all. `mvn deploy` therefore reports BUILD SUCCESS while uploading nothing, for every module, snapshot or release. Verified locally with a local staging deploy repository: zero deploy-phase executions with the plugin enabled, full reactor-wide deploy:deploy execution (pi4j-core and pi4j-plugin-ffm included) immediately after removing it. Since the actual release flow already goes through JReleaser (ci-release-to-maven.yml) independently of this plugin, and the existing distributionManagement/snapshotRepository config already has matching credentials in the CI-generated settings.xml, plain maven-deploy-plugin is sufficient for snapshot publishing. Also drops the plugin's now-dead reference in the unused "deploy" profile and its version property. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
central-publishing-maven-pluginwas configured withpublishingServerId=central, butdistributionManagement/snapshotRepositoryuses idsonatype-oss-snapshots, and the CI snapshot workflow's generatedsettings.xmlonly defines a server with that latter id.extensions=true) takes over thedeployphase entirely, it couldn't resolve credentials forcentraland silently skipped the upload on every snapshot build —mvn deployreportedBUILD SUCCESSbut nothing was ever actually published.com/pi4j/pi4j-coredoesn't exist at all underhttps://central.sonatype.com/repository/maven-snapshots/, despite many "successful"ci-main-snapshot.ymlruns.com.pi4j:pi4j-core:5.0.0-SNAPSHOT.Fix
Set
publishingServerIdtosonatype-oss-snapshotsso it matches bothdistributionManagementand the CI-generatedsettings.xml.This only affects snapshot publishing — the release flow (
ci-release-to-maven.yml) builds with-DaltDeploymentRepository=local::file:./target/staging-deploy, which stages locally and hands off to JReleaser for the actual Maven Central upload, bypassing this server id entirely.Test plan
ci-main-snapshot.ymldeploy step now shows an actual upload/publish log line forpi4j-corecom.pi4j:pi4j-core:5.0.0-SNAPSHOT(andpi4j-plugin-ffm) become resolvable athttps://central.sonatype.com/repository/maven-snapshots/pi4j-driversCI build turns green again🤖 Generated with Claude Code