Travis构建失败的Java

时间:2018-08-14 11:57:12

标签: java maven travis-ci

我是travis CI领域的新手,我想使用它进行首次构建,只是当我通过.travis.yml文件进行配置时,它会引发以下错误

[INFO] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/persistenza/DAOGenericoJson.java: Recompile with -Xlint:unchecked for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[100,53] package it.unibas.utilita does not exist
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[122,39] package it.unibas.utilita does not exist
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[125,39] package it.unibas.utilita does not exist
[INFO] 3 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.953 s
[INFO] Finished at: 2018-08-14T11:06:22Z
[INFO] Final Memory: 24M/180M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project app: Compilation failure: Compilation failure: 
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[100,53] package it.unibas.utilita does not exist
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[122,39] package it.unibas.utilita does not exist
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[125,39] package it.unibas.utilita does not exist
[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 "eval mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed. Retrying, 2 of 3.
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T07:58:13Z)
Maven home: /usr/local/maven-3.5.2
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-101-generic", arch: "amd64", family: "unix"
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building app 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ app ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ app ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 7 source files to /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/target/classes
[INFO] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/persistenza/DAOGenericoJson.java: /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/persistenza/DAOGenericoJson.java uses unchecked or unsafe operations.
[INFO] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/persistenza/DAOGenericoJson.java: Recompile with -Xlint:unchecked for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[100,53] package it.unibas.utilita does not exist
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[122,39] package it.unibas.utilita does not exist
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[125,39] package it.unibas.utilita does not exist
[INFO] 3 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.937 s
[INFO] Finished at: 2018-08-14T11:06:27Z
[INFO] Final Memory: 19M/195M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project app: Compilation failure: Compilation failure: 
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[100,53] package it.unibas.utilita does not exist
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[122,39] package it.unibas.utilita does not exist
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[125,39] package it.unibas.utilita does not exist
[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 "eval mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed. Retrying, 3 of 3.
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T07:58:13Z)
Maven home: /usr/local/maven-3.5.2
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-101-generic", arch: "amd64", family: "unix"
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building app 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ app ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ app ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 7 source files to /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/target/classes
[INFO] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/persistenza/DAOGenericoJson.java: /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/persistenza/DAOGenericoJson.java uses unchecked or unsafe operations.
[INFO] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/persistenza/DAOGenericoJson.java: Recompile with -Xlint:unchecked for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[100,53] package it.unibas.utilita does not exist
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[122,39] package it.unibas.utilita does not exist
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[125,39] package it.unibas.utilita does not exist
[INFO] 3 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.895 s
[INFO] Finished at: 2018-08-14T11:06:33Z
[INFO] Final Memory: 18M/198M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project app: Compilation failure: Compilation failure: 
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[100,53] package it.unibas.utilita does not exist
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[122,39] package it.unibas.utilita does not exist
[ERROR] /home/travis/build/vincenzopalazzo/ilveroprogrammatorebotjava/app/src/main/java/top/gigabox/ilveroprogrammatore/Bot.java:[125,39] package it.unibas.utilita does not exist
[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 "eval mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed 3 times.
The command "mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V" failed and exited with 1 during .
Your build has been stopped.

我的.travis.yml文件如下:

language: java
jdk:
  - oraclejdk7
  - oraclejdk8
  - oraclejdk9
before_install:
  - cd app
script: mvn clean verify
sudo: disable

我的构造工具是maven,其版本如下:

Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_171, vendor: Oracle Corporation
Java home: /usr/local/java/jdk1.8.0_171/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.10.0-38-generic", arch: "amd64", family: "unix"

我的pom.xml文件如下:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>top.gigabox</groupId>
  <artifactId>app</artifactId>
  <packaging>jar</packaging>
  <version>1.0</version>
  <name>app</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.telegram</groupId>
      <artifactId>telegrambots</artifactId>
      <version>4.0.0</version>
    </dependency>

      <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
          <version>1.7.5</version>
      </dependency>
      <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-jdk14</artifactId>
          <version>1.7.25</version>
      </dependency>


      <!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.8.5</version>
    </dependency>

  </dependencies>
  <build>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>

        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>top.gigabox.ilveroprogrammatore.Bot</mainClass>
                    </manifest>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>

            <executions>
                <execution>
                    <id>make-assembly</id> <!-- this is used for inheritance merges -->
                    <phase>package</phase> <!-- bind to the packaging phase -->
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>

  </build>



</project>

我要在travis上工作的项目如下:project

1 个答案:

答案 0 :(得分:0)

您的pom中缺少一个包含it.unibas.utilita.Console类的依赖项。

这可能是您的previous question suggest

    <dependency>
        <groupId>unibas</groupId>
        <artifactId>utilita</artifactId>
        <version>0.1</version>
        <scope>system</scope>
        <systemPath>/home/vincenzo/MEGA/Programmazione/myLib/java/utilita.jar</systemPath>
    </dependency>