Eclipse uses MAVEN to build a Web project __web

Source: Internet
Author: User
because Maven was used in the project, I had to learn maven, and here's how to use MAVEN to build a Web project in EclipseNot much nonsense to go straight to the point:
1: Create a new MAVEN project


Then select the work path




Click Next to select WebApp


Click Next to write the Group ID, artifact ID, and package,package to create a package by default, not to write or


The new success directory structure is as follows: Perspective Java EE mode






Remember the right key project Properties->java build path->libraries Remove the old JDK and add the JDK installed on the local computer in the Add library.

Properties->java compiler modify the corresponding JDK version number.

The error of the project here is that the Javax.servlet-api.jar package required by JSP has not been introduced.



, here teaches you how to lead the jar pack; The Central Library address on MAVEN's web http://mvnrepository.com/search for the jar content you need


and find the appropriate content.


Copy the following code and add it to pom.xml.



Configuration item: You need to add Src/main/java,src/test/java, src/test/resources three folders. Right key item root directory Click New-> Source folder, build these three folders

Note: Instead of building a normal folder, source folder


Publish right-click on the project: Run as->maven install then run as-> mavenpackage. Run with Tomcat after the build













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.