Use Spring Boot and build Fat Jar Jar executable

Maven plug spring-boot-maven-plugin Spring Boot provided may be used to build the executable and Fat Jar Jar.

1.Fat Jar

Fat Jar need to use  java -jar xxx.jar  run. Require the use of the POM:

1 <build>
2     <plugins>
3         <plugin>
4             <groupId>org.springframework.boot</groupId>
5             <artifactId>spring-boot-maven-plugin</artifactId>
6         </plugin>
7     </plugins>
8 </build>


At this time constructed of Fat Jar attribute is not executable.

2. Executable Jar

with respect to the Fat Jar, Jar more executable executable attribute, you can  xxx.jar start  up and running command.

As long as the configuration spring-boot-maven-plugin, enabled the executable attribute:

 1 <build>
 2     <plugins>
 3         <plugin>
 4             <groupId>org.springframework.boot</groupId>
 5             <artifactId>spring-boot-maven-plugin</artifactId>
 6             <configuration>
 7                 <executable>true</executable>
 8             </configuration>
 9         </plugin>
</10     plugins>
11 </build>


Such is constructed out of an executable Jar.

Guess you like

Origin www.cnblogs.com/zyon/p/11014711.html