简体   繁体   English

在 Jenkins 中执行 Maven 项目时面临问题

[英]Facing issue while executing Maven project in Jenkins

start of log Complete error message日志开始完整的错误信息

Facing issue while executing Maven project in Jenkins.在 Jenkins 中执行 Maven 项目时面临问题。 Not able to execute project from gitthub.无法从 gitthub 执行项目。

The error message is reproduced below.错误消息在下面重现。

O Console Output
Started by user Selvakumar V
Running as SYSTEM
Building in workspace C: \Program Files\Jenkins\workspace\FreeCRMTestProject
Parsing POAs
Established TCP socket on 49852
[MavenProjectGitl] $ java -cp "C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-agent-3.3.9/conf/logging" \
jenkins.maven3.agent.Maven33Main E:\Java\SeleniumDava\Jars\apache-maven-3.3.9 \
"C:\Program Files\Jenkins\war\WEB-INF\lib\remoting-3.29.jar" \
"C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-interceptor-l.13.jar" \
"C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-l.13.jar" 49852
<===JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f D:\MavenProjectGitl\pon.xml Clean Install
[INFO] Scanning for projects...
[INFO]
[INFO] 
[INFO] Building MavenProjectúitl 0.0.1-SNAPSHOT
[INFO] 
[INFO] 
[INFO] BUILD FAILURE
[INFO] 
[INFO] Total time: 1.749 s
[INFO] Finished at: 2019-l1-05T19:59:08+05:30
[INFO] Final Memory: 6M/17M
[INFO] 
[ERROR] Unknown lifecycle phase "Clean". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or
<plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-
sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-
sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre
integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site,
post-site, site-deploy. -> [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/LifecyclePhaseNotFoundException
[JENKINS] Archiving D:\MavenProjectGitl\pom.xml to MavenProjectGit/MavenProjectGitl/0.0.1-SNAPSHOT/frlavenProjectGitl-0.0.1-SNAPSHOT.pom
channel stopped
Finished: FAILURE

Glad you got your answer in the comments, but...很高兴您在评论中得到答案,但是...

Please do not post pictures of text - it helps no one and does not ( usually ) get you help.请不要张贴文字图片 - 它对任何人都没有帮助,也不会(通常)为您提供帮助。 Paste text as text and mark it as " {} " a text block.将文本粘贴为文本并将其标记为“ {} ”文本块。 Others can't search images.其他人无法搜索图像。 @f1sh sarcasm also may not translate. @f1sh 讽刺也可能无法翻译。

And Yes, Jenkins is case sensitive, so is Maven and so is Linux.是的,Jenkins 区分大小写,Maven 和 Linux 也是如此。 As @azurefrog explained rather tritely, "Clean" != "clean" .正如@azurefrog 相当陈词滥调的解释, "Clean" != "clean"

Finally, please read How do I ask a good question .最后,请阅读我如何提出一个好问题

ps: Does it not look like a better question now? ps:现在看起来不是一个更好的问题吗? Kindly mark this response as "answered" ( the tick mark).请将此回复标记为“已回答”(勾选标记)。

As @azurefrog explained rather tritely explained via the comment, "Clean" != "clean" , Jenkins, Maven and Linux are all case-sensitive , that's why "Clean" does not match one of the "Available lifecycle phases", hence the error message: As @azurefrog explained rather tritely explained via the comment, "Clean" != "clean" , Jenkins, Maven and Linux are all case-sensitive , that's why "Clean" does not match one of the "Available lifecycle phases", hence the错误信息:

Unknown lifecycle phase "Clean".

Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, preintegration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy.

The maven lifecycle documentation does not explicit point that it, but the pom settings does imply that under Properties maven 生命周期文档没有明确指出它,但 pom 设置确实暗示在属性

Note: While environment variables themselves are case-insensitive on Windows, lookup of properties is case-sensitive.注意:虽然环境变量本身在 Windows 上不区分大小写,但属性查找区分大小写。 In other words, while the Windows shell returns the same value for %PATH% and %Path%, Maven distinguishes between ${env.PATH} and ${env.Path}.换句话说,虽然 Windows shell 为 %PATH% 和 %Path% 返回相同的值,但 Maven 区分 ${env.PATH} 和 ${env.PATH}。 The names of environment variables are normalized to all upper-case for the sake of reliability.为了可靠起见,环境变量的名称被规范化为全部大写。

Also, please read my comment to your question.另外,请阅读我对您的问题的评论。 And if you find this answer useful, mark as "answered" (the tick-box).如果您发现此答案有用,请标记为“已回答”(勾选框)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM