Author: sebb
Date: Fri Jan  9 17:32:06 2015
New Revision: 1650607

URL: http://svn.apache.org/r1650607
Log:
More detail on using Maven with alternate JDKs

Modified:
    commons/cms-site/trunk/content/xdoc/building.xml

Modified: commons/cms-site/trunk/content/xdoc/building.xml
URL: 
http://svn.apache.org/viewvc/commons/cms-site/trunk/content/xdoc/building.xml?rev=1650607&r1=1650606&r2=1650607&view=diff
==============================================================================
--- 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>
     <subsection name='Configuring local properties'>
       <p>
-      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.
       </p>
     </subsection> 
   </section>
 
   <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">
       <p>
         To run a component's tests:


Reply via email to