This is the Eclipse M2e plugin trick. Sachin Shekhar R
is right, but the answer is not clear enough for newbies like me. Here comes my understanding:
See http://wiki.eclipse.org/M2E_plugin_execution_not_covered.
There are two methods to do so in Eclipse M2e.
use the code listed in
Sachin Shekhar R
's answer. Notice that this piece of code must under<pluginManagement><plugins>
and<pluginManagement>
must be inside<plugins>
. sample code:<build> <plugins> <plugin> <!-- plugins here--> </plugin> </plugins> <pluginManagement> <plugins> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <versionRange>[1.2.1,)</versionRange> <goals> <goal>exec</goal> </goals> </pluginExecutionFilter> <action> <ignore/> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> </plugins> </pluginManagement> </build>
This only works in the project.
use the "Quick Fix" feature of the Eclipse M2e plugin. It exists after version 1.0. Find the error in
Problems
tab. Right click on it, select "Quick Fix". There would be a Quick Fix window popping up, select the second optionMark goal exec as ignored in Eclipse build in Eclipse references (experimental)
.
This method would write above code between<lifecycleMappingMetadata>
into workspace profile of lifecyclemapping intoworkspace/.metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml
This works in the entire workspace