-->

How does the m2e eclipse plugin interact with ecli

2019-02-07 10:46发布

问题:

I am an eclipse power and who has ignored maven due to the historically poor maven / eclipse integration. m2e seems to be maturing and I am taking it out for a serious test drive.

I want to understand how m2e works within eclipse, so I can better get the two working smoothly together and to understand the still cryptic error messages and problems that arise.

I have tried googling for an explanation of the m2e eclipse integration architecture and found nothing that provides a good account of how the integration works. rather just a lot of scattered blog posts all over the web.

Can anyone provide a solid overview of how m2e bridges the gap between the eclipse view of the world and maven view of the world? Especially how does maven integrate into the incremental builds that eclipse does? What is the impact on eclipse stability / performance from using m2e.

回答1:

I have found the details I was looking for in a Presentation from Eclipse Con titled "m2e, an exercise in mixing oil and water"

http://www.eclipsecon.org/europe2012/sites/eclipsecon.org.europe2012/files/EclipseConEU2012-m2e-talk.pdf

Abstract:

m2e is a popular Eclipse IDE plugin with stated project goal "to provide a first-class Apache Maven support in the Eclipse IDE". In this talk I will give an overview of Maven/Eclipse integration approach implemented by m2e, highlight differences between Maven and Eclipse that make proper integration difficult or impossible and will discuss possible ways to improve the integration. The talk is targeted at Eclipse and Maven developers who want to better understand challenges of Maven/Eclipse integration and advanced m2e users who want to know what happens "under the hood".



回答2:

Sonatype has a pretty good book about it at http://www.sonatype.com/Support/Books/Developing-with-Eclipse-Maven



回答3:

In short, m2e will setup your Eclipse base on the Maven POMs of your projects, and it provides you access to Maven commands

these are some of the most obvious things m2e done:

  1. setup the source folder and output directory according to POM
  2. Setup dependencies/libraries and project dependency base on POM
  3. Use corresponding Eclipse plugins base on Maven plugins (if M2E knows how to deal with it) etc.
  4. Allow you to run Maven goals
  5. etc.....

It is neither a formal nor a accurate description, but I wish it give some basic idea :P