Set automatically -release flag to java.level when running JDK9+
This avoids linking against APIs not present in the configured
java.level
<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>
