Skip to content

test: enable the multi-release toolchain IT on Maven 4 - #1222

Open
umrndem wants to merge 1 commit into
apache:maven-compiler-plugin-4.xfrom
umrndem:fix/toolchain-it-version-ranges-4x
Open

umrndem wants to merge 1 commit into
apache:maven-compiler-plugin-4.xfrom
umrndem:fix/toolchain-it-version-ranges-4x

Conversation

@umrndem

@umrndem umrndem commented Dec 2, 2026

Copy link
Copy Markdown

4.x counterpart of #1220 for #1099, as requested in the review.

Use compatible JDK ranges for the toolchain gate and compiler selections, keeping the Java 8/9 bytecode checks. Enabling the dormant test also exposed stale release settings: use 8 instead of 1.8, and restore the Java 9 execution's release from 17 to 9. Account explicitly for the empty Java 10 output directory in the JAR check.

With only JDK 17 configured, the original test is skipped. The fixed test runs and its Groovy JAR/bytecode checks pass from a clean build. The existing Java 8/9-specific JUnit cases still skip on Java 17.

mvn -Prun-its clean verify passed on Maven 4.0.0-rc-7 / Java 17: 22 unit tests and 82 integration builds passed, with 2 environment-specific skips. Checkstyle, Spotless and git diff --check passed.

AI helped with the patch, checks and PR text.


Signed-off-by: Muhammad Umar Nadeem <umrndem@gmail.com>

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR correctly enables the multi-release toolchain IT on the maven-compiler-plugin-4.x branch. The changes are well-scoped and consistent with companion PR #1220 on master.

Changes reviewed:

  • invoker.properties: 1.9 → [10,) gate is correct — exact EOL JDK versions like 1.9 are unavailable in modern CI; the range properly accepts any JDK 10+ installed.
  • pom.xml — base.java.version: 1.8 → 8: Clean modernization. --release 8 is the standard form for JDK ≥ 9; removing the 1.x alias is correct. The derived toolchain selector [8,) works as intended since the IT gate already requires JDK ≥ 10.
  • pom.xml — java9 execution: release=17 → 9, jdkToolchain=17 → [9,): This fixes a stale setting that would have produced Java 17 bytecode (major 61) instead of Java 9 (major 53), causing the existing assert 53 == getMajor(...) assertions in verify.groovy to fail.
  • pom.xml — java10 toolchain: 10 → [10,): Consistent with the same range-based approach.
  • verify.groovy: The added META-INF/versions/10/ directory entry assertion correctly accounts for the empty output directory produced by the java10 execution (which has no source files in src/main/java10/). The mrjar.size() == 17 → 18 update is accurate.

The 4.x port goes slightly further than #1220 (master) by also fixing the stale release=17 and adding the java10 directory assertion — both are Maven 4.x-specific behaviors that weren't issues on master.

Pre-fix validation: dynamic check not applicable (IT requires a specific toolchain setup); the static analysis is conclusive — release=17 with assert 53 == getMajor(...) is a guaranteed assertion failure.

LGTM. No issues found.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

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.

2 participants