Maven在Windows PowerShell下执行编译命令"-Dmaven.test.skip=true"错误 [ 技术杂谈 ]
九叶的小窝 文章 正文
![As Long As You Love Me.](https://api.qwq.ro/storage/users/uid-1/1661304663.png)
九叶
{{nature("2021-12-10 11:23:36")}}更新1. 问题描述
在PowerShell窗口下执行maven打包命令,并跳过单元测试
mvn clean package -Dmaven.test.skip=true
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.592 s
[INFO] Finished at: 2021-12-10T11:10:57+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase ".test.skip=true". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plu
gin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-t
est-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
2. 解决方案
2.1 附加参数加单引号
mvn clean package '-Dmaven.test.skip=true'
2.2 使用CMD
-
{{nature('2021-12-07 15:29:00')}} {{format('2878')}}人已阅读
{{nature('2021-01-31 20:01:00')}} {{format('1231')}}人已阅读
{{nature('2020-12-11 21:17:00')}} {{format('1158')}}人已阅读
{{nature('2021-04-22 15:16:00')}} {{format('1112')}}人已阅读
目录
标签云
一言
评论 0
{{userInfo.data?.nickname}}
{{userInfo.data?.email}}