Annotations are not supported in -source 1.3 – Maven


Building a Maven project, hit following annotation error message in Maven output console.

[INFO] Compilation failure
[8,2] annotations are not supported in -source 1.3 
(use -source 5 or higher to enable annotations)


Maven default is using JDK1.3 for the project compilation, building or packaging (mvn compile, install). Since JDK1.3 is not support annotation, if your project has annotation, you need to configure your Maven to use the latest JDK version. The solution is very simple, just include the Maven compiler plugin and specify the JDK version. For example,

<project ....>

Above declaration tell Maven to use JDK 1.6.


Tags :

About the Author

Founder of and, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.