(三)Jenkins部署项目报错Build step ‘Invoke top-level Maven targets‘ marked build as failure

Jenkins部署SpringBoot项目,报错:Build step 'Invoke top-level Maven targets' marked build as failure

WARNING] Failed to create parent directories for tracking file /opt/mavenRepository/org/springframework/boot/
spring-boot-starter-parent/2.3.0.RELEASE/spring-boot-starter-parent-2.3.0.RELEASE.pom.lastUpdated
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.gitee:code:1.0-SNAPSHOT: Could not transfer 
artifact org.springframework.boot:spring-boot-starter-parent:pom:2.3.0.RELEASE 
from/to ali (https://maven.aliyun.com/repository/public/): 
/opt/mavenRepository/org/springframework/boot/spring-boot-starter-parent/
2.3.0.RELEASE/spring-boot-starter-parent-2.3.0.RELEASE.pom.part.lock 
(No such file or directory) and 'parent.relativePath' points 
at wrong local POM @ line 15, column 13
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.gitee:code:1.0-SNAPSHOT 
(/var/lib/jenkins/workspace/zblog/code/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.gitee:code:1.0-SNAPSHOT: Could not transfer 
artifact org.springframework.boot:spring-boot-starter-parent:pom:2.3.0.RELEASE from/to 
ali (https://maven.aliyun.com/repository/public/): 
/opt/mavenRepository/org/springframework/boot/spring-boot-starter-parent/
2.3.0.RELEASE/spring-boot-starter-parent-2.3.0.RELEASE.pom.part.lock (No such file 
or directory) and 'parent.relativePath' points at wrong local POM @ line 15, column 13 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
Build step 'Invoke top-level Maven targets' marked build as failure
[DeployPublisher][INFO] Build failed, project not deployed
Finished: FAILURE

上面错误,大致原因是:

Jenkins没有权限访问maven本地仓库的目录。

解决方案:修改maven本地仓库的访问权限。

我配置的maven本地仓库目录是 '/opt/mavenRepository目录。

注意:根据自己maven中conf目录下的settings.xml文件中,配置的为准。

我的maven安装在Linux服务器上面,所以通过如下命令修改访问权限。

切换到/opt目录下,执行命令:

chmod -R o+r+w mavenRepository

再次执行命令:

chmod o+r+w mavenRepository

执行完成之后,再次到Jenkins中构建项目即可。

Started by user admin Running as SYSTEM Building in workspace /var/jenkins_home/workspace/SGLD_SHIP_SYSTEM The recommended git tool is: NONE using credential 3daf7d0b-8918-4f92-9c5d-a3059a66a722 > git rev-parse --resolve-git-dir /var/jenkins_home/workspace/SGLD_SHIP_SYSTEM/.git # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url http://139.199.13.25:3000/shaofq/AG-SGLD-ILOG-1.0.git # timeout=10 Fetching upstream changes from http://139.199.13.25:3000/shaofq/AG-SGLD-ILOG-1.0.git > git --version # timeout=10 > git --version # 'git version 2.30.2' using GIT_ASKPASS to set credentials > git fetch --tags --force --progress -- http://139.199.13.25:3000/shaofq/AG-SGLD-ILOG-1.0.git +refs/heads/*:refs/remotes/origin/* # timeout=10 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 Checking out Revision 68b36471d8d68c7d5f6af47cd1c1025861e4cb03 (refs/remotes/origin/master) > git config core.sparsecheckout # timeout=10 > git checkout -f 68b36471d8d68c7d5f6af47cd1c1025861e4cb03 # timeout=10 Commit message: "feat:新增航线中文名维护" > git rev-list --no-walk 68b36471d8d68c7d5f6af47cd1c1025861e4cb03 # timeout=10 using settings config with name MySettings Replacing all maven server entries not found in credentials list is true [SGLD_SHIP_SYSTEM] $ /var/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/mymaven/bin/mvn -s /tmp/settings10948644921560376548.xml clean package -Pprod -Dmaven.test.skip=true -e Build step 'Invoke top-level Maven targets' marked build as failure Finished: FAILURE
06-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Mr.小朱同学

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值