0
我已將項目升級到jdk-9 env。但是,當我推分行,我遇到了一個建設的問題,特拉維斯慈沒有找到包「Javax.json」如下: 我的配置:travis ci在java9上構建失敗
{
"language": "java",
"install": "mvn install -DskipTests=true -Dmaven.javadoc.skip=true",
"jdk": "oraclejdk9",
"group": "stable",
"dist": "trusty",
"os": "linux"
}
(部分)錯誤信息:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/travis/build/ArvinSiChuan/TwentySeventeenAutumn/src/main/java/com/arvinsichuan/helloidea/HelloIdea.java:[7,18] package javax.json does not exist
[ERROR] /home/travis/build/ArvinSiChuan/TwentySeventeenAutumn/src/main/java/com/arvinsichuan/mongojdbc/MongoJDBC.java:[14,18] package javax.json does not exist
[ERROR] /home/travis/build/ArvinSiChuan/TwentySeventeenAutumn/src/main/java/com/arvinsichuan/mongojdbc/MongoJDBC.java:[15,18] package javax.json does not exist
[ERROR] /home/travis/build/ArvinSiChuan/TwentySeventeenAutumn/src/main/java/com/arvinsichuan/mongojdbc/MongoJDBC.java:[48,9] cannot find symbol
symbol: class JsonObjectBuilder
location: class com.arvinsichuan.mongojdbc.MongoJDBC
[ERROR] /home/travis/build/ArvinSiChuan/TwentySeventeenAutumn/src/main/java/com/arvinsichuan/mongojdbc/MongoJDBC.java:[48,41] cannot find symbol
symbol: variable Json
location: class com.arvinsichuan.mongojdbc.MongoJDBC
[INFO] 5 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.799 s
[INFO] Finished at: 2017-09-22T05:49:56Z
[INFO] Final Memory: 23M/512M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-
plugin:3.1:compile (default-compile) on project JEETwentySeventeenAutumn:
Compilation failure: Compilation failure:
[ERROR] /home/travis/build/ArvinSiChuan/TwentySeventeenAutumn/src/main/java/com/arvinsichuan/helloidea/HelloIdea.java:[7,18] package javax.json does not exist
[ERROR] /home/travis/build/ArvinSiChuan/TwentySeventeenAutumn/src/main/java/com/arvinsichuan/mongojdbc/MongoJDBC.java:[14,18] package javax.json does not exist
[ERROR] /home/travis/build/ArvinSiChuan/TwentySeventeenAutumn/src/main/java/com/arvinsichuan/mongojdbc/MongoJDBC.java:[15,18] package javax.json does not exist
[ERROR] /home/travis/build/ArvinSiChuan/TwentySeventeenAutumn/src/main/java/com/arvinsichuan/mongojdbc/MongoJDBC.java:[48,9] cannot find symbol
[ERROR] symbol: class JsonObjectBuilder
[ERROR] location: class com.arvinsichuan.mongojdbc.MongoJDBC
[ERROR] /home/travis/build/ArvinSiChuan/TwentySeventeenAutumn/src/main/java/com/arvinsichuan/mongojdbc/MongoJDBC.java:[48,41] cannot find symbol
[ERROR] symbol: variable Json
[ERROR] location: class com.arvinsichuan.mongojdbc.MongoJDBC
[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
The command "mvn install -DskipTests=true -Dmaven.javadoc.skip=true" failed
and exited with 1 during .
Your build has been stopped.
'Javax.json'已經在Java中9下降:https://jaxenter.com/json-api-dropped-java-9-113028.html – Ferrybig
我我剛剛聽說json是一個java jdk-9的核心支持,不是嗎? –
你試圖使用什麼類的包? – nullpointer