Let the excludes IT see the POM pair Maven 4 installs - #332
Merged
Conversation
Maven 4 installs a build POM next to the consumer POM, and gpg signs both, so four POM files land in the local repository instead of two. sign-release-with-excludes is the only IT that walks the installed directory and rejects anything not on its list -- it has to, because it signs twice and its job is to prove the second run creates no .asc.asc -- so the two extra names made it fail under Maven 4. Add them to the list rather than skipping them, to keep the check exhaustive. The names are inert on Maven 3, which installs neither. The clause that skipped *consumer.pom had stopped matching anything: Maven 4 installs the consumer POM under the plain artifact name these days, and it is the build POM that carries the suffix.
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.
sign-release-with-excludesfails under Maven 4 with:Maven 4 installs a build POM alongside the consumer POM, and
gpg:signsigns both, so four POM files reach the local repository where Maven 3 puts two:Those two are the only new files; the rest of the directory is unchanged.
Why this IT and not the others
Ten of the ITs that keep an
expectedFileslist iterate the list and assert each file exists, so extra files never bother them. This one iteratesartifactDir.listFiles()and rejects anything not on the list. That inversion is deliberate: the project runsgpg:signtwice, and the point is to prove the second run does not sign the first run's signatures. A presence check cannot show the absence of a.asc.asc.So the fix adds the two names to
expectedFilesrather than adding a secondcontinue. Every skip is a hole in the one check whose value is that it is exhaustive. The names cost nothing on Maven 3, which installs neither.The removed clause
This has stopped matching anything. It arrived with 0771b61 ([MGPG-110], March 2024), when Maven 4 installed the consumer POM as
*-consumer.pom. Maven 4 now installs the consumer POM under the plaintest-1.0.pomname, and it is the build POM that carries a suffix — so the guard silently stopped guarding. Dropping it leaves one mechanism instead of two.If a Maven 4 version that still installs
*-consumer.pomis ever added to the matrix this would need revisiting, but the matrix is 4.0.0-rc-6 and 3.10.0-rc-1 today.Verification
Ran the IT locally against both, cleaning
targetbetween runs:Unexpected file …test-1.0-build.pom.ascBoth invoker executions (the
gpgsigner and thebcsigner) pass in each green run.Follow-up, not in this PR
Unlike its ten siblings, this IT never asserts that the expected files are present — it only rejects extras, so it would pass if gpg signed nothing at all. Worth adding, but it is a change to what the test proves rather than a Maven 4 fix.
This unblocks #330, which turns the Maven 4 matrix leg on and is currently red for exactly this reason.