Eclipse creates a Maven project

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!

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324592333&siteId=291194637