First, in Eclipse, right-click on the project name that needs to be packaged, and then point the mouse cursor to "run as" in the Popup box:
Second, you will see a floating window appears on the right side of the popup box, as follows:
Third, on the top of the second hover window mouse click "Maven clean", MAVEN will erase the previous package information on the project, after execution in the Eclipse console console will see the following information:
Four, then repeat one or two steps, select "Mavenbuild", you will see the following pop-up interface, in "goals" after the text box enter "-X package", tick the bottom of "update snapshots" and "Skip tests", and then click on the bottom right of the " Run ":
After run, you can see the Eclipse console output as follows, representing the success of the package:
Six, then right-click on the project name, select "Refresh" refreshing, and then open the project directory, you can see under the project under target has generated a "Plansystem1.war" file,. War end, project name begins with:
Copy the file ending with this. War to the server, such as the WebApps directory of Tomcat:
Eight, start the Tomcat server, and then you can access the Web project in the browser normally:
Ix. after changing the project name, MAVEN packaging considerations:
Normal packaging, the generated file name is the project name, but if we change the project name, then the package file name is still the previous project name, not changed; for example, I changed the PLANSYSTEM1 project name to Myplansystem, then package it, You will see that the resulting file is still Plansystem1.war,
Ten, after changing the project name, MAVEN packaging considerations:
This time need to open the other arrow refers to the "pom.xml" to modify something, open the Pom.xml, in the following interface, click the arrow point of the place, in the area of the code to search for "Finalname", you will see Finalname the middle is still the previous project name:
Xi. after changing the project name, MAVEN packaging considerations:
Change the name of this place to the changed project name,
12, after changing the project name, MAVEN packaging considerations:
After saving and then re-performing the packaging operation, you will see the. war file name has been successfully changed to the project name:
How Eclipse and Maven build a war package for a Web project