First, let's talk about the steps to build a MAVEN Web project in Eclipse! Although it is a simple example, the process is very difficult.
First, let's look at Eclipse's cover, and here's the gorgeous cover you just opened.
Next i installed the Java EE IDE for Eclipse and started the specific steps.
1.Ctrl + N Bring up new window, double click to select Maven Project
2. Click Next directly
3. Double-click to select Maven-archetype-webapp
4. Enter group Id and artifact Id,package automatically generated according to personal situation, click Finish
The project structure under Java view is as follows
5. Right-click Project, build path, Configure build path ...
6. Drop two wrong source folder on source
7. Click on the Add Folder ... click Create New Folder ... Add Src/main/java, Src/test/java and Src/test/resources
8. Double-click the output folder under Src/test/java and Src/test/resources, and set the class publishing directory for the test code compilation to Target/test-classes. In order to not be mixed with the official code compiled files, the official code publishing directory using the default target/classes.
9. Adjust the display order of the folder in order and export
10. Double-click in libraries to replace the default JRE with your own JRE, as I am replacing the JRE system library [j2se-1.5] with the JRE system library [jdk1.8]
11. Convert to a Dynamic Web project so that Tomcat recognizes
Click on the left side of Project Facets, on the right, select dynamic Web Module-----set version to 2.5 (default 3.0 for Java7), and temporarily do not click OK
12. Click Deployment Assembly on the left to delete the two test folder that you do not need to deploy
13. The project we are creating now has errors because of the lack of the jar package we need, we want to add Java EE code in the coordinates of the Pom.xml configuration jar we can go to the official website to find
This is missing the jar we need, we now configure, but how to match, I do not say from which official website downloaded, but the default is Apache official website download, you can also download from other official website.
If you want to download from other official website, you need to configure some things in Setting.xml
This time the whole project will not be an error.
14 Configuration service, when no Tomcat is going to add Tomcat himself
adding items to Tomcat
So it really really can be, simple configuration, if you start the service on the page when you display the characters defined in the index.jsp, we succeeded!!!!!!!
Our acquaintance is always so skillful. Build a maven project-------Eclipse