1. Since springboot integrates tomcat, it is no longer used to package it, but uses jar
<groupId>cn</groupId> <artifactId>back</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging>
2. Add the springboot startup class to inherit SpringBootServletInitializer and override the configure method
public class BackApplication extends SpringBootServletInitializer{ public static void main(String[] args) { SpringApplication.run(BackApplication.class, args); } @Override//In order to package the springboot project protected SpringApplicationBuilder configure( SpringApplicationBuilder builder) { return builder.sources(this.getClass()); } }3. Select the project, right-click and select Run As==>maven clean Clear the previous jar
4. Select the project, right-click to select Run As==>maven install to install package
5. Copy the jar package in the target folder in the project and it is the package you want.
6. Upload the jar to the service period (jdk must be installed and the corresponding port is opened)
7. Enter the folder directory and execute the command nohup java -jar fx2Back.jar & to start using nohup without hang up, and then you can access the page.
8. If you want to close the service, you can directly query the service's process number and then kill.
Summarize
The above is the method of springboot package deployment to linux server introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support to Wulin.com website!