Fix effective-pom_properties IT for Maven 4 compatibility#371
Conversation
The effective-pom_properties IT's verify.groovy was updated in PR apache#344 (merged 2025-10-31) to assert that user properties override pom properties on Maven 4, expecting maven.compiler.source/target=8 in the rendered effective POM. However the change updated only verify.groovy. The corresponding invoker.properties was never extended to actually pass the user properties into the invoked Maven build, so the assertion fired unconditionally on Maven 4 (the rendered effective POM legitimately showed the pom-property values 1.6/1.6). Add invoker.systemProperties.maven.compiler.source/target=8 so the IT exercises the assertion path it was rewritten for. No production code change; only the IT fixture. This unblocks PR apache#363 (enable Maven 4 CI matrix). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| @@ -16,3 +16,9 @@ | |||
| # under the License. | |||
|
|
|||
| invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:effective-pom | |||
There was a problem hiding this comment.
^M ... looks like problem with file encoding
There was a problem hiding this comment.
oh, no encoding, but Windows newline!
hboutemy
left a comment
There was a problem hiding this comment.
newlines on Windows: I don't know what config could be improved to avoid such stupid lost time in the future
| @@ -16,3 +16,9 @@ | |||
| # under the License. | |||
|
|
|||
| invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:effective-pom | |||
There was a problem hiding this comment.
oh, no encoding, but Windows newline!
|
Well, there is some inconsistency on this repository wrt to line endings of *.properties:
|
|
...
BTW: If you opt for the second option (normalization) we could also add a proper .gitattributes file to prevent such inconsistencies for the future. IMHO this would perhaps call for a second line of defense in the future by a spotless rule. But perhaps we currently we have more urgent stuff to do ... |
|
notice: I want to drop this PR fully we'll see the newlines normalization in a separate PR |
|
Superseded by 2c155b2 ("revert broken IT updates from #344") on master — thanks @hboutemy. That commit takes exactly the approach this analysis pointed to: a plain revert of the Verified locally green on 4.0.0-rc-5 and 3.9.16. Closing as obsolete. |
Summary
The
effective-pom_propertiesintegration test is the single IT failing under Maven 4.0.0-rc-5 on master, which leaves PR #363 ("enable build with Maven 4") with a red CI matrix. This PR fixes the IT fixture so the rc-5 matrix turns green.Root cause
verify.groovywas updated in #344 (merged 2025-10-31) to branch onmavenVersion.startsWith('4.')and assert thatmaven.compiler.source/target = 8appear in the rendered effective POM — testing that user properties override pom properties on Maven 4.The change updated only
verify.groovy. The companioninvoker.propertieswas never extended to actually pass-Dmaven.compiler.source=8 -Dmaven.compiler.target=8(or theinvoker.systemProperties.*form) into the invoked Maven build. So under Maven 4 the invocation didn't define those user properties at all, the rendered effective POM legitimately showed the pom-property values (1.6/1.6), and the new Maven-4 assertion fired unconditionally.The bug is entirely in the IT fixture; the production
MavenHelpPluginis unaffected.Fix
Three lines added to
src/it/projects/effective-pom_properties/invoker.properties:Verification
mvn -P run-its -Dinvoker.test='effective-pom_properties' verifyagainst Maven4.0.0-rc-5(sdkman, JDK 17.0.18 Temurin / macOS aarch64): Passed: 1, Failed: 0, Errors: 0, Skipped: 0.Context
maven4-enabled: true).