Skip to content

Accept the 1.x spelling for the javac release version - #516

Merged
slachiewicz merged 1 commit into
masterfrom
agent/release-1x-spelling
Sep 10, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/release-1x-spelling

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

-source and -target accept both 8 and 1.8, but --release only accepts 8, and javac rejects the other form with release version 1.8 not supported. This maps 1.5 to 1.8 onto 5 to 8 when building the --release argument and passes every other value through unchanged. The Eclipse compiler adapter already does this for 1.9.

This came out of apache/maven-apache-parent#608, where a parent deriving maven.compiler.release from a child's maven.compiler.target was considered; that parent change was dropped because maven-compiler-plugin 4.x cannot combine the properties, so this is a standalone convenience: a release written the way target has always been written works instead of failing.

Verified: mvn verify -pl plexus-compilers/plexus-compiler-javac -am → 140 tests in the javac module, 0 failures, including the new testReleaseVersionInLegacySpelling.

This change was created with AI assistance.

-source and -target take both 8 and 1.8, --release takes only 8, and
javac rejects the other form with "release version 1.8 not supported".
Mapping 1.5 to 1.8 onto 5 to 8 lets a parent POM derive the release
from the target a child already declares, whatever spelling it uses.
The Eclipse compiler already does the same for 1.9.
@slachiewicz slachiewicz added the enhancement New feature or request label Sep 10, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 10, 2026 21:19
@slachiewicz
slachiewicz merged commit 0db8fca into master Sep 10, 2026
36 checks passed
@slachiewicz
slachiewicz deleted the agent/release-1x-spelling branch September 10, 2026 21:34
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.

1 participant