Java Web Learning Series-create a Web project using Maven under MyEclipse for Spring, myeclipsemaven
Create a Maven Web Project
Create a Maven project in Eclipse
Select the project type and select maven-archetype-webapp from Artifact Id.
Enter the Group ID, Artifact ID, and Package. Generally, the Group ID is the name of a large project. The Artifact ID is the name of a sub-project, and the Package is a Package for you by default.
The file structure is as follows:
Added the src/test/java Directory, which is mainly used to compile the server test code.
Through the above steps, a basic Maven Web project structure is created.
Project troubleshooting
The index. jsp file created by default in the project reports The following error: the superclass "javax. servlet. http. HttpServlet" was not found on The Java Build Path
Right-click the web Project-> property or Build Path-> Java Build Path-> Libraries-> Add Libray...
Select MyEclipse Server Library
Select the corresponding version of Tomcat Runtime Library
Return to Order and Export on the Java Build Path interface and check the configured Tomcat Runtime Library to solve the above error.
Maven Web project compilation release test
Compile this project
After executing the Maven install compilation command, a corresponding file will be generated, and any one of the red boxes can be published using Tomcat,
Access the deployed project and output the content of the page normally.