pom
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>
          <artifactId>spring-boot-maven-plugin</artifactId>         
<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

Technology
©2019-2020 Toolsou All rights reserved,
C Language confession practice small program ( Suitable for beginners )SSM Project's excel File upload and add to database [AndroidO] [RK3399] -- GPIO Drive and control mode 【Python】 read txt file , Gets the specified location data in the specified row ElementUI In the select Of label value Three methods of value transfer between non parent and child components Three.js - OrbitControls Orbit control around target target parameter Conflict statement (conflicting declaration) solve mysql Recursively finds all child nodes of the parent class 【Python- data fetch 】 read txt Each line of file generates a list of data