侧边栏壁纸
博主头像
乌拉队长博主等级

你只管努力,其余的交给命运

  • 累计撰写 122 篇文章
  • 累计创建 34 个标签
  • 累计收到 31 条评论

目 录CONTENT

文章目录

Unknown lifecycle phase ".test.skip=true"

乌拉队长
2022-02-24 / 0 评论 / 0 点赞 / 902 阅读 / 1,390 字

win10下在terminal终端或powershell使用Maven命令打包报错:Unknown lifecycle phase ".test.skip=true"

情景还原

今天在win10中直接在maven项目目录下右键-->terminal终端(或powershell),对项目进行打包,执行命令如下:

mvn clean package -Dmaven.test.skip=true

出现如下报错:

[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>[:<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

原因:terminal终端或powershell中,当使用的命令携带参数时,其参数要使用单引号引起来

解决方法

terminal终端或powershell中应使用如下命令:

mvn clean package '-Dmaven.test.skip=true'

cmd终端中则使用:

mvn clean package -Dmaven.test.skip=true
0

评论区