]> source.dussan.org Git - jgit.git/commitdiff
Allow using JDK 7 bootclasspath when compiling JGit using Java 8 29/75529/3
authorMatthias Sohn <matthias.sohn@sap.com>
Sun, 19 Jun 2016 10:45:37 +0000 (12:45 +0200)
committerSaša Živkov <sasa.zivkov@sap.com>
Tue, 21 Jun 2016 08:55:52 +0000 (10:55 +0200)
When compiling jgit using Java 8 set system property JDK_HOME to
JAVA_HOME path of JDK7 installation to compile against JDK 7 class
libraries. Otherwise jgit may hit runtime exceptions when running on
Java 7 (e.g. return type of ConcurrentHashMap.keySet() in JDK 8 class
library doesn't exist in JDK 7).

Example:
$ mvn clean install -DJDK_HOME=/.../jdk1.7.0_80.jdk/Contents/Home

Bug: 496262
Change-Id: Ib6abe5e544e0492e08b342e1a34b182caf25f94f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
pom.xml

diff --git a/pom.xml b/pom.xml
index 17995b62bb5417fe2d8fc80bbd5ac3bd324afbb7..81c04cea30c71cc5964894356ae1969a92fda45c 100644 (file)
--- a/pom.xml
+++ b/pom.xml
 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-
     <maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
     <bundle-manifest>${project.build.directory}/META-INF/MANIFEST.MF</bundle-manifest>
+    <!-- set JDK_HOME to JAVA_HOME path of JDK7 installation in order to compile against JDK 7 class library -->
+    <JDK_HOME>${JAVA_HOME}</JDK_HOME>
 
     <jgit-last-release-version>4.2.0.201601211800-r</jgit-last-release-version>
     <jsch-version>0.1.53</jsch-version>
             <encoding>UTF-8</encoding>
             <source>1.7</source>
             <target>1.7</target>
+            <compilerArguments>
+              <bootclasspath>${JDK_HOME}${file.separator}jre${file.separator}lib${file.separator}rt.jar${path.separator}${JDK_HOME}${file.separator}jre${file.separator}lib${file.separator}jsse.jar${path.separator}${JDK_HOME}${file.separator}jre${file.separator}lib${file.separator}jce.jar</bootclasspath>
+            </compilerArguments>
           </configuration>
         </plugin>