简体   繁体   中英

travis ci build failure on java9

I have upgraded my project to jdk-9 env. But when I pushed the branch, I met a building problem that travis-ci didn't find the package “Javax.json” as following: My configuration:

{
    "language": "java",
    "install": "mvn install -DskipTests=true -Dmaven.javadoc.skip=true",
    "jdk": "oraclejdk9",
    "group": "stable",
    "dist": "trusty",
    "os": "linux"
}

Error information(partly):

[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.

Add the dependency:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM