File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ ### 73.2. 使用Maven创建可执行JAR
2
+
3
+ ` spring-boot-maven-plugin ` 能够用来创建可执行的'胖'JAR。如果你正在使用` spring-boot-starter-parent ` POM,你可以简单地声明该插件,然后你的jar将被重新打包:
4
+ ``` xml
5
+ <build >
6
+ <plugins >
7
+ <plugin >
8
+ <groupId >org.springframework.boot</groupId >
9
+ <artifactId >spring-boot-maven-plugin</artifactId >
10
+ </plugin >
11
+ </plugins >
12
+ </build >
13
+ ```
14
+ 如果没有使用parent POM,你仍旧可以使用该插件。不过,你需要另外添加一个` <executions> ` 片段:
15
+ ``` xml
16
+ <build >
17
+ <plugins >
18
+ <plugin >
19
+ <groupId >org.springframework.boot</groupId >
20
+ <artifactId >spring-boot-maven-plugin</artifactId >
21
+ <version >1.3.0.BUILD-SNAPSHOT</version >
22
+ <executions >
23
+ <execution >
24
+ <goals >
25
+ <goal >repackage</goal >
26
+ </goals >
27
+ </execution >
28
+ </executions >
29
+ </plugin >
30
+ </plugins >
31
+ </build >
32
+ ```
33
+ 查看[ 插件文档] ( http://docs.spring.io/spring-boot/docs/1.3.0.BUILD-SNAPSHOT/maven-plugin/usage.html ) 获取详细的用例。
You can’t perform that action at this time.
0 commit comments