Unknown lifecycle phase “‘-Dmaven.test.skip=true‘“

1. Error message: 

[ERROR] Unknown lifecycle phase "'-Dmaven.test.skip=true'". You must specify a valid lifecycle phase or a goal in the format <pl
ugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validat
e, 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, prepa
re-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, p
ost-clean, pre-site, site, post-site, site-deploy. -> [Help 1]

2. Reason: I executed mvn clean install package '-Dmaven.test.skip=true'    in Ideal. The terminal used by Idea to execute commands defaults to PowerShell , which is powerful but some commands such as this one cannot be parsed;

3. Solution 1: Change the terminal of Idea to CMD;

4.   Solution 2 : Enter the local inquiry price folder corresponding to the project, open the CMD terminal, and execute the command again;

# 记住 -Dmaven.test.skip=true  不要用 ‘’ 包含   否则CMD终端无法解析
mvn clean install package -Dmaven.test.skip=true 

Guess you like

Origin blog.csdn.net/m0_62639693/article/details/127523040