I. Creating a Project
Create a project with Maven in 1.Eclipse
In next
2. Continue Next
3. After selecting Maven-archetype-webapp, next
4. Fill in the appropriate information, packaged is the default to create a package, do not write or
5. After creating the project, the directory is as follows:
At this point, the project has been created, but the configuration below.
Two. Project configuration
1. Add Source Folder
MAVEN requires that you create the following source Folder
Src/main/resources
Src/main/java
Src/test/resources
Src/test/java
Add the above source Folder
The following directories are created:
2. Configure the Build Path
3. Set the output of the 4 Folders folder, double-click Modify
Modify the output path separately to
Src/main/resources Correspondence Target/classes
Src/main/java Correspondence Target/classes
Src/test/resources Correspondence Target/test-classes
Src/test/java Correspondence Target/test-classes
4. After modification, as
5. Setting libraries
6. After configuring the build path, the directory is as follows:
7. Convert the project to dynamic WEB project
Right-click Properties on the Project
Select Project Facets on the left and click Convert faceted from on the right
8. Modify Java as the JDK for your current project, add the dynamic Web Module, and then click the further Configuration available link:
9. Modify the content directory to Src/main/webapp, click OK:
10. After setting content Directory,ok, click the previous interface OK again to complete the conversion to dynamic WEB project
11. Set up Deployment assemblies (Web Deployment Assembly)
Right-click on the project, select Properties, select Deployment Assembly on the left
12. Set the file publishing path at deployment time
1, we delete the two items of test, because tests are used for testing and do not need to be deployed.
2, set the Maven jar package to be published under Lib.
ADD, Java Build Path Entries, Maven Dependencies, Finish
After Setup is complete
After OK, the Web project is created and the directory organization
After running access to the project successfully!
Create a MAVEN project based on Eclipse