Skip to content

Commit

Permalink
Set automatically -release flag to java.level when running JDK9+
Browse files Browse the repository at this point in the history
This avoids linking against APIs not present in the configured
java.level

https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#release
  • Loading branch information
Vlatombe committed Oct 11, 2021
1 parent 17ee01b commit fdc5831
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,22 @@
<java.level>8</java.level>
</properties>
</profile>
<profile>
<id>jdk-above-9</id>
<activation>
<jdk>[1.9,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${java.level}</release>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jenkins-release</id>
<properties>
Expand Down

0 comments on commit fdc5831

Please sign in to comment.