2017-09-22 110 views
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. 
+2

'Javax.json'已經在Java中9下降:https://jaxenter.com/json-api-dropped-java-9-113028.html – Ferrybig

+0

我我剛剛聽說json是一個java jdk-9的核心支持,不是嗎? –

+0

你試圖使用什麼類的包? – nullpointer

回答

0

添加的依賴:

<dependency> 
    <groupId>org.glassfish</groupId> 
    <artifactId>javax.json</artifactId> 
    <version>1.1</version> 
</dependency> 
相關問題