Question

Historically, its been a major hassle for our team to import our multi-module Maven project into Eclipse given all the Flex, WTP, and GWT stuff in there. We were recently thinking that the maven-eclipse-plugin could help us by generating the appropriate Eclipse project files.

However, it seems now that the M2Eclipse plugin has been swallowed up by Eclipse and importing Maven projects now seems to read the pom and try to do the Right Thing.

Does this mean the maven-eclipse-plugin is essentially obsolete? What can we do to help our projects import into Eclipse in the best possible way?

Was it helpful?

Solution

maven eclipse plugin and m2eclipse (now m2e) are independent projects. They stopped working together from 2.7 release of maven eclipse plugin (when maven eclipse plugin dropped eclipse:m2eclipse goal).

I believe you can use maven eclipse plugin with Eclipse if you do not have m2e plugin, but the support, especially for wtp is limited, if not non-existent.

OTHER TIPS

From a methodology perspective, I would really prefer the m2eclipse way -- i.e. Eclipse invoking maven for builds, so it does exactly the same thing as a pure maven-build.

The problem I found with the m2eclipse, though, was that it always got so horribly, ridiculously, go-have-a-coffee-break-while-you-wait-for-it slow performance, when the maven project became larger adding more and more sub-projects.

I first tried it in 2010, and finally gave up on it. Tried it again a year later, and to my dismay it still sucked just as much -- I dont get it -- it takes MUCH MUCH longer than just building with "mvn clean install" directly -- shouldnt it actually do the same thing???

The "mvn eclipse:eclipse" plugin, on the other hand, works like a charm, as long as you just have a PURE java/jar/war build. But if the maven build does other "plugin" stuff, for example legacy rmi-compiles or using ant for sub-tasks, etc, that will just be ignored during the Eclipse-build and so doesnt work.

The workaround for that is that you FIRST need to build the project ONCE in maven, then run "mvn eclipse:eclipse", then you can edit java-code and it works in Eclipse -- as long as you dont do Project => Clean !

If you do you that (or change anything in the maven-plugins parts Eclipse doesnt understand about) you need to re-build in maven, then do eclipse:eclipse again, then refresh the project in Eclipse. Thats how I usually work, and I think and it works good enough.

It is now officially part of the Eclipse project. It is bundled with the Eclipse.org Java builds. The previous means of installing the plugin is essentially obsolete. It can now be installed via the Indigo update site under "Collaboration -> m2e".

Indigo update site Maven

To import maven projects in to Eclipse simply use the same "File -> Import... -> Maven -> Existing Maven Project"

Eclipse Maven Import

I don't see it as a case of one making the other obsolete.

I see it as two independent plugins with each establish a relationship between Eclipse and Maven, but in opposite directions.

With m2eclipse being a lot more integrated, it appears to be the more popular option.

It plays well with the maven-ear-plugin for packing up an EAR.

The m2e-wtp plugin also sits in the middle of m2eclipse and WTP to allow Eclipse to utilise your POM files to deploy your projects to the server using Run As.. > Server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top