Monday, September 19, 2011

maven-compiler-plugin configuration for annotations support

Several times I encountered the same problem when building with Maven:
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 1 source file to /home/stefano/works/
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
/home/stefano/works/test/src/main/java/it/stefano/[17,2] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
As I said I encountered it many times: I know it's a silly error, but every time I got to search the forums to find the soution (my short-time memory isn't so good, I admit....) so I decided to write a post about that.
The solution os very very simple. Just configure the maven-compiler-plugin like that:

No comments:

Post a Comment