[Java] Build a Maven web project by using the Problems and Solutions encountered by ECLIPSE

Source: Internet
Author: User

Recently I am working on a small project, using Maven corresponding to m2eclipse plug-in and spring MVC.

1. Create a Maven web project in eclipse

Http://limingnihao.iteye.com/blog/830409

1.1 create a Maven project and select Maven-Archetype-webapp.

1.2 configure the maven Project (I personally don't think it is necessary)

1.3 turn the project into a dynamic web project. Right-click the project, select project facets, and click convert to facted form.

1.4 configure project facets. Change the version of the dynamic Web module to 2.5. (3.0 for Java 7 ). If an error occurs, you may need to set the level of compiler compliance to 1.6 in Java compiler. (I changed to 1.5, corresponding to java5)

1.5 (important) setup and deploymentProgramSet (Web deployment Assembly)

The list here shows the path of the file to be published when a project is deployed.

1. We delete two items of test because test is used for testing and does not need to be deployed.

2. Set to publish the jar package of Maven to Lib.

Add-> JAVA build path entries-> Maven dependencies-> finish (I often forget to add a package here)

 

Ii. Use eclipse

1. There is a Red Cross in the project, and the markers panel prompts how to make an error. Press Ctrl + 1 to quickly find the solution.

 

Iii. m2eclipse

1. Add dependencies first and then writeCode

Related Article

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.