You should provide a small eclipse plugin that tells m2e what to do (for example simply execute the mojo).
Everyone that wants to use your mojo should install this small plugin. The reason is simple: Some mojos are not executed by m2e. For example the java-compiler mojo is ignored and the ecplise compiler is executed with corresponding values. So someone decided two years ago to create error markers for every unknown mojo execution. So that one day eclipse is aware of the most mojos and they are well integrated with eclipse. A small example: https://github.com/php-maven/maven-php-plugin/blob/master/ide-plugins/eclipse/tags/2.0.3/org.phpmaven.eclipse.core/lifecycle-mapping-metadata.xml Notice the build.properties to include it in the build: https://github.com/php-maven/maven-php-plugin/blob/master/ide-plugins/eclipse/tags/2.0.3/org.phpmaven.eclipse.core/build.properties And notice the lifecycle-mapping extension: https://github.com/php-maven/maven-php-plugin/blob/master/ide-plugins/eclipse/tags/2.0.3/org.phpmaven.eclipse.core/plugin.xml#L41 If you are only testing a hello world sample simply ignore this problem marker or use the quickfix. The quickfix will add a small snippet into your pom telling eclipse what to do. Or simply tell your users to use the quickfix on their projects. On Thu, Jun 14, 2012 at 4:52 PM, motes motes <mort.mo...@gmail.com> wrote: > I am using eclipse 3.7.1, with m2eclipse 1.0.1. I have followed this > guide to create a maven-plugin: > > http://maven.apache.org/guides/plugin/guide-java-plugin-development.html > > In another maven project I test this plugin using: > > <build> > <plugins> > <plugin> > <groupId>sample.plugin</groupId> > <artifactId>hello-maven-plugin</artifactId> > <version>1.0-SNAPSHOT</version> > <executions> > <execution> > <phase>compile</phase> > <goals> > <goal>touch</goal> > </goals> > </execution> > </executions> > </plugin> > </plugins> > </build> > > But inside eclipse I get the error: > > Plugin execution not covered by lifecycle configuration: > sample.plugin:hello-maven-plugin:1.0-SNAPSHOT:touch (execution: > default, phase: compile) > > This problem has been covered here: > > http://wiki.eclipse.org/M2E_plugin_execution_not_covered > > If I change the phase to "package" it works. But what are the > recommended practices when writing maven plugins and some steps needs > to be executed during the compile phase? > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >