Home > Java > javaTutorial > How to deploy springboot project under Linux

How to deploy springboot project under Linux

PHPz
Release: 2023-05-14 22:43:04
forward
1591 people have browsed it

1. Add the springboot maven plug-in to the pom file

<build>
 <plugins>
 <plugin>
  <groupid>org.springframework.boot</groupid>
  spring-boot-maven-plugin</artifactid>
 </plugin>
 </plugins>
</build>
Copy after login

2. Execute the maven command to generate the jar package

Before executing this step, you must ensure that the maven environment is configured. , the maven environment configuration process is as follows

a. Add a maven_home environment variable to the system environment variable, followed by your local maven path

b. Add %maven_home% to the path \bin

c. Execute maven -v in the dos command to see if the environment is correct

Make sure the maven environment is configured properly, and execute mvn clean install -dmaven.test.skip in the terminal window =true

You can see that

How to deploy springboot project under Linux

has been successfully packaged. You can see one more target package in the project structure, which is packaged The jar package is below

How to deploy springboot project under Linux

3. Upload the jar package to the linux server

a. Execute the #sudo yum install lrzsz -y command

This command will install a software that can download and upload

b. Execute the #rz command

This is the upload command. After execution, select the file and you can upload it

4. Execute #nohup java -jar demo-0.0.1-snapshot.jar & command

Execute this command to start the jar package in the background

Complete these 4 steps Can you access it on the server? IP port

How to deploy springboot project under Linux

The above is the detailed content of How to deploy springboot project under Linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template