Return-Path:
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
- To compile source and test files with Java 1.6 if settings.xml does not contain the property definitions:
+ To compile source and test files with Java 1.6 if settings.xml does not contain the property definitions
+ (note this overrides any definition in settings.xml):
settings.xml
+ or has been defined as an OS environment variable (if both are defined, settings.xml takes precedence)
.class
file format is compatible with
the required Java version - but it does not prevent/catch the use of methods/classes which were
introduced in later Java versions (because the build will use the current Java libraries by default).
- The only way to ensure that components don't accidentally use classes/methods from a later
+ One way to ensure that components don't accidentally use classes/methods from a later
version of Java is to compile and test using actual Java versions.
@@ -259,7 +259,7 @@
In order for these profiles to work, you need to configure the relevant JAVA_1_N_HOME
- properties in your settings.xml
file.
+ properties in your settings.xml
file.
[There is no need to configure properties for profiles you don't need.]
Each property should be set to the directory
where the relevant version of the JDK is installed.
Note: the Maven compiler plugin has
@@ -304,19 +304,24 @@
]]>
- (Since the values are the locations of the Java installations on your local machine,
- they are unlikely to change frequently and using the settings.xml
file will be
- the most convenient).
+ An alternative is to define the home directories as OS environment variables.
+ For example:
+
- Once you have configured those properties you can, for example, compile and test with Java 1.6 using the following command: + Once you have configured settings.xml or defined the OS variables you can, for example, compile and test with Java 1.6 using the following command:
- If you don't want to update the settings.xml
file, you can provide the property definition on the command-line.
- (However for frequent use it is easier to update the settings file)
+ You can also provide the appropriate property definition on the command-line.
+ (However for frequent use it is easier to update the settings file or ensure the OS defines the appropriate variables)
+ This overrides any property setting in the settings.xml file, which in turn overrides the OS environment variable.
For example: