Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How SpringBoot runs the deployment process

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what is the process of SpringBoot operation and deployment". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what the process of SpringBoot operation and deployment is like".

Main method

Run the startup class main method directly

A standard way to follow the Java convention of the application entry point. Our main method SpringApplication invokes the class run delegated to Spring Boot. SpringApplication boots our application, starts Spring, and then starts the automatically configured Tomcat Web server. We need Example.class as an argument to the run method to tell SpringApplication which is the main Spring component. The args array is also passed to expose any command line arguments.

Executable jar

This plug-in enables the project to be packaged into an executable jar

The project root directory executes mvn package

The generated jar is placed in the target directory under the project.

Java-jar xx.jar runs executable jar

.jar contains all the dependencies in pom that can be run directly

.jar.original plain jar does not contain dependencies

War deployment

Add war to pom.xml and change the packaging method to war

Swar package name

Start a class or create a new class that inherits the SpringBootServletInitializer class to override the configure method

The project root directory executes mvn package

The war package is deployed to startup.bat startup Tomcat under the bin directory in the webapps directory under Tomcat

Mvn spring-boot:run

The project root directory mvn instruction runs

Thank you for your reading, the above is the content of "what is the process of running and deploying SpringBoot". After the study of this article, I believe you have a deeper understanding of how the process of running and deploying SpringBoot is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report