Skip to content

Commit 849d0a2

Browse files
committed
Use javac --release instead of -source & -target
`--release` also verifies that only API from that Java version is used. Otherwise when building with a JDK newer than the target version it would be possible to accidentally use API not available in the target version. This also fixes this warning which is currently printed during the build: > [WARNING] system modules path not set in conjunction with -source 11
1 parent dd614bc commit 849d0a2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@
217217
<groupId>org.apache.maven.plugins</groupId>
218218
<artifactId>maven-compiler-plugin</artifactId>
219219
<configuration>
220-
<source>${java.target}</source>
221-
<target>${java.target}</target>
220+
<release>${java.target}</release>
222221
<compilerArgument>-Xlint:deprecation</compilerArgument>
223222
</configuration>
224223
</plugin>

0 commit comments

Comments
 (0)