travis ci在java9上构建失败

时间:2017-09-22 06:29:54

标签: java travis-ci java-9

我已将项目升级为jdk-9 env。但是当我推动分支时,我遇到了一个建筑问题,travis-ci没有找到包“Javax.json”如下: 我的配置:

{
    "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.

1 个答案:

答案 0 :(得分:0)

添加依赖项:

<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.json</artifactId>
    <version>1.1</version>
</dependency>