【Maven】Unknown lifecycle phase “.skip.test=true“.

  • idea 终端执行如下命令时
mvn clean install -Dmaven.skip.test=true
  • 报:
Unknown lifecycle phase ".skip.test=true". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or 
<plugin-group-id>:<plugiprepare-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]
  • 原因:命令没有被终端有效的识别到
  • 解决方法:

1、打开 idea 设置
【Maven】Unknown lifecycle phase “.skip.test=true“._第1张图片

2、切换为:C:\Windows\system32\cmd.exe
【Maven】Unknown lifecycle phase “.skip.test=true“._第2张图片

3、或者也可以在默认终端(powershell.exe)运行命令的时候加上引号,如:

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

你可能感兴趣的:(Maven,maven,intellij-idea,java)