Maven终端打包时报Unknown lifecycle phase “.test.skip=true“

错误实例代码

mvn clean package -Dmaven.test.skip=true  

再windows的cmd窗口进行项目打包,需要将参数用英文符号包裹起来“ ' ”

【正确的实例】:mvn clean package ’-Dmaven.test.skip=true‘

PS D:\BaiduNetdiskDownload\qian\Springboot-Vue\big-event> mvn clean package -Dmaven.test.skip=true
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< org.itpuddy:big-event >------------------------
[INFO] Building big-event 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.284 s
[INFO] Finished at: 2023-12-02T15:45:45+08:00
[INFO] ------------------------------------------------------------------------
[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

正确演示

mvn clean package ’-Dmaven.test.skip=true‘

PS D:\BaiduNetdiskDownload\qian\Springboot-Vue\big-event> mvn clean package '-Dmaven.test.skip=true'
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< org.itpuddy:big-event >------------------------
[INFO] Building big-event 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.2.0:clean (default-clean) @ big-event ---
[INFO] Deleting D:\BaiduNetdiskDownload\qianzixiang\Springboot-Vue\big-event\target
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ big-event ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ big-event ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 28 source files to D:\BaiduNetdiskDownload\qianzixiang\Springboot-Vue\big-event\target\classes
[INFO] /D:/BaiduNetdiskDownload/qianzixiang/Springboot-Vue/big-event/src/main/java/org/itpuddy/pojo/Result.java: 某些输 入文件使用了未经检查或不安全的操作。
[INFO] /D:/BaiduNetdiskDownload/qianzixiang/Springboot-Vue/big-event/src/main/java/org/itpuddy/pojo/Result.java: 有关详 细信息, 请使用 -Xlint:unchecked 重新编译。
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ big-event ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ big-event ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ big-event ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.2.2:jar (default-jar) @ big-event ---
[INFO] Building jar: D:\BaiduNetdiskDownload\qian\Springboot-Vue\big-event\target\big-event-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.7.14:repackage (repackage) @ big-event ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.883 s
[INFO] Finished at: 2023-12-02T15:51:20+08:00
[INFO] ------------------------------------------------------------------------

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值