Fix sources-jar signing: attach-sources ran after gpg:sign, not before - #146
Merged
Merged
Conversation
…existed
All three real modules bound maven-source-plugin's attach-sources
execution to the verify phase instead of package. maven-gpg-plugin's
sign-artifacts execution (release profile) is also bound to verify, and
package always runs before verify - but within the SAME phase, execution
order follows declaration/inheritance order, and the parent-inherited
gpg execution ran before the child's own attach-sources. gpg therefore
signed only the main jar + javadoc jar + pom, silently omitting the
sources jar on every module.
This caused the first real v1.1.0 release attempt to fail Sonatype
Central's deployment validation ("Missing signature for file:
*-sources.jar" on all three real modules) - caught only on that real
attempt, since every prior local dry run used -Dgpg.skip=true, which
also skips the real execution-order interaction between these two
plugins.
Fix: bind attach-sources to package (its own goal default) in all three
modules. Verified with a real throwaway GPG key (not skip=true): gpg now
signs 4 files for srcmorph and srcmorph-maven-plugin (was 3), 5 for
srcmorph-cli (was 4, includes the fat jar), and every module's target/
now has a *-sources.jar.asc on disk. Full `mvn clean verify` still
passes.
bernardladenthin
had a problem deploying
to
maven-central
July 15, 2026 22:28 — with
GitHub Actions
Failure
bernardladenthin
had a problem deploying
to
maven-central
July 15, 2026 22:28 — with
GitHub Actions
Failure
bernardladenthin
had a problem deploying
to
startgate
July 15, 2026 22:28 — with
GitHub Actions
Error
7 tasks
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
v1.1.0release attempt failed Sonatype Central's deployment validation: "Missing signature for file:*-sources.jar" on all three real modules (srcmorph,srcmorph-cli,srcmorph-maven-plugin). Nothing was published — Central's validator rejects an incomplete bundle before it ever goes live.maven-source-plugin'sattach-sourcesexecution to theverifyphase instead ofpackage.maven-gpg-plugin'ssign-artifactsexecution (release profile) is also bound toverify;packagealways runs beforeverifyin the lifecycle, but within the same phase execution order follows declaration/inheritance order — the parent-inherited gpg execution ran before the child's ownattach-sources, so gpg signed only the main jar + javadoc jar + pom, silently omitting the sources jar.-Dgpg.skip=truespecifically to avoid real signing — which also skipped the real execution-order interaction between these two plugins.attach-sourcestopackage(its own goal default phase) in all three modules.Test plan
mvn -P release verify -DskipTests -Dgpg.keyname=..., noskip=true) to actually exercise signingsrcmorphandsrcmorph-maven-pluginnow sign 4 files each (was 3 — main jar, sources jar, javadoc jar, pom);srcmorph-clisigns 5 (was 4 — includes the fat jar); the relocation stub signs its 1 pomtarget/now has a*-sources.jar.ascon diskmvn clean verifyfrom repo root — BUILD SUCCESSRelated issues / PRs
Follow-up to #144 and #145 — fixes the failure from the first real
v1.1.0release attempt (run 29454140213).Checklist
CONTRIBUTING.mdandCODE_OF_CONDUCT.mdGenerated by Claude Code