Packaging with maven

To use maven for packaging, in the early stage, it must be a maven project.
The operation steps under windows are as follows:


  • 1. Enter cmd;
  • 2. First use mvn clean package to clear the old package
  • 3. Enter mvn package for packaging


How to make jar packages and war packages:
1. It needs to be set in the packaging property in the pom file

<packaging>war</packaging>

Remarks: The jar package is just a toolkit, which requires the support of the main function to be run independently; the war package is a web module that can be directly published to tomcat or other containers to run;

any project can be converted into a maven project in eclipse , the steps are as follows:
Right click-Configure-Convert to maven projects

Guess you like

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