HDDS-13364. Use properties for Java/Maven version enforcement #8724
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
POM properties
enforced.java.versionandenforced.maven.versionare currently unused, enforcer plugin is configured with hard-coded values. This change is to start using the properties.Also bump minimum Maven version to 3.6.3, since it is required by the enforcer plugin anyway.
https://issues.apache.org/jira/browse/HDDS-13364
How was this patch tested?
Enforcer passes with software matching the default enforced versions:
$ java -version openjdk version "1.8.0_452" ... $ mvn -v Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) ... $ mvn -N validate ... [INFO] --- maven-enforcer-plugin:3.5.0:enforce (enforce-property) @ ozone-main --- [INFO] Rule 0: org.apache.maven.enforcer.rules.property.RequireProperty passed [INFO] Rule 1: org.apache.maven.enforcer.rules.version.RequireMavenVersion passed [INFO] Rule 2: org.apache.maven.enforcer.rules.version.RequireJavaVersion passed ... [INFO] BUILD SUCCESSUsing newer software with default enforced versions:
$ JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 mvn -N validate ... [INFO] BUILD SUCCESS $ ~/lib/apache-maven-3.9.9/bin/mvn -V -N validate Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937) ... [INFO] BUILD SUCCESSAlso with newer software using custom enforced versions:
$ JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 mvn -N validate -Djavac.version=11 ... [INFO] BUILD SUCCESS $ ~/lib/apache-maven-3.9.10/bin/mvn -V -N validate -Denforced.maven.version=3.9.9 Apache Maven 3.9.10 (5f519b97e944483d878815739f519b2eade0a91d) ... [INFO] BUILD SUCCESSBut fails with older ones:
CI:
https://github.com/adoroszlai/ozone/actions/runs/16018602189