IntelliJ Idea for Maven2 & Spring development

Last week I tried Spring IDE 1.2.6 which is basically a set of plugins to support Spring development in Eclipse. The IDE provides excellent features like autocompletion (on class and property level) and a graphical view of the bean stack.

A big downside is the stabillity. Allthough some colleagues don’t seem to have problems, my Eclipse install started to throw errors (xml parser related it seems) at unpredictable moments.

While browsing arround, looking for a way to solve the problem I discovered that the IntelliJ IDEA (5.0) has build-in spring support. Allthough I’ve always been quite fond of eclipse I decided to give it a go… can’t be a bad thing to know the ‘competition’.

Since the project I’m working on is maven2 based setting up the project for InelliJ development was ultra-easy:

mvn idea:idea

from the project root created the project environment… and after opening the generated project file, I was ready to go!

The first thing I wanted to see was the Spring integration, after installing the IdeaSpring plugin I had to manually copy $IDEA_DOWNLOADED_PLUGINS_DIR/idea-spring-parser.jar to $IDEA_HOME/lib.

After the plugin is installed the project configuration window shows a new icon, which opens the IdeaSpring configuration dialog. In this dialog you can specify which files in your project are Spring configuration files:

Select applicationContext file

If you have done this, you will notice that the Spring autocompletion works for the selected files!

spring autocompletion

Wow, cool…. it works!

Now for the maven2 integration, the plugins I found where mostly maven 1.0 related, so I decided to add maven 2.0 as an external tool:

Maven as external tool

I made a runner for the ‘package’ target, which by default also runs all unit tests. I copied this configuration and added

-Dmaven.test.skip=true

to create a runner which doesn’t run all unit tests.

IntelliJ automatically creates the options to run the created tools in the project context menu (right-mouse) and tools menu:

maven runner

Cool!

This entry was posted in java. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>