This error occurs because maven by default uses jdk 1.3 for compiling. As you know java 1.3 does not support annotations. So in order to avoid this error you need to use a newer version of java. Maven provides a plugin to compile your code to a specific java version. Add the following in your pom.xml source code. Then it should do the trick.
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
No comments:
Post a Comment