【Azure Developer】VS Code打包Java maven Project 遇见 BUILD FAILURE

问题描述

在VS Code中创建的Java Maven项目,在进行项目打包时,遇见 BUILD FAILURE

\lbimage> mvn -clean package

[INFO] Scanning for projects...

[INFO]

[INFO] ----------------< org.yourcompany.yourproject:lbimage >-----------------

[INFO] Building lbimage 1.0-SNAPSHOT

[INFO]   from pom.xml

[INFO] --------------------------------[ jar ]---------------------------------

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  0.154 s

[INFO] Finished at: 2024-11-01T17:44:40+08:00

[INFO] ------------------------------------------------------------------------

[ERROR] Unknown lifecycle phase "lean". 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: pre-clean, clean, post-clean, 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-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

 

错误截图

 

问题解答

根据错误信息,输入的指令中的内容不在Maven的有效生命周期中。应该输入正确的指令,如: clean, test,  initialize, package 等提示信息中列举的值。

而在本次错误中,输入的打包指令时 mvn -clean package,对比后发现,多输入了一个“-”。 正确的指令为:mvn clean package

参考资料

Maven project failed in eclipse and command line  : https://stackoverflow.com/questions/61283849/maven-project-failed-in-eclipse-and-command-line

 

posted @   路边两盏灯  阅读(26)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2022-11-01 【Azure 应用服务】部署WAR包到App Service访问出现404错误的解决方式
2020-11-01 【应用服务 App Service】App Service 中部署Java项目,查看Tomcat配置及上传自定义版本
2020-11-01 【应用服务 App Service】 App Service Rewrite 实例 -- 限制站点的访问
点击右上角即可分享
微信分享提示