Jenkins报错:The goal you specified requires a project to execute but there is no POM in this directory

在配置Jenkins后启动出现错误:

 Console Output
由用户 unknown or anonymous 启动
构建中 在工作空间 /root/.jenkins/workspace/openAPI 中
using credential 6a9cb838-356f-4c9d-a56f-1179b894949a
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://gitee.com/zhouzhou992/open-api.git # timeout=10
Fetching upstream changes from https://gitee.com/zhouzhou992/open-api.git
 > git --version # timeout=10
using GIT_ASKPASS to set credentials 
 > git fetch --tags --progress -- https://gitee.com/zhouzhou992/open-api.git +refs/heads/*:refs/remotes/origin*/ # timeout=10
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 9e2b54dc4dbf064e077cd51f911e6964e1565e84 (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 9e2b54dc4dbf064e077cd51f911e6964e1565e84 # timeout=10
Commit message: "First commit"
 > git rev-list --no-walk 9e2b54dc4dbf064e077cd51f911e6964e1565e84 # timeout=10
[openAPI] $ /bin/sh -xe /root/zhouzhou/jenkins/apache-tomcat-8.5.57/temp/jenkins3212204444333152713.sh
+ cd /root/.jenkins/workspace/openAPI/openapi
[openAPI] $ mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.062 s
[INFO] Finished at: 2021-01-06T17:41:53+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/root/.jenkins/workspace/openAPI). Please verify you invoked Maven from the correct directory. -> [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/MissingProjectException
Build step '调用顶层 Maven 目标' marked build as failure
Finished: FAILURE

原因:

/root/.jenkins/workspace/openAPI目录下找不到pom文件
因为项目目录下多了个子级目录!!!
pom文件在子级目录下!!不在项目的直接目录下!
即:/root/.jenkins/workspace/openAPI /openapi-->pom.xml
所以构建工程执行mvn命令时报错!!

解决办法:

直接手动进入子级目录下再执行mvn命令:

在这里插入图片描述
改为
解决办法
即可解决该问题!!!

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值