1. Manually set up the directory structure
project|--pom.xml '--src |--main | '--java | '--Resources | '--WebApp | '--web | '--Test '--Java '--resources
2. Building Web. xml
The NS of Web. XML can refer to the following links, although these links may expire over time, but can always be Google to.
Http://docs.oracle.com/cd/E13222_01/wls/docs81/webapp/web_xml.html
Http://docs.oracle.com/cd/E24329_01/web.1211/e21049/web_xml.htm
Example:
<?xml version= "1.0" encoding= "UTF-8"? ><web-app xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xmlns= "Http://java.sun.com/xml/ns/javaee" xmlns:web= "Http://java.sun.com/xml/ns/javaee" xsi:schemalocation= "http ://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd "id=" webapp_id "version=" 3.1 "> </web-app>
3, establish Pom.xml
Refer to: http://maven.apache.org/pom.html
Example:
<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xsi: schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > & Lt;modelversion>4.0.0</modelversion></project>
Summing up, with MVN archetype:generate can be the most convenient to achieve the purpose, if you want to control more accurate, may wish to read the document, and then manually set up.
Create a Maven WebApp project manually