Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] m2e and maven 3 extensions

Short answer, this is not supported by m2e.
Manipulating MavenProject model at runtime breaks some fundamental assumptions m2e makes about projects and something I have no plans to support in m2e. I think custom packaging type is a better way to add new plugin executions to projects without having to explicitly configure <plugin> elements in pom.xml.
On Wed, Jun 3, 2015, at 07:53 AM, Francois-Xavier Bonnet wrote:
I developed a maven extension that dynamically binds plugin executions to the build lifecycle of the project.
I just had to override org.apache.maven.AbstractMavenLifecycleParticipant.afterProjectsRead(MavenSession)
and inside this method, I add the plugin executions this way:
Plugin plugin = new Plugin();
PluginExecution pluginExecution = new PluginExecution();
When I build my project, all the plugin executions run as expected but some of the plugins generate some code and the source folders are not added to the build path by m2e.
This is the case even for plugins that support m2e (like build-helper-maven-plugin) which means that when explicitly declared in the pom.xml, the generated source folder is added to eclipse build path but when added dynamically by my extension it is not.
How can I trigger the addition of a folder to the build path in eclipse without adding explicitly some plugin or lifecycle metadata to my project's pom.xml?
Is there an equivalent of lifecycle-mapping-metadata.xml for maven 3 extensions?
m2e-users mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top