Jan*_*ner 5 java pom.xml maven
我从我们的svn下载了一个项目,现在我正在尝试使用Maven构建它(mvn clean install ...我的maven是Apache Maven 3.0.4).不幸的是,当我尝试构建时,会发生以下错误.奇怪的是它报告了一些关于Java版本1.3的东西(我认为),当然我没有在我的笔记本电脑中安装它.我已经JAVA_HOME设置为JDK 1.7,我的javac也是1.7版本...
请问你知道问题出在哪里吗?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project irapi: Compilation failure: Compilation failure:
[ERROR] /home/jan/nutch/src/plugin/irapi/src/main/java/cz/cvut/fit/linkedtv/irapi/rest/MediaServer.java:[21,1] error: **annotations are not supported in -source 1.3**
[ERROR]
[ERROR] (use -source 5 or higher to enable annotations)
[ERROR] /home/jan/nutch/src/plugin/irapi/src/main/java/cz/cvut/fit/linkedtv/irapi/solr/SolrQueryResponseConvertor.java:[35,26] error: **for-each loops are not supported in -source 1.3**
Run Code Online (Sandbox Code Playgroud)
您必须将源配置参数指定为maven-compiler-plugin,如下所示:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
另请参阅maven文档中的设置Java编译器的-source和-target以获取更多详细信息.