Use Spring Boot to package the project as a war package

Table of contents

1. Purpose

2. maven configuration


1. Purpose

In general scenarios, we always like to package the springboot project as a jar package and run it directly on the server. But when a server needs to run multiple services, each jar package will contain a set of tomcat, which will consume a lot of server usage. At this time, you need to package the project into a war package, and then deploy it to Tomcat.

This article mainly records the configuration in the maven pom.xml file in the springboot project

2. maven configuration

Specify the packaging method as war: 

 To make a packaged plug-in, you need to download it online:

In the end, two packages will be formed, and the files ending with .original will be used for deployment. Remove .original when deploying

Thank you for reading, if you have any questions, you can discuss them in the comments.

Guess you like

Origin blog.csdn.net/qq_39298227/article/details/126675309
Recommended