Skip to content

Introduce javaVersion property for maven.compiler.* configuration - #551

Merged
slawekjaranowski merged 1 commit into
apache:masterfrom
slawekjaranowski:javaVersion
Nov 14, 2025
Merged

slawekjaranowski merged 1 commit into
apache:masterfrom
slawekjaranowski:javaVersion

Conversation

@slawekjaranowski

@slawekjaranowski slawekjaranowski commented Nov 13, 2025 •

Copy link
Copy Markdown
Member

child projects can simply override only one property, without additional profiles

@slawekjaranowski

Copy link
Copy Markdown
Member Author

@slawekjaranowski slawekjaranowski self-assigned this Nov 13, 2025
@slawekjaranowski slawekjaranowski added breaking Pull requests that break existing features enhancement New feature or request labels Nov 13, 2025

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks much better, thx !

@slawekjaranowski
slawekjaranowski merged commit 9d07deb into apache:master Nov 14, 2025
3 checks passed
@github-actions github-actions Bot added this to the ASF-36 milestone Nov 14, 2025
@slawekjaranowski
slawekjaranowski deleted the javaVersion branch November 14, 2025 07:10
Comment thread pom.xml
<!-- https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-release.html, affects m-compiler-p and m-javadoc-p -->
<maven.compiler.release>8</maven.compiler.release>
<minimalJavaBuildVersion>${maven.compiler.release}</minimalJavaBuildVersion>
<maven.compiler.release>${javaVersion}</maven.compiler.release>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wish I had reviewed this prior to release. This profile should set all 3. Some plugins still read maven.compiler.source and/or maven.compiler.target (formatting tools, static analysis tools, etc.) Not all plugins have been updated to know about maven.compiler.release and use it as an alternative. It was really convenient to have these set in one spot in the parent POM. Now that they are removed, they need to be added to every child POM to avoid breaking any builds using plugins that don't use maven.compiler.release.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, the premise of this PR was a bit misleading: users already could set all three with one property in apache-35. They only needed to set maven.compiler.target. That's not ideal, and having the single javaVersion property is certainly better (though I prefer all lowercase, java.version or similar), but I still think the profile for 9+ should set all 3.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I opened #569 to implement my suggestion to keep the source and target properties in the jdk9+ profile.

slachiewicz added a commit that referenced this pull request Sep 10, 2026
Parents 32 to 35 already derived release from target; 36 (#543, #551)
moved it to javaVersion, so the notice must say 36, not 32.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Pull requests that break existing features enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants