[Java development of Linux articles] deployment and operation of spring boot project

[Java development of Linux articles] deployment and operation of spring boot project

Introduction: In the java development process, in addition to deploying the war package using tomcat, there is also a scenario where you can directly use maven to package into a Jar package to run the spring boot project. The fox will write down all the frequently used items. This article only represents the summary and understanding of yours. If there are any mistakes or omissions, please correct me...

The old fox used the two commonly used projects to demonstrate, in fact, they are analogous. Although the commands are slightly different, they are all similar.

One: The Maven project is packaged and run under Linux

Deploy the Jar package of the spring boot project to execute the command process (guns is the name of my jar package)

1 maven Jar xftp linux Xshell Xftp  

2 ps -ef | grep guns     guns PID   

3 kill -9 PID            Jar PID ID 

4 3 
1 java -jar guns.jar --spring.profiles.active=dev    dev 
2 java -jar guns.jar >/home/www/logs/guns.log &      
3 java -jar guns.jar --spring.profiles.active=dev >/home/www/logs/guns.log &  
   dev   

5 tail -n 200 -f/home/www/logs/guns.log      200   

6 cat/home/www/logs/guns.log                   
 

Two: The Gradle project is packaged and run under Linux

The execution command flow of the Jar package of a Gradle project is as follows

Note: gradle build -x test [To package the Gradle project command, you need to install gradle on your local computer before you can package it]

Summary: The process of deploying a project is nothing more than to package your own project into an executable jar package through a tool, then upload it to the server, and then execute the command to run. Very simple, compared to the deployment of tomcat war package is actually a change of soup.


Conclusion: In the past, I used to read other people s blogs for learning techniques. Many of them included elite blogs and cunning CV Dafa articles. So I decided to share the knowledge I have learned, used, and organized with everyone, mainly because I want to avoid detours for the waves. , More positive blogs. If there are mistakes or omissions, please correct me. I just hope that you can learn knowledge and solve problems in my blog, then it will be enough. thank you all! (Please indicate the original source for reprinting)