Spring Boot project packaging

springboot packaging command:
mvn -Dmaven.test.skip -U clean package

Among them, -Dmaven.test.skip means to filter the test code part. It is best to clean the project every time you package it to avoid the cache impact of the last run.

The default packaging of springboot is jar. If war is packaged, it needs to be configured in the main pom

<packaging>war</packaging>

And the project structure is required to be a standard web project structure, you need to add the webapp-->WEB-ING--->web.xml file

Then package it again, the war package can be run in the form of java -jar, or it can be put into a container such as tomcat to run

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326268507&siteId=291194637