Maven

Fixing “use -source 5 or higher to enable generics” during Maven compilation

I just wanted to compile & assemble a Maven project using mvn assembly:assembly and got the following error:

Compilation failure […]
(use -source 5 or higher to enable annotations)

To fix this error I needed to add

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<version>2.3.2</version>

<configuration>

<source>1.6</source>

<target>1.6</target>

</configuration>

</plugin>

to my pom.xml file.