mvn clean package -Dmaven.test.skip=true 报错:[ERROR] Unknown lifecycle phase “.test.skip=true“.

简介: mvn clean package -Dmaven.test.skip=true 报错:[ERROR] Unknown lifecycle phase “.test.skip=true“.

错误


PowerShell 运行 mvn命令不成功



[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


元婴


而 PowerShell 窗口下,执行带参数的需要’单引号’包起来才可以


解决


方法一


命令改为:


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


方法二


不要使用PowerShell命令行模式,使用 cmd 进入命令行执行:


mvn clean install package -Dmaven.test.skip=true
相关文章
|
Java 测试技术
mvn -DskipTests和-Dmaven.test.skip=true区别
在使用mvn package进行编译、打包时,Maven会执行src/test/java中的JUnit测试用例,有时为了跳过测试,会使用参数-DskipTests和-Dmaven.test.skip=true,这两个参数的主要区别是: -DskipTests,不执行测试用例,但编译测试用例类生成相应的class文件至target/test-classes下。
2297 0
|
Java 应用服务中间件 Maven
Maven - Failed to clean project: Failed to delete
Maven - Failed to clean project: Failed to delete
577 0
Maven - Failed to clean project: Failed to delete
|
Java Maven
[ERROR] Failed to execute goal on project springcloud: Could not resolve dependencies for project co
[ERROR] Failed to execute goal on project springcloud: Could not resolve dependencies for project co
790 0
[ERROR] Failed to execute goal on project springcloud: Could not resolve dependencies for project co
Failed to execute goal maven-resources-plugin:3.2.0:resources Input length = 1 -> [Help 1]
Failed to execute goal maven-resources-plugin:3.2.0:resources Input length = 1 -> [Help 1]
137 0
|
jenkins 持续交付
问题记录:jenkins构建时报错The goal you specified requires a project to execute but there is no POM in...
问题记录:jenkins构建时报错The goal you specified requires a project to execute but there is no POM in...
1307 0
问题记录:jenkins构建时报错The goal you specified requires a project to execute but there is no POM in...
C compiler test failed.
C compiler test failed.
206 0
|
9月前
|
编译器
“Could not determine which ”make“ command to run. Check the ”make“ step in the build configuration.”
“Could not determine which ”make“ command to run. Check the ”make“ step in the build configuration.”
141 0
|
缓存
Error:Could not download ecj.jar : No cached version available for offline mode
Error:Could not download ecj.jar : No cached version available for offline mode
281 0
Error:Could not download ecj.jar : No cached version available for offline mode