Maven Compilation Failure (not supported in source 1.3)
We recently started using Atlassian’s continuous Integration server – Bamboo for our continuous builds.
The project compiles fine on Eclipse IDE and also works properly on the command line (using the command mvn compile).
However when the built is done on Bamboo, we get the following errors:
annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
generics are not supported in -source 1.3
(use -source 5 or higher to enable generics)
We were confused because in Bamboo Build Resources configuration in the Administration section the JDK was set to JDK 1.6.0_23, so we shouldn’t be having problems with annotations or generics.
Turns out that Maven using JDK 1.3 by default for compiling, building and packaging.
Include the maven plugin compiler in the pom.xml and specify the JDK version.
org.apache.maven.plugins maven-compiler-plugin 1.6
Now Maven will use JDK 1.6 for compilations, building and packaging