How to create Spring MVC application with Maven structure in Intellij IDEA 13.1?

后端 未结 3 1678
借酒劲吻你
借酒劲吻你 2021-02-01 03:50

I want to to create new Spring MVC project in Maven structure using Intellij IDEA but can\'t do that. actually i want to creat

3条回答
  •  时光说笑
    2021-02-01 04:33

    The above suggestions didn't work for me. What I did is Creating MVC project straight up with Maven, based on the archtype:

    http://kolorobot.github.io/spring-mvc-quickstart-archetype

    The command is:

    mvn archetype:generate \
        -DarchetypeGroupId=pl.codeleak \
        -DarchetypeArtifactId=spring-mvc-quickstart \
        -DarchetypeVersion=1.0.0 \
        -DgroupId=my.groupid \
        -DartifactId=my-artifactId \
        -Dversion=version \
        -DarchetypeRepository=http://kolorobot.github.io/spring-mvc-quickstart-archetype
    

    Or, if you want to just Copy-Paste it to shell or cmd in one line:

    mvn archetype:generate -DarchetypeGroupId=pl.codeleak -DarchetypeArtifactId=spring-mvc-quickstart -DarchetypeVersion=1.0.0 -DgroupId=my.groupid -DartifactId=my-artifactId -Dversion=version -DarchetypeRepository=http://kolorobot.github.io/spring-mvc-quickstart-archetype
    

    When DgroupId, DartifactId & Dversion are the groupId, artifactId and version of your project.

    It will generate a full working maven project.

    The next step is just to import the maven project to IntellijIDEA.

    As for Version 14.1.4:

    1. File -> New -> Project from Existing Sources... and choose the Project you generated.
    2. Check the Import project from external model and choose Maven.
    3. At this point there will be more configurations, but you can just click Next & Finish.

    To run the project in your browser you would need to install and configure Apache Tomcat.

    IntelliJ and Tomcat.. Howto..?

提交回复
热议问题