現在、Java8で作成したMavenプロジェクトをJenkinsでビルドしているのですが、try-with-resource文について以下のエラーが発生しビルドに失敗します。
解決方法についてご存知でしたらお知らせください。
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ XXXXX ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to /var/lib/jenkins/workspace/XXXXX/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /var/lib/jenkins/workspace/XXXXX/src/main/java/jp/co/XXXXX/XXXXX/XXXXX.java:[34,21] try-with-resources is not supported in -source 1.5
(use -source 7 or higher to enable try-with-resources)
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.856 s
[INFO] Finished at: 2015-11-12T14:26:09+00:00
[INFO] Final Memory: 13M/168M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project billing: Compilation failure
[ERROR] /var/lib/jenkins/workspace/XXXXX/src/main/java/jp/co/XXXXX/XXXXX/XXXXX.java:[34,21] try-with-resources is not supported in -source 1.5
[ERROR] (use -source 7 or higher to enable try-with-resources)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
<環境>
Java 1.8.0_65
Maven 3.3.3
Jenkins 1.637
pom 4.0.0
その他、解決に必要な情報があればお知らせください。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/11/12 14:58
2015/11/12 15:27
2015/11/13 11:45