Added to file “org.springframework.boot:spring-boot-maven-plugin” plug-in unit . After adding the plug-in , When running “mvn
package” When packing , It will be packaged into a direct running JAR file , use “java -jar” Command can be run directly .

You can POM in , Specify build Yes Jar still War <packaging>jar</packaging> Default is jar

You can also specify classes to execute , If not specified ,Spring I'll find this public static void main(String[] args)
Class of method , As an executable class . When two classes appear that contain main Method time , Will report an error .

You can specify a startup class in two ways :

The first one : If your POM It's inheritance spring-boot-starter-parent The words , Just specify
<properties> <!-- The main class to start by executing java -jar -->
<start-class>com.xx.xx</start-class> </properties>
The second : If your POM Not inheritance spring-boot-starter-parent The words , The following specification is required
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId>
<version>1.3.5.RELEASE</version>          <configuration>
            <mainClass>com.xx.xx</mainClass>          </configuration>
          <executions>             <execution>             <goals>
            <goal>repackage</goal>             </goals>
            </execution>          </executions> </plugin> </plugins> </build>
Package if the configuration file is not loaded in or
Some systems , Information about some databases or other third-party accounts , Due to security issues , Its configuration will not be exposed to developers in the project in advance . In this case , When we run the program . The ability to specify an external profile with parameters .
java -jar xx.jar --spring.config.location=application.properties

©2019-2020 Toolsou All rights reserved,
html Writing about cherry trees , Writing about cherry trees It's unexpected Python Cherry tree (turtle The gorgeous style of Library ) Browser kernel ( understand )HashMap Explain in detail java Four functional interfaces ( a key , simple )os Simple use of module Some East 14 Pay change 16 salary , Sincerity or routine ?