How Eclipse and Maven build a war package for a Web project

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.