報錯信息如下:
[INFO] ------------------------------------------------------------------------ [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/data/jenkins/workspace/project). 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
報錯原因:
當前目錄下沒有pom.xml 文件。
解決辦法如下:
1 jenkins該工程配置,“Build配置”加入執行shell腳本進入project目錄:
cd project
2 “調用頂層Maven目標”配置里指明pom.xml文件位置: