spring boot packaging

In the corresponding pom file, find the attribute of packing and change it to war ; if not, add one yourself. This has a default value, which is jar by default .

E.g:

<modelVersion>4.0.0</modelVersion>

<groupId>com.xxx.yyy</groupId>

<artifactId>test-war</artifactId>

<packaging>war</packaging>

<version>1.0</version>

Configure your pom.xml file, configure packaging as war , then right-click on pom.xml, run as and select install or package; (you can execute install or package; before executing clean; the difference between install and package, install will The typed package is generated in the .m2 folder in the maven warehouse )

 

If the project is OK and the configuration is OK, the war file will be generated in the target directory of the project.

 

It is because the ordinary java project is built, and it needs to be converted into a maven project.
The operation steps are as follows:

1. Right-click the project--maven--Disable maven nature
2. Execute the command in the current directory (that is, the directory with the pom.xml file) - mvn eclipse:clean
3. Re-convert the project to a maven project. Right click on the project--- 'Configure'--- 'Convert to meven project'

 

self-summary

 

Right-click on the selected project - run as - maven clean  needs to be cleaned before packaging. After the clean is successful, select maven install  to package.

 

After the packaging is successful, the generated war package will be in the project directory -target directory

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326644020&siteId=291194637