Hi all,
Be aware of that configuration [1]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.4</source>
<target>1.4</target>
</configuration>
</plugin>
[1]
http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html
means you want the compiled classes to be compatible with JVM 1.4 (-target
1.4) not that you compile with the JDK 1.4.
It's not the same. For example, if you use some specific Java5 API without
any specific Java5 token (enum, annotation...), you can compile your
classes with a JDK 1.5 with a target 1.4 but not with the JDK 1.4.
If your really want to compile with an other JDK you need to specify the
rt.jar appropriate like this [2]
<configuration>
<source>1.4</source>
<target>1.4</target>
<compilerArguments>
<verbose />
<bootclasspath>${java14.home}/lib/rt.jar</bootclasspath>
</compilerArguments>
</configuration>
[2]
http://maven.apache.org/plugins/maven-compiler-plugin/examples/pass-compiler-arguments.html
Rémy