Skip to content

Choose the versioned module descriptor by the target release - #240

Merged
slachiewicz merged 1 commit into
masterfrom
agent/target-release-descriptor
Sep 26, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/target-release-descriptor

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Adds setTargetRelease(JavaVersion) to ResolvePathsRequest and ResolvePathRequest, so callers such as maven-compiler-plugin and maven-javadoc-plugin pick META-INF/versions/<N>/module-info.class by their --release/-target rather than by the JDK running Maven. The default stays the running JDK, so callers that do not set it see no change.

Closes #237

AbstractBinaryModuleInfoParser and LocationManager.resolvePath picked the
versioned module-info.class of a multi-release jar or output directory by
counting down from the running JDK's version. Add ResolvePathsRequest.
setTargetRelease(JavaVersion) so callers such as maven-compiler-plugin can
pass the release the code is actually compiled for, and thread it through
resolvePaths to both the jar/directory lookup and the modulepath routing
check. Defaults to the running JDK, so behaviour is unchanged unless a
caller sets it.

Fixes #237
@slachiewicz slachiewicz added the enhancement New feature or request label Sep 25, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 26, 2026 00:00
@slachiewicz
slachiewicz merged commit 4f3f0c1 into master Sep 26, 2026
12 checks passed
@slachiewicz
slachiewicz deleted the agent/target-release-descriptor branch September 26, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Choose the versioned module descriptor by the target release, not the running JDK

1 participant