Created
September 10, 2020 20:19
-
-
Save bondolo/37536d91df16db1362ae393230d7b89b to your computer and use it in GitHub Desktop.
Conditionally activating <release> with Java 9+ Maven Compiler plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<profile> | |
<id>Java 9+ configuration</id> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<configuration> | |
<!-- Use -release compiler option rather than source/target if 9+ --> | |
<release>${maven.compiler.target}</release> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
<activation> | |
<jdk>[1.9,)</jdk> | |
</activation> | |
</profile> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment