SpringCloud工作笔记058---springBoot项目maven命令打包部署

   JAVA技术交流QQ群:170933152   

这里打包可以这样:

在使用mvn package进行编译、打包时,Maven会执行src/test/java中的JUnit测试用例,有时为了跳过测试,会使用参数-DskipTests和-Dmaven.test.skip=true,这两个参数的主要区别是:

-DskipTests,不执行测试用例,但编译测试用例类生成相应的class文件至target/test-classes下。

-Dmaven.test.skip=true,不执行测试用例,也不编译测试用例类。

本文出自 “学习文档” 博客,请务必保留此出处

E:\IdeaWkSpace\SmartCommunity\sc-message>mvn clean;
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sc-message 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.881 s
[INFO] Finished at: 2018-10-21T22:04:37+08:00
[INFO] Final Memory: 11M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "clean;". You must specify a valid lifecycle phase or a goal in the format : or :[:]:. 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

E:\IdeaWkSpace\SmartCommunity\sc-message>mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sc-message 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ sc-message ---
[INFO] Deleting E:\IdeaWkSpace\SmartCommunity\sc-message\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.752 s
[INFO] Finished at: 2018-10-21T22:04:44+08:00
[INFO] Final Memory: 11M/245M
[INFO] ------------------------------------------------------------------------

E:\IdeaWkSpace\SmartCommunity\sc-message>mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sc-message 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ sc-message ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 9 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ sc-message ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 76 source files to E:\IdeaWkSpace\SmartCommunity\sc-message\target\classes
[WARNING] /E:/IdeaWkSpace/SmartCommunity/sc-message/src/main/java/cn/gov/rongcheng/scmessage/controller/CmUsersController.java: 某些输入文件使用了未经检查或不安全的操作。
[WARNING] /E:/IdeaWkSpace/SmartCommunity/sc-message/src/main/java/cn/gov/rongcheng/scmessage/controller/CmUsersController.java: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.715 s
[INFO] Finished at: 2018-10-21T22:04:58+08:00
[INFO] Final Memory: 48M/346M
[INFO] ------------------------------------------------------------------------

E:\IdeaWkSpace\SmartCommunity\sc-message>mvn package -DskipTests
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sc-message 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ sc-message ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 9 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ sc-message ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ sc-message ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ sc-message ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to E:\IdeaWkSpace\SmartCommunity\sc-message\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ sc-message ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ sc-message ---
[INFO] Building jar: E:\IdeaWkSpace\SmartCommunity\sc-message\target\sc-message-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.15.RELEASE:repackage (default) @ sc-message ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.494 s
[INFO] Finished at: 2018-10-21T22:05:16+08:00
[INFO] Final Memory: 50M/342M
[INFO] ------------------------------------------------------------------------

 

你可能感兴趣的:(Spring,Cloud,vermgr)