1. Open Eclipse, right-click new--"Other, if you find Maven project,
Select Maven Project , Click Next
2. After selecting Maven project, display the window for creating MAVEN projects, tick Create a simple project , and then next
3. Enter the basic information for the MAVEN project as shown in:
4, back to the project structure, the project structure is relatively clear, in line with the MAVEN project we want to create
5. Since our project is going to use eclipse to post to Tomcat, here we need to first turn the project into Dynamic Web project
Select items, right-click Properties , go to the Properties page,
Select to the Maven menu Project Facets , Click Convert to faceted form ... , as follows: as shown in the following:
6. Tick The Dynamic Web Module Click further configuration available ...
After clicking
7. Change the webcontent to Src/main/webapp, and tick the option to generate Web. XML, as follows:
8, complete the configuration as above, the final completion of the MAVEN WEBAPP project structure as shown:
9. Create a simple JSP initial page under WebApp index.jsp
<%@ page language= "java" contenttype= "text/html; Charset=utf-8 " pageencoding=" UTF-8 "%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >
10. Deploy the test project to Tomcat to test the http://localhost:8080/test results:
OK, you can easily build a Web project with Mawen.