maven命令打包项目出现的问题以及解决方法
在学习springboot搭建新蜜蜂商城的开始,在java-jar命令启动这一步
在终端输入
mvn clean package-Dmaven.test.skip=true
想对刚刚建立的spring-boot项目进行打包 发现打包错误,显示
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | [INFO] Scanning for projects... [INFO] [INFO] --------------------< ltd.newbee.mall:newbee-mall >--------------------- [INFO] Building newbee-mall 0.0 . 1 -SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.292 s [INFO] Finished at: 2022 - 01 -22T22: 49 : 47 + 08 : 00 [INFO] ------------------------------------------------------------------------ [ERROR] Unknown lifecycle phase "package-Dmaven.test.skip=true" . You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-ar tifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-c lasses, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare- package , package , pre-integratio n-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 |
经过搜索发现网上很多错误方法和我的错误方法并不相同,他们是有缩进错误或者末尾多加了一个空格就是多了一个;,而我并没有输入错误,在参考文章:https://www.cnblogs.com/P710078255/p/13851508.html后发现,
可能idea终端用的是cmd命令行模式而非powershall命令行模式,所以导致出现错误,于是输入
mvn clean package install -Dmaven.test.skip=true
打包成功,可喜可贺,第一部成功
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 提示词工程——AI应用必不可少的技术
· 地球OL攻略 —— 某应届生求职总结
· 字符编码:从基础到乱码解决
· SpringCloud带你走进微服务的世界