Maven不会编译Java注释?
我在让 Maven 编译使用 Java 注释的项目时遇到问题。我收到以下错误消息:
annotations are not supported in -source 1.3 (use -source 5 or higher to enable annotations)
@PostConstruct
在我的 POM 中,我有以下编译器插件,那么首先它从哪里获取 -source 1.3?
<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>
我怀疑我可能错过了一些非常简单的东西来使其正常工作,但谷歌搜索错误并没有带来任何有用的信息
任何帮助将不胜感激
I'm having trouble getting maven to compile a project that uses Java annotations. I get the following error message:
annotations are not supported in -source 1.3 (use -source 5 or higher to enable annotations)
@PostConstruct
In my POM I have the following compiler plugin so for a start where is it getting -source 1.3 from?
<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>
I suspect I am probably missing something very simple to get this working but googling the error doesn't bring up anything helpful
Any help would be greatly appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您的
元素位于
部分中,而不仅仅位于
或< ;报告>
部分。Make sure that your
<plugin>
element is inside<build>
section and not only in<pluginManagement>
or<reporting>
sections.