1.功能
将项目打jar包,从而可以在不同环境下运行。
2.步骤
(1)打开cmd(注意,win10的powershell有些不兼容,最好用cmd)
(2)进入项目根目录
e:
cd Tools\WorkspaceforMyeclipse\WebSpring
(3)运行
mvn clean package -DskipTests
结果:
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ web ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ web ---
[INFO] Building jar: e:\Tools\WorkspaceforMyeclipse\WebSpring\target\web-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.0.5.RELEASE:repackage (default) @ web ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.226 s
[INFO] Finished at: 2018-11-25T22:31:39+08:00
[INFO] Final Memory: 44M/275M
[INFO] ------------------------------------------------------------------------
(4)找到jar包
WorkspaceforMyeclipse\WebSpring\target\web-0.0.1-SNAPSHOT.jar