Steps:
1. Use the maven clean command to remove the original jar package
2. Use the mvn package command to package the project into a jar package
3. Find the jar package in the target directory.
4. Use XShell and XFtp to complete upload, open security groups, open ports, etc.
5. Use the command to start the project
java -jar **.jar
This method will stop running when disconnecting the ssh connection
6. If you want to keep springboot running
nohup java -jar **.jar &
nohup: execute commands without hanging up, ignoring all hang up signals. Run the background command and finally add &
in the jar directory to generate a nohup.out file, and the default log is output here.
7. The default output file is modified to log.txt file in the current directory
· Demo.jar is started in the background without hanging up,
· "2>&1" means that the error and output are transmitted to the nohup.out file, the default state only outputs the output To the nohup.out file
· The nohup command defaults to the nohup.out file
nohup java -jar demo.jar >./log.txt 2>&1 &
7. Visit address