当前位置: 首页 > 知识库问答 >
问题:

Maven build在Jenkins上失败,但在本地计算机上工作

边浩漫
2023-03-14

我有一个新安装的Debian Wheezy服务器,运行Jenkins1.596(最新版本),从官方的deb包安装。

为了和Jenkins一起玩,我编写了一个新的Maven项目,该项目可以通过Git进行验证。

下面是Jenkins服务器在构建期间生成的日志:

Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/hidden/workspace
 > /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > /usr/bin/git config remote.origin.url ssh://git@red.hiddencompany.com/srv/gitosis/repositories/hidden.git # timeout=10
Fetching upstream changes from ssh://git@red.hiddencompany.com/srv/gitosis/repositories/hidden.git
 > /usr/bin/git --version # timeout=10
using GIT_SSH to set credentials 
 > /usr/bin/git -c core.askpass=true fetch --tags --progress ssh://git@red.hiddencompany.com/srv/gitosis/repositories/hidden.git +refs/heads/*:refs/remotes/origin/*
 > /usr/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > /usr/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 0d5334724d01ec42ed23912f687eb412997eede8 (refs/remotes/origin/master)
 > /usr/bin/git config core.sparsecheckout # timeout=10
 > /usr/bin/git checkout -f 0d5334724d01ec42ed23912f687eb412997eede8
 > /usr/bin/git rev-list 0d5334724d01ec42ed23912f687eb412997eede8 # timeout=10
Parsing POMs
[workspace] $ /var/lib/jenkins/tools/hudson.model.JDK/JDK_7/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-agent-1.6.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/boot/plexus-classworlds-2.5.1.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/conf/logging jenkins.maven3.agent.Maven32Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven /var/cache/jenkins/war/WEB-INF/lib/remoting-2.49.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-interceptor-1.6.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.6.jar 55526
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f /var/lib/jenkins/jobs/hidden/workspace/pom.xml package
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building hidden 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hidden ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ hidden ---
[INFO] Compiling 15 source files to /var/lib/jenkins/jobs/hidden/workspace/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /var/lib/jenkins/jobs/hidden/workspace/src/main/java/com/logicsale/hidden/aggregator/provider/hiddencompany/AmazonSellerRatingsProvider.java:[41,58] error: cannot find symbol
[INFO] 1 error
[INFO] -------------------------------------------------------------
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.745 s
[INFO] Finished at: 2015-01-14T09:32:55+01:00
[INFO] Final Memory: 16M/39M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project hidden: Compilation failure
[ERROR] /var/lib/jenkins/jobs/hidden/workspace/src/main/java/com/logicsale/hidden/aggregator/provider/hiddencompany/AmazonSellerRatingsProvider.java:[41,58] error: cannot find symbol
[ERROR] -> [Help 1]
[ERROR] 
[JENKINS] Archiving /var/lib/jenkins/jobs/hidden/workspace/pom.xml to com.logicsale.hidden/hidden/1.0-SNAPSHOT/hidden-1.0-SNAPSHOT.pom
[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
channel stopped
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Finished: FAILURE

我尝试用JDK7和JDK8构建都失败了。

共有1个答案

傅玮
2023-03-14

请看一下这道题和被接受的答案。可能是maven-compiler-plugin中的bug-尝试将maven-compiler-plugin的版本更新到3.1或更高版本。

 类似资料:
  • 当在我的本地机器上用Visual Studio中的C#运行Selenium测试时,测试运行良好并且全部通过。然而,当我试图在詹金斯上运行它们时,它们失败了。如果我使用FireFox,那么Jenkins运行良好。问题是,我的老板想要使用IE因为这是我们公司最常用的。 下面是无法运行的代码: 最后但并非最不重要的是StackTrace: 在system.net.httpwebrequest.getre

  • 我开发了一个React应用程序,它使用Laravel作为API。我已经通过Passport添加了登录,并且已经相当成功地使用了个人访问客户端方法。我可以添加新用户和令牌,我可以撤销令牌,我可以重置密码...所有的API调用(除了登录和注册)都由API中间件保护,它可以工作。如果我从任何这些调用的头中删除,则由于->middleware('auth:api')包装器,它将返回401未经验证。 一切都

  • 问题内容: 我想检查请求url的状态码但获取代码 这是我的代码 堆栈跟踪 问题答案: 我认为,此问题是由Java尝试使用IPV6地址引起的,原因是您的操作系统不支持IPV6地址,或者您的操作系统没有正确设置IPV6地址来处理它。 您可以强制Java使用具有以下属性的IPV4地址: -Djava.net.preferIPv4Stack = true

  • 我使用devise gem with rails进行身份验证,我的应用程序在本地运行良好,但是在heroku上部署时无法访问device视图。 检查日志时出现以下错误: ←[app[web.1]:←[0mDevis处理e::SessionsController#新作为超文本标记语言 ←[app[web.1]:←[0mDevis处理e::SessionsController#新作为超文本标记语言 ←

  • Windows---------------: Linux---------- 那么,什么是主要的原因是这个问题,看起来一切都好从其他的选择 Apache Maven 3.6.0(97C98EC64A1FDFEE7767CE5FFB20918DA4F719F3;2018-10-24T14:41:47-04:00)Maven主页:/home/user/tools/Maven/apache-maven