jenkins不能正常打包。
问题描述
jenkins打包时报错,无法正常启动服务。
[WARNING] The requested profile "dev" could not be activated because it does not exist.
[WARNING] The requested profile "uat" could not be activated because it does not exist.
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/var/lib/jenkins/workspace/ali-op-job). 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文件找不到导致的。
pom文件不在workspace中的工程目录中。打包时查看配置没有什么错误。
然后查看jenkins配置的所在jenkins的服务器,发现服务器上拉下来的代码的pom文件名称是pomaa .xml。
想起曾经别人改了pom文件的名称,但是在idea中却没有显示这个pomaa.xml的名称,就导致了pom文件找不到的问题。
解决办法
将pomaa.xml文件改为po m.xml并提交到svn中即可。
完美解决!
相关推荐
另外的原因:
查看发现下面多了一级子目录,也就是说pom文件不在workspace中的工程目录中。所以就会导致maven找不到pom文件。所以,我在构建的时候直接在构建前加一个进入工程实际目录的动作,在进行构建,就不会有问题了。
https://blog.csdn.net/longzhizhui926/article/details/83116473