Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

In this thread, Nicolas De Loof writes:

I solved the issue of compiling the application code for Java 1.3 AND
using java5 for tests :

Application code is compiled based on java 1.3 using compiler
bootclasspath argument.

Tests are compiled by adding a compiler execution prior to test-phase
(as I didn't find a way to configure testCompile to use a != configuration).

Here is my POM :

           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <configuration>
                   <source>1.3</source>
                   <target>1.3</target>
                   <compilerArguments>
                       <bootclasspath>${settings.localRepository}/com/sun/rt/1.3.1_08/rt-1.3.1_08.jar</bootclasspath>
                   </compilerArguments>
               </configuration>
               <executions>
                   <execution>
                       <id>compile-tests</id>
                       <phase>process-test-sources</phase>
                       <goals>
                           <goal>testCompile</goal>
                       </goals>
                       <configuration>
                           <source>1.5</source>
                           <target>1.5</target>
                           <compilerArguments>
                               <bootclasspath>
                                   ${java.home}/lib/rt.jar
                               </bootclasspath>
                           </compilerArguments>
                       </configuration>
                   </execution>
               </executions>
               <dependencies>
                   <dependency>
                       <groupId>com.sun</groupId>
                       <artifactId>rt</artifactId>
                       <version>1.3.1_08</version>
                   </dependency>
               </dependencies>
           </plugin>
  • No labels