First, spring boot boot mode
1, in the IDE to start the Spring Boot Application project Startup class Appplication.java Main method;
For example: @SpringBootApplicationpublic class Eurekaclientapplication {public static void main (string[] args) {new springapplic Ationbuilder (Eurekaclientapplication.class). Web (True). Run (args); }}
2. Use maven command Execution (MAVEN project) under the root directory of Spring boot application: mvn spring-boot:run
3, using the way to start the jar, the steps are as follows:
A, enter the spring boot application root directory;
B, Input command: MVN install-dmaven.test.skip=true
C, CD target
D, Java-jar ****.jar
Second, Spring boot application shutdown (Linux/unix/ubuntu environment)
A, non-security authentication 1, Project Pom.xml Add the following dependencies: <dependency> <groupId>org.springframework.boot</groupId> < Artifactid>spring-boot-starter-actuator</artifactid> </dependency> 2, The Application.properties file adds the following: #启用shutdownendpoints. shutdown.enabled=true# Disables password Authentication endpoints.shutdown.sensitive= False 3, Close command: Curl-x POST host:port/shutdown
B, security verification 1, pom.xml add the following dependencies: <dependency> <groupId>org.springframework.boot</groupId> <artifactid >spring-boot-starter-security</artifactId> </dependency> 2, application.properties files add the following: # Turn on Shutdown security Authentication endpoints.shutdown.sensitive=true# Verify username security.user.name=admin# authentication Password security.user.password= admin# role management.security.role=superuser# Specify port management.port=8081# Specify address management.address=127.0.0.1 3, shutdown command: Curl-u admin:admin-x POST Http://127.0.0.1:8081/manage/shutdown