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)