Home > code > Maven & Eclipse

Maven & Eclipse

Our project here uses Maven 2 to manage the dependencies and builds. I really like developing code in Eclipse, and I wanted to set up my Eclipse workspace easily from the existing Maven configuration.

The Maven Eclipse plugin makes that easy. Just run the following command:

mvn eclipse:eclipse

and the plugin generates the Eclipse project files, ready to be imported into your Eclipse workspace.

Well, that’s great and all, but when I tried it I saw this error:

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Request to merge when 'filtering' is not identical. Original=source src/test: output=target/test-classes, include=[**/*.java], exclude=[], test=true, filtering=false, merging with=resource src/test: output=target/test-classes, include=[*.properties|*.xml], exclude=[**/*.java], test=true, filtering=true
[INFO] ------------------------------------------------------------------------

A Google search led me to this answer:
http://stackoverflow.com/questions/1397903/setting-project-for-eclipse-using-maven

Basically the problem is that something changed in the latest version of the Maven Eclipse plugin that prevents this from working with our Maven configuration.

The solution is to use the 2.6 version of the plugin instead.

mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse

Advertisements
Categories: code Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: