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] ------------------------------------------------------------------------