Jenkins,Maven错误:[错误](使用-source 5或更高版本启用注释)

时间:2016-09-08 05:58:53

标签: java maven jenkins

通过Jenkins运行项目时遇到这个问题,通过eclipse正常工作。

System config:
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.7.0_79/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "4.2.0-42-generic", arch: "amd64", family: "unix"

Error log:
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1.879s
    [INFO] Finished at: Thu Sep 08 11:16:50 IST 2016
    [INFO] Final Memory: 13M/301M
    [INFO] ------------------------------------------------------------------------
    Waiting for Jenkins to finish collecting data
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:testCompile (default-testCompile) on project TestConnect: Compilation failure: Compilation failure:
    [ERROR] (use -source 5 or higher to enable annotations)
    [ERROR] /var/lib/jenkins/workspace/TestConnectTestSuite/src/test/java/com/Delphi/TestNG/DetailsTest.java:[10,3] error: annotations are not supported in -source 1.3

1 个答案:

答案 0 :(得分:1)

按照它的说法 - 编辑pom.xml并可能更改为

 <configuration>
    <source>1.7</source>
    <target>1.7</target>
</configuration>