Java Dynamic Web project with Maven and Eclipse

前端 未结 4 2102
温柔的废话
温柔的废话 2020-12-12 16:32

I have several questions about creating a Java Web application with Maven and Eclipse:

  • How do I create a Java web project with servlets, jsp, and other classes
4条回答
  •  生来不讨喜
    2020-12-12 17:03

    • Step 1: create your web app folder.
    • Step 2: Move to that folder in command prompt.
    • Step 3: use following command:

    mvn archetype:generate -DgroupId=com.helloworld -DartifactId=HelloWorldDemo -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

    DarchetypeArtifactId=maven-archetype-webapp will create a maven web project.

    • Step 4: Now on command prompt go inside the project folder and use this command: mvn eclipse:eclipse -Dwtpversion=2.0 to make your project a dynamic web project for eclipse, now import this newly created project as an "Ëxisting project"

    Use m2eclipse plugin of eclipse to enable MAVEN in eclipe.

    Web.xml will be at \src\main\webapp\WEB-INF

提交回复
热议问题