The "Org.springframework.boot:spring-boot-maven-plugin" plugin was added to the OM file. After the plugin is added, when the MVN package is run, it is packaged as a JAR file that can be run directly, and can be run directly using the "Java-jar" command. This simplifies the deployment of the application to a great extent, and only installs the JRE to run it.
You can specify whether a jar or war is generated in the POM.
<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"
xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
<!--...-->
<packaging>jar</packaging>
<!--...-->
</project>
You can also specify the class to execute, and if not specified, spring will find the class with this "public static void Main (string[] args)" method as an executable class.
If you want to specify, you can use the following two methods:
1, if your pom is inherited spring-boot-starter-parent, only need the following designation on the line.
<properties>
<!--the main class to start by executing Java-jar--
<start-class> Com.mycorp.starter.helloworldapplication</start-class>
</properties>
2, if your pom is not inherited spring-boot-starter-parent, you need the following designation.
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId> spring-boot-maven-plugin</artifactid>
<version>1.3.5.RELEASE</version>
< configuration>
<mainClass>${start-class}</mainClass>
<layout>ZIP</layout>
</configuration>
<executions>
<execution>
<goals>
<goal >repackage</goal>
</goals>
</execution>
</executions>
</ Plugin>
From
Http://docs.spring.io/spring-boot/docs/current/maven-plugin/usage.html
http://stackoverflow.com/ Questions/23217002/how-do-i-tell-spring-boot-which-main-class-to-use-for-the-executable-jar
/HTTP/ docs.spring.io/spring-boot/docs/current/maven-plugin/repackage-mojo.html
http://udn.yyuap.com/doc/ spring-boot-reference-guide/iii.%20using%20spring%20boot/13.1.4.%20using%20the%20spring%20boot%20maven% 20plugin.html
http://www.ibm.com/developerworks/cn/java/j-lo-spring-boot/#listing1