Using the Eclipse plugin maven, the Web is packaged to run directly under War,tomcat

Source: Internet
Author: User

1, first download maven it as: http://maven.apache.org/download.html download Apache-maven-3.0.3-bin.zip

environment variable is configured as variable name m2 value of%m2_home%\bin variable named M2_home value is C:\Program files\apache-maven-3.0.3 add%m2% in Variable name path

Then launch eclipse, select Install new software in Help and enter http://m2eclipse.sonatype.org/sites/m2e/on the URL

2. Then restart Eclipse

Click New Project to select the others point Marven in the Marven project, if you create a Web project choose Marven-archetype-webapp followed by the input, you see.

After creating the project, add the following in the project's Web. xml

Code <welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

3. Click Run as in the Marven package. Generate the war file for the project, then copy the file to Tomcat's WebApps file, click the Startup.dos file in the Tomcat Bin directory to start Tomcat, and then enter the HTTP://LOCALHOST:8080/project name on the browser /

Then the page will show Hello word!

Using the Eclipse plugin maven, the Web is packaged to run directly under War,tomcat

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.