首页 > 其他分享 >【Maven】Unknown lifecycle phase “.test.skip=true“.问题解决

【Maven】Unknown lifecycle phase “.test.skip=true“.问题解决

时间:2023-07-04 20:13:36浏览次数:40  
标签:process Unknown ERROR Maven phase skip test true lifecycle

我们在运行跳过单元测试时的命令mvn package -Dmaven.test.skip=true 时,出现Unknown lifecycle phase ".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
1
2
3
4
5
6
7
这是因为-Dmaven.test.skip=true 没有被正确地识别,我们只需要在 '-Dmaven.test.skip=true' 加上单引号即可。即:

mvn package '-Dmaven.test.skip=true'
1
如果是在idea中,我们需要把终端设置成 CMD 模式(Command Prompt)

————————————————
版权声明:本文为CSDN博主「猫巳」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_31635851/article/details/129688928

标签:process,Unknown,ERROR,Maven,phase,skip,test,true,lifecycle
From: https://www.cnblogs.com/xiaoxihebei/p/17526868.html

相关文章

  • Maven 安装和配置
    Maven1.下载下载途径: Maven–DownloadApacheMaven2.系统配置解压后,配置系统变量如下:  3.Maven配置阿里云镜像修改config/settings.xml文件<mirror> <id>nexus-aliyun</id> <mirrorOf>*,!jeecg,!jeecg-snapshots</mirrorOf> <name>Nexusaliyun<......
  • IDEA:MAVEN:先:An illegal reflective access operation has occurred 后:Cannot access d
    maven打包发现出现以下警告,但是可以运行 通过在 VM选项中添加 --illegal-access=deny--add-opensjava.base/java.lang=ALL-UNNAMED 不再出现刚才提示。之后出现CannotaccessdefaultsfieldofProperties发现自己新创建的项目,没有配置相应插件就使用了。添加即可......
  • SpringBoot教学补充资料3-Maven安装
    Maven下载地址:https://maven.apache.org/download.cgi下载后进行解压,记住解压路径。         mvn -v ......
  • Maven 报错处理
    从svn拉项目时,如果一个项目有多个子工程,1). 直接从trunk下拉项目,例如wm6-jzmd-project-latest(荆州电子)、wm6-ttbeer-project(青啤),然后在eclipse里import-->ExistingMavenProjects根据引导下一步直到完成;2). 然后右键上面两个项目名称下面的pom.xml(即一级工程下)Maven-->Update......
  • Maven基础
    Maven是专门用于管理和构建Java项目的工具,它的主要功能有:1、提供了一套标准化的项目结构标准化的项目结构: Maven提供了一套标准化的项目结构,所有IDE使用Maven构建的项目结构完全一样,所有IDE创建的Maven项目可以通用2、提供了一套标准化的构建流程(编译,测试,打......
  • What are the phases of the maven default lifecycle?
    Thephasesofthedefault(build)mavenSWlifecyclearelistedathttp://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.Ihavelistedthemagainhere:MavenDefaultLifecyclePhasesvalidategenerate-sourcesprocess-sourcesgenerate-reso......
  • maven book
    selfexample.googlecode.com/files/Maven权威指南中文版.pdfhttp://www.sonatype.com/books/mvnref-book/pdf/mvnref-pdf.pdfhttp://code.google.com/p/door-county-software/downloads/detail?name=maven-definitive-guide.pdf ......
  • appassembler-maven-plugin useAllDependencies
    http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/assemble-mojo.htmlThefollowingcanbeusedtouseallprojectdependenciesinsteadofthedefaultbehaviorwhichrepresentsruntimedependenciesonly.forgoal:assembleitcanaddothersc......
  • Maven cheat sheet 手抄:从入门到无语
    Mavencheatsheet手抄写给懒人看的概念生命周期由阶段构成:validate,compile,test,package,verify,install,deploy基础基础编译:mvncleanpackage环境变量:MAVEN_HOME,MAVEN_OPTS,MAVEN_ARGS配置打印激活的配置:mvnhelp:active-profiles激活Profile:-Pprofi......
  • Unable to update index for central http://repo1.maven.org/maven2/
    Unable to update index for central http://repo1.maven.org/maven2/ 就是这句,myeclipse启动后控制台输出这句话:解决办法:1.在myeclipse3.4(我用的这个版本)里面Window => Preferences => Myeclipse Enterprise Workbench => Maven4Myeclipse => Maven=>禁用Downl......