Release and operation of SpringBoot project

Table of contents

1. The release and operation of SpringBoo packaged as a war package

1.1 release

1.2 Run the war package in Windows

1.3 Run the war package in Linux

 2. The release and operation of SpringBoo packaged as a jar package

2.1 release

2.2 Run the jar package in Windows

2.3 Run the jar package in Linux


1. The release and operation of SpringBoo packaged as a war package

1.1 release

Since the SpringBoot project is packaged as a war package, SpringBoot's built-in Tomcat will not be packaged in, so we usually put the packaged war package on other independent servers. So when releasing the war package, just put the war package in Tomcat's webapps folder.

1.2 Run the war package in Windows

Go to the bin folder where you installed the Tomcat server, find a file called startup.bat, and double-click to execute it.

1.3 Run the war package in Linux

Just start the Tomcat server installed in Linux, the command is as follows (note that the current path is in the bin directory of the Tomcat installation path when executing the command)

./startup.sh | tail -f ../logs/catalina.out & (where: tail -f is to continuously output logs to the console) (start under the bin directory)

At this time, we can visit the project we just released in the browser, but here are the points to pay attention to:

 2. The release and operation of SpringBoo packaged as a jar package

When the SpringBoot framework is packaged, if you do not specify whether to package the jar package or the war package, the jar package will be automatically packaged.

In addition, since the SpringBoot framework has a built-in Tomcat server, and SpringBoot will automatically package the Tomcat server into the jar package, so after the SpringBoot project is packaged into a jar package, the jar package can run independently after decompression, without relying on other external server.

2.1 release

Since the SpringBoot project is packaged as a jar package, it can run independently without relying on other external servers, so there is no need to publish it.

2.2 Run the jar package in Windows

2.3 Run the jar package in Linux

 Replenish:

In the Linux system, a file ending with .sh indicates that this is a shell script, which is equivalent to cmd in Windows

Guess you like

Origin blog.csdn.net/weixin_44362089/article/details/127470040