Use IDEA to pack Springboot into war package and execute

Use IDEA to turn Springboot into a war package

There are several points in the pom.xml configuration file that need attention:
Here must be written as war
Note here that the label finalName can set the name of the war package

Subsequent execution
Pay attention to the MAVEN on the far right. Click Open to pop up this box. Double-click clean first, then click insatll, and then a long list will appear on the console. The most displayed is BUILD SUCCESS, indicating that the war is successful.  Note that the path to save the war package is here, as shown below
Generally saved to the target directory in the project
Then, we use this war to execute. Just find a place, create a new folder, put the war package into it, and then open windows + r to enter cmd, open the console, then enter the folder of the war package, and then execute the command java -jar war package name Note that it is The full name, together with the suffix xxxxx.jar, and then executed, if the console is normal, it will appear the same as the normal operation of the console in IDEA. Note that the database issues. If you encounter any mistakes, go to the code that reports the error, and you must read it carefully.

There is no mention here of deploying to tomcat, because the framework of spring boot comes with tomcat, and there are relevant dependencies in the pom.xml configuration file.

Published 13 original articles · Like1 · Visit 2006

Guess you like

Origin blog.csdn.net/qq_31152023/article/details/96894551