commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r1650607 - /commons/cms-site/trunk/content/xdoc/building.xml
Date Fri, 09 Jan 2015 17:32:06 GMT
Author: sebb
Date: Fri Jan  9 17:32:06 2015
New Revision: 1650607

More detail on using Maven with alternate JDKs


Modified: commons/cms-site/trunk/content/xdoc/building.xml
--- commons/cms-site/trunk/content/xdoc/building.xml (original)
+++ commons/cms-site/trunk/content/xdoc/building.xml Fri Jan  9 17:32:06 2015
@@ -74,16 +74,30 @@
     <subsection name='Configuring local properties'>
-      You only need to configure local properties if you want to build using
-      different versions of Java.
-      See <a href="commons-parent-pom.html#Testing_with_different_Java_versions">here</a>
+      If you regularly want to build Commons components using a different version of Java
+      than that used to run Maven, you may wish to define the locations of the alternate
+      JDKs in the Maven <code>settings.xml</code> file.
+      See <a href="commons-parent-pom.html#Testing_with_different_Java_versions">testing
with different Java versions</a>
       for more details.
+      Alternatively, you can provide the location of the alternate JDK as a property on the
Maven command-line, see below.
   <section name="Maven Commands">
+    <subsection name="Compile and test with a specific JDK">
+      <p>
+        To compile and run a component's tests with JDK 1.5.
+        This assumes that the property JAVA_1_5_HOME has been defined in the Maven <code>settings.xml</code>
+      </p>
+      <source>mvn clean test -Pjava-1.5</source>
+      <p>
+        To compile source and test files with Java 1.6 if settings.xml does not contain the
property definitions:
+      </p>
+      <source>mvn clean compile test-compile -Pjava-1.6 -DJAVA_1_6_HOME=path-to-jdk-home</source>
+    </subsection> 
     <subsection name="Running the Tests">
         To run a component's tests:

View raw message