Eclipse + Maven: Create a webapp project, mavenwebapp
Create a webapp project using Eclipse + Maven <1>
1. Enable eclipse, right-click new -- other, for example, find maven project
2. Select maven project. The maven project Creation window is displayed. Select Create a simple project.
3. Enter the basic information of the maven project, as shown in:
4. Complete the maven Project Creation and generate the corresponding maven project results, as shown in the following figure. Some structures are not required by the project. We need to remove them:
5. Select a project, right-click the project, and choose Properties From the shortcut menu, as shown in:
6. Select java 1.7 and remove the other two items, for example:
7. Click OK and return to the project structure again. The project structure is clear and conforms to the maven project we want to create.
8. At this time, the results under the webapp are not displayed, because at this time, we have not configured this project as a web project, and re-enter the Properties configuration, as shown in:
9. Click Further configuration available..., as shown below:
10. Configure src/main/webapp and check the web. xml generation option as follows:
11. After confirmation, go back to the maven menu and remove the Dynamic Web Module check box. Click OK, as shown in the following figure. The webapp directory structure is displayed:
12. You also need to configure src/main/webapp as the root directory of the "/" project, as shown below:
13. After completing the preceding configuration, complete the maven webapp project structure, as shown in: