Skip to content

Fix effective-pom_properties IT for Maven 4 compatibility#371

Open
ascheman wants to merge 1 commit into
apache:masterfrom
aschemaven:fix-effective-pom-properties-it-maven4
Open

Fix effective-pom_properties IT for Maven 4 compatibility#371
ascheman wants to merge 1 commit into
apache:masterfrom
aschemaven:fix-effective-pom-properties-it-maven4

Conversation

@ascheman

@ascheman ascheman commented Jun 7, 2026

Copy link
Copy Markdown

Summary

The effective-pom_properties integration 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.groovy was updated in #344 (merged 2025-10-31) to branch on mavenVersion.startsWith('4.') and assert that maven.compiler.source/target = 8 appear in the rendered effective POM — testing that user properties override pom properties on Maven 4.

The change updated only verify.groovy. The companion invoker.properties was never extended to actually pass -Dmaven.compiler.source=8 -Dmaven.compiler.target=8 (or the invoker.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 MavenHelpPlugin is unaffected.

Fix

Three lines added to src/it/projects/effective-pom_properties/invoker.properties:

invoker.systemProperties.maven.compiler.source = 8
invoker.systemProperties.maven.compiler.target = 8

Verification

  • mvn -P run-its -Dinvoker.test='effective-pom_properties' verify against Maven 4.0.0-rc-5 (sdkman, JDK 17.0.18 Temurin / macOS aarch64): Passed: 1, Failed: 0, Errors: 0, Skipped: 0.
  • Without the fix the same invocation reproduces the failure that PR enable build with Maven 4 #363's CI shows.

Context

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant