在配置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命令:
将
改为
即可解决该问题!!!