aboutsummaryrefslogtreecommitdiffstats
path: root/pom.xml
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2020-12-28 18:51:57 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2021-09-29 17:13:01 +0200
commit1d280db1472f7ec4bf26d6a14f7c3d8a0292b0e7 (patch)
tree358613fff388b5336f7023ff681a63260561ec96 /pom.xml
parentf81a3fc91a51776e6b44a4fc0d9ba5ac488f2c9e (diff)
downloadjgit-1d280db1472f7ec4bf26d6a14f7c3d8a0292b0e7.tar.gz
jgit-1d280db1472f7ec4bf26d6a14f7c3d8a0292b0e7.zip
Enable compiler option --release
This ensures the compiler compiles against the public, supported and documented API for a specific VM version (here 11) [1]. This also means that we don't need EE descriptors in Eclipse anymore in order to ensure that only supported APIs of the selected Java version can be used. According to [2] if option --release is used --source and --target options can't be used. While we are at it also add default value for all new jdt core options added in Eclipse 4.21. [1] https://docs.oracle.com/en/java/javase/11/tools/javac.html [2] https://docs.oracle.com/en/java/javase/14/docs/specs/man/javac.html#option-release Change-Id: I852a5d7b0a3210751c15d79ec91915b4c01c41e2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'pom.xml')
-rw-r--r--pom.xml8
1 files changed, 2 insertions, 6 deletions
diff --git a/pom.xml b/pom.xml
index 8bff418db8..6094d518d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -148,8 +148,6 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
<java.version>11</java.version>
- <maven.compiler.source>${java.version}</maven.compiler.source>
- <maven.compiler.target>${java.version}</maven.compiler.target>
<bundle-manifest>${project.build.directory}/META-INF/MANIFEST.MF</bundle-manifest>
<jgit-last-release-version>5.12.0.202106070339-r</jgit-last-release-version>
@@ -821,8 +819,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
- <source>${java.version}</source>
- <target>${java.version}</target>
+ <release>${java.version}</release>
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne</arg>
@@ -851,8 +848,7 @@
<configuration>
<compilerId>eclipse</compilerId>
<encoding>UTF-8</encoding>
- <source>${java.version}</source>
- <target>${java.version}</target>
+ <release>${java.version}</release>
<!-- Passing arguments is a trainwreck, see https://issues.apache.org/jira/browse/MCOMPILER-123 -->
<compilerArguments>
<properties>${project.basedir}/.settings/org.eclipse.jdt.core.prefs</properties>