Ethan Rose created HDDS-13670:
---------------------------------
Summary: Replace javac.version with maven.compiler.release
Key: HDDS-13670
URL: https://issues.apache.org/jira/browse/HDDS-13670
Project: Apache Ozone
Issue Type: Improvement
Reporter: Ethan Rose
Ozone's top level pom.xml defines a custom field {{javac.version}} which
defaults to java 8 but can be overridden manually. This looks like an artifact
we inherited from hadoop and pre-java 9 era when {{maven.compiler.source}} and
{{maven.compiler.target}} were set independently and we wanted one property to
map them to the same value.
As of maven compiler version 3.13.0, this is no longer necessary, even for jdk8:
>From the
>[docs|https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-release.html#usage-on-jdk-8]:
{quote}The --release option is not supported using JDK 8. However, since
Compiler plugin version 3.13.0 you can use the release property also on JDK 8.
The plugin will convert it to source and target automatically.
{quote}
We are using maven compiler plugin version 3.14.0, so we can remove our custom
{{javac.version}} field and just use the standard {{maven.compiler.release}}
field that devs from other maven projects would already be familiar with.
Note that by default everything in Ozone is built with jdk8 bytecode meaning
the release build we post is compatible with jdk8. To maintain this, we would
still need to set a default value for {{maven.compiler.release}} in our top
level pom instead of inheriting the one from the jdk, and higher bytecode
version could be built by specifying {{-Dmaven.compiler.release}} explicitly in
the build command.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]