I am trying to compile a maven project, the source code uses Generics and other featuers of Java 1.5, thus causing my build to fail
In my POM.xml
I have
You have to set some properties to compile with java 1.5
<properties>
<!-- maven-compiler-plugin configuration -->
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>1.5</maven.compiler.target>
</properties>
You configured the assembly-plugin with some information about source/target but to configure the compiling you need to configure the compiler-plugin in the correct way.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
Update: This should be combined with maven-enforcer-plugin to force really using of JDK 1.5 instead of only using source/target option of the javac.