Is maven-eclipse-plugin no longer needed with the new M2Eclipse in Indigo?

邮差的信 提交于 2019-12-02 21:02:48

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.

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".

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!