Eclipse creates a Maven project:
Eclipse: New -> Other -> Maven Project -> Next -> webapp -> Finish
If there is a problem in this step, you can modify the maven Catalog: Windows --> Preferences --> Maven --> Archetypes --> Add Remote Catalog --> http://repo1.maven.org/maven2/archetype-catalog.xml
Then: Catalog select maven catalog:
The built Maven project structure:
index.jsp is missing javax.servlet.http.HttpServlet, pom.xml adds:
<dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>3.0-alpha-1</version> </dependency>
The reason why the src/main/java and src/main/resources files do not appear is because there is a problem with the JDK environment, you can change it to the current Eclipse JDK,
If there is no resources file, you can also create a new one. The final directory structure is as follows:
At this point, a Maven project is created!