这是最烦人的错误之一?我能理解的是我使用的是较低版本的Java进行编译。如何为maven指定java版本?
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project springAopMavenDemo: Compilation failure D:\JAVA Stuffs\projects\springAopMavenDemo\src\main\java\service\EmployeeServiceImpl.java:[13,1] annotations are not supported in -source 1.3 (use -source 5 or higher to enable annotations) @Service -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
我真的很感谢任何帮助......我正在使用 NetBeans 7.0 和 Maven 3
最佳答案
你需要告诉maven源代码应该编译到哪个版本的java
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html
关于spring - Maven错误 "annotations are not supported.....",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6315781/