Skip to content

Commit 867e4ce

Browse files
committed
Add release compiler argument on Java 9+
This avoids the "bootstrap class path not set in conjunction with -source 8" compiler warning and avoids the use of APIs not available on Java 8.
1 parent f7c0c10 commit 867e4ce

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

pom.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,32 @@
878878

879879
</profile>
880880

881+
<profile>
882+
<!-- this avoids a compiler warning on Java 9+ -->
883+
<!-- the compiler setting is not available on Java 8 -->
884+
<id>use-release-compiler-argument-on-java-9-or-more</id>
885+
<activation>
886+
<jdk>[9,)</jdk>
887+
</activation>
888+
<build>
889+
<plugins>
890+
<plugin>
891+
<artifactId>maven-compiler-plugin</artifactId>
892+
<version>${maven.compiler.plugin.version}</version>
893+
<configuration>
894+
<source>1.8</source>
895+
<target>1.8</target>
896+
<release>8</release>
897+
<compilerArgs>
898+
<arg>-Xlint:deprecation</arg>
899+
<arg>-Xlint:unchecked</arg>
900+
</compilerArgs>
901+
</configuration>
902+
</plugin>
903+
</plugins>
904+
</build>
905+
</profile>
906+
881907
</profiles>
882908

883909
</project>

0 commit comments

Comments
 (0)