Building a Java Web project using Eclipse + Maven (ii)

Source: Internet
Author: User
Tags java web

Building a Web Project

1. Eclipse New Project, select Maven Project.

2, select the Maven-archetype-webapp project.

3. Enter the group Id and artifact Id,finish.

The default directory structure after new is as follows:

The item has a red Cross hint because a reference to the servlet is missing

4. Add a servlet API reference. Find the servlet coordinates from the MAVEN repository and add them to the pom.xml.

5. New folder, not all MAVEN directory structure

6, check the output path of the project file, right-click the project, build path-->configure build Paht-->source, make sure the output path is the classes folder under Target.

7. Set the project as a Web project.

Project Properties-->project Facets, ensure dynamic Web module Shang.

8, set the release configuration. Open the deployment Assembly in the project properties to remove the test file from the deployment options.

Now that the Web project has been configured, you can run the project by putting the resulting war package into the container as soon as you package the project with the MAVEN packages command.

Building a Java Web project using Eclipse + Maven (ii)

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.