Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I want to to create new Spring MVC project in Maven structure using Intellij IDEA but can't do that. actually i want to create project like mkyong.com samples, like this.

NOTE

I'm new to Intellij IDEA and want to create new project not import from existing project.

like image 465
Rasool Ghafari Avatar asked Jul 10 '14 14:07

Rasool Ghafari


People also ask

How add Springframework to IntelliJ?

Enable Spring support in IntelliJ IDEAPress Ctrl+Alt+S to open the IDE settings and select Plugins. Open the Installed tab, search for Spring and make sure that the checkboxes next to all relevant plugins are selected.

How do I create a project as Maven project in IntelliJ?

In the Project tool window, right-click your project and select Add Framework Support. In the dialog that opens, select Maven from the options on the left and click OK. IntelliJ IDEA adds a default POM to the project and generates the standard Maven layout in Project tool window.


1 Answers

All you need to do is the following.

Click File -> New Project and then:

First add this Maven archetype (from the button on top right)

enter image description here

That archetype will help you bootstrap the project by providing some Spring configuration code and must be present in your local Maven repository (directions are provided on how to do that in the link I sent - it's very easy).

After adding the archetype just do like in the following screenshot:

enter image description here

The next screen just asks you for the the GroupId, ArtifactId and Version of your project. The following screens are trivial.

That's it!

Note that you can use any archetype you like (although the one I supplied seems to be very much up to date). If you find a better one than the one I supplied, feel free to use it. You can also write your own without too much trouble.

like image 131
geoand Avatar answered Sep 20 '22 05:09

geoand