In this talk we will deep dive into how m2e executes Maven Plugins in the Eclipse workspace build and explain how users, Maven-Plugin developers and Eclipse-Plugin developers can improve the integration to get the best user experience in an Eclipse workspace.
We start with an introduction to the problem and explain how goals of Maven Plugins (so called Mojos) are executed as part of the (incremental) build of a Maven project in an Eclipse workspace.
This includes the concept of M2E's Lifecycle-Mapping-Metadata, to control if and when a Mojo is executed as well as the information M2E obtains from of a completed Mojo execution, like modified files and occurred errors.
We will discuss the different ways to control Mojo executions for Eclipse M2E users, Maven-Plugin developers and Eclipse-Plugin developers.
How Maven-Plugin developers can use the tool-neutral Plexus Build API in their Maven-Plugin to provide a proper integration out of the box and provide embedded Lifecycle-Mapping-Metadata and how users can specify Lifecycle-Mapping-Metadata in their POM-files by themself and the different styles to do that.
Last we will discuss how Eclipse-Pluins acting as M2E-Connector can be used to provide Lifecycle-Mapping-Metadata and to implement advanced integration of a Maven-Plugin with other Eclipse-Plugins in the Eclipse IDE.
As an example M2E's recently added M2E-PDE connector will be demonstrated.
It enables using pure Maven Projects, which get their OSGi MANIFEST.MF generated by the maven-bundle-plugin or bnd-maven-plugin, in an Eclipse workspace as if they would be ordinary Eclipse PDE Plugin projects. Therefore it is a helpful tool for example to 'OSGi-ify' a Maven artifact or to enhance its OSGi MANIFEST.MF.