Plugin error: execution not covered by lifecycle configuration - eclipse

I am trying to use the maven-warpath-plugin available here. But I keep getting an error in my pom.xml file that says:
Plugin execution not covered by lifecycle configuration: org.appfuse.plugins:maven-warpath-plugin:2.1.0:add-classes (execution: default, phase: generate-sources)
How do I resolve this? Here is my pom.xml snippet for the plugin:
<plugin>
<groupId>org.appfuse.plugins</groupId>
<artifactId>maven-warpath-plugin</artifactId>
<version>2.1.0</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>add-classes</goal>
</goals>
</execution>
</executions>
</plugin>
Eclipse offers me a quickfox tip to "discover new m2e connectors" to resolve this error. I have installed most of the connectors available that seem to apply but the error is still there. Any ideas how I could make this work?

This is the new behaviour of m2e (which replaced the old m2eclipse plugin). To specify what eclipse should do with the plugin you have to configure the build lifecycle mapping in the project's pom.xml - or install a connector (which decides if the plugin needs to be executed in an eclipse build or not) if it exists.
As there seems to be no connector for the maven-warpath-plugin yet you have to define the behaviour in the pom. You can use the second eclipse quickfix for this (Permamnently mark goal add-classes in pom.xml as ignored in eclipse build). This will add the following section to your pom:
<build>
......
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.appfuse.plugins
</groupId>
<artifactId>
maven-warpath-plugin
</artifactId>
<versionRange>
[2.1.0,)
</versionRange>
<goals>
<goal>add-classes</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
You can change the <ignore> action to <execute> if you want to process the plugin in each eclipse build (on import, clean, ...).
The plugin configuration is eclipse specific and does not make the pom.xml look nicer - but at least it has no influence on the Maven build....

Also see the answer How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds

Error pom.xml: Plugin execution not covered by lifecycle configuration: org.bsc.maven:maven-processor-plugin:3.3.3:process
my project is ProjectA, it's created by maven version 3.3.3 and i used eclipse version 4.5. But when install eclipse version 2021 - 4.20, then I open projectA on eclipse (version 4.20) errors appear in pom.xml: error detail: Plugin execution not covered by lifecycle configuration: org.bsc.maven:maven-processor-plugin:3.3.3:process (execution: process, phase: process-resources)
I don't know why appears on eclipse's new version 4.20. Error appear "execution"
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>3.3.3</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>process-resources</phase>
<configuration>
Thank you very much for help!

Related

maven: Plugin execution not covered by lifecycle configuration

I use eclipse and have included following dependency in my pom.xml:
<dependency>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<version>1.0.7</version>
</dependency>
When using this plugin:
<build>
<plugins>
<plugin>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<version>1.0.7</version>
<executions>
<execution>
<id>make-index</id>
<goals>
<goal>jandex</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
...
</build>
I get this error within eclipse ide:
Plugin execution not covered by lifecycle configuration:
org.jboss.jandex:jandex-maven-plugin:1.0.7:jandex
(execution: make-index, phase: process-classes)
when clicking to "Discover new m2 connectors", I get the error:
No marketplace entries found to handle jandex-maven-plugin:1.0.7:jandex in Eclipse.
Please see Help for more information.
How can I solve this?
Solution:
Added <?m2e ignore?> in pom.xml:
<!-- https://www.eclipse.org/m2e/documentation/release-notes-17.html#new-syntax-for-specifying-lifecycle-mapping-metadata -->
<plugin>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<version><dependency>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<version>1.0.7</version>
<executions>
<execution>
<!-- added: -->
<?m2e ignore?>
<id>make-index</id>
<goals>
<goal>jandex</goal>
</goals>
</execution>
</executions>
</plugin>
The Jandex plugin doesn't have a connector for Eclipse.
Just add an ignore rule. Eclipse will do that for you if you choose the right option and will add an ignore rule to your pom.xml.
Turns out1 that you should not ignore Jandex plugin in Eclipse. Otherwise your #QuarkusTests might fail with ArC/CDI errors.
I've created a PR adding the required m2e config to the plugin2. Once that is merged and released there should be no lifecycle issue anymore.
1 https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Jandex-Plugin.20in.20Eclipse.20m2e
2 https://github.com/wildfly/jandex-maven-plugin/pull/18
Looks like there is a updated Jandex version 1.0.8 that may have fixed this problem. I was referencing the quarkus documentation on a multi-module-maven which links to 1.0.7. I had a few issues running in quarkus:dev mode. Once I realized there was a 1.0.8 update, all my problems went away.

Make Eclipse Respect Maven-Dependency-Plugin

How can I have Eclipse recognise my use of the maven-dependency-plugin and execute it before deploying resources to Tomcat via WTP?
In a previous question I configured Maven to copy some artifacts into a war application, so I could serve them to web clients. The approach of copying them to target/${project.artifactId}-${project.version} works when packaging via the Maven command line. Sadly there's no such luck when using Eclipse's Tomcat integration.
Maven plugin configuration:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy</id>
<phase>compile</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<overWrite>false</overWrite>
<destFileName>optional-new-name.jar</destFileName>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
This answer assumes you're using Eclipse Java EE Kepler SR1 (or more recent), which comes with the Maven integration plugins (m2e and m2e-wtp).
m2e-wtp, the Maven Integration for WTP plugin ignores maven CLI builds and configures WTP to publish resources from known locations.
So you need to do 2 things :
configure the dependency plugin to copy jars to a known m2e-wtp location during eclipse builds
tell m2e to actually run the dependency plugin during project configuration updates.
First, define a new maven property, in your properties section :
<jars.directory>${project.build.directory}/${project.artifactId}-${project.version}/</jars.directory>
In your maven-dependency-plugin configuration, use :
<outputDirectory>${jars.directory}</outputDirectory>
Now that should give you identical build results with Maven CLI. Then you need to use a specific m2e profile, that'll be automatically enabled when run in Eclipse and ignored in all other situations :
<profiles>
<profile>
<id>m2e</id>
<!-- This profile is only activated when building in Eclipse with m2e -->
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<properties>
<jars.directory>${project.build.directory}/m2e-wtp/web-resources/</jars.directory>
</properties>
</profile>
</profiles>
Finally, we need to let m2e know it's ok to run maven-dependency-plugin:copy during project configuration. Add the following snippet to your pluginManagement section :
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[2.8,)</versionRange>
<goals>
<goal>copy</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnConfiguration>true</runOnConfiguration>
<runOnIncremental>false</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Now, make sure m2e knows about all these configuration changes : Hit Alt+F5 to bring up the Update Maven Configuration dialog, and click ok. Once the build completes, you should see your jar under Deployed Resources> web-resources, in the Project Explorer view.
From now on, deployments to Tomcat should contain optional-new-name.jar at the root of your webapp.

Eclipse Maven Error Plugin execution not covered by lifecycle configuration:

I am using Eclipse Juno with Maven 3.0.5 on Windows 7. The project was previously on Windows XP and I have moved to Windows 7 64 bit machine.
I have copied my Eclipse Spring 3, Hibernate 4 and JSF 2.0 project and when I try to compile I am getting the following error
Plugin execution not covered by lifecycle configuration:
org.bsc.maven:maven-processor-plugin:2.0.6:process (execution: process, phase:
generate-sources)
I tried as mentioned in this thread by adding the following in Eclipse.ini file, however it didn't solve the issue.
-vm
c:\Program Files\Java\jdk1.7.0_21\jre\bin\server\jvm.dll
Tried building maven install and clean, but problem still persists.
How can I resolve this issue? Any help is highly appreciable.
Thanks
Maven snippet
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.0.6</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<!-- source output directory -->
<outputDirectory>target/metamodel</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Newer versions of m2e complain if a Maven plugin does not provide a m2e lifecycle mapping. Newer plugins provider such a mapping via the file META-INF/m2e/lifecycle-mapping-metadata.xml in their JAR. If this file is not present, then Eclipse complains.
It is possible quite down these complaints by adding a lifecycle mapping for older plugins to your POM. In the given example, this mapping is done inside a profile which is automatically activated when a build is running in Eclipse (m2e.version property is set) and it is not active when a regular maven build is done.
<profiles>
<profile>
<id>m2e</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<versionRange>[2.0.6,)</versionRange>
<goals>
<goal>process</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
The example above disables the plugin in Eclipse builds. It is also possible enable it by specifying <execute /> as action .
Mind that the settings under pluginExecutionFilter must match the plugin and the goals of the plugin that you wish to map. Multiple pluginExecution elements can be specified to map different plugins.

How to eliminate the "maven-enforcer-plugin (goal "enforce") is ignored by m2e" warning by eclipse?

I am configuring a multi-module parent child maven project using maven and eclipse m2e, I am using the latest stuff from eclipse Juno SR1 which is m2e 1.2.0
the parent pom uses the enforcer plugin, so the parent pom.xml has the following in its plugin section
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.1.1</version>
<executions>
<!-- Enforce that all versions of a transative dependency must converge. -->
<execution>
<id>enforce</id>
<configuration>
<rules>
<DependencyConvergence />
</rules>
</configuration>
<goals>
<goal>enforce</goal>
</goals>
</execution>
<!-- Black list certain jars -->
<execution>
<id>enforce-banned-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<exclude>
commons-logging:commons-logging
</exclude>
</excludes>
</bannedDependencies>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
Each of the child projects has an error message saying maven-enforcer-plugin (goal "enforce") is ignored by m2e.
What is the meaning of this message?
How do I configure things to get rid of this message?
do I need to configure the eclipse project settings or the pom.xml settings?
The eclipse maven plugin runs a projects pom.xml file in order figure out how the maven project is configured and translate the maven pom.xml configuration into an eclipse configuration. A pom.xml can reference an arbitrary number of maven plugins and each of those plugins has the potential to leak memory, or do things that are harmful to eclipse. So by default the m2e eclipse plugin ignores any maven plugins unless those maven plugins have a special m2e plugin connector that tells m2e how to integrate the maven plugin into eclipse. In summary m2e is defending the eclipse JVM process against a buggy maven plugin, by saying that for every maven plugin there needs to be an m2e connector to bridge between maven and eclipse.
So to get rid of the warning I added the following to my plugin management section of the parent pom.xml
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>enforce</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
It seems that org.eclipse.m2e:lifecycle-mappingis a maven plugin designed to hold meta data to communicate with eclipse m2e plugin when it processes a maven pom.xml and this information is used to tell eclipse what do with maven plugins that are defined in pom.xml when eclipse runs the pom.xml as part of the eclipse UI.
From m2e version 1.4 and higher:
You can integrate the needed lifecycle-configuration within the pom (parent-pom or project-pom) or you can integrate the informations into the global m2e-configuration within eclipse.
Also you have some quickfix-actions for applying this changes.
The last option is to look for m2e-connectors or to switch over to newer versions of different maven-plugins with integrated m2e-support (e.g. for jaxb-plugins).
Here (for enforcer-plugin) I think, the definition in the pom is the easiest way.
See also: https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html
Just an FYI for those of you that have an issue with configuring your IDE in your build model. Keep an eye on this enhancement request currently targeted for the Kepler release:
Bug 350414: Store ignored m2e connectors outside project pom.xml
https://bugs.eclipse.org/bugs/show_bug.cgi?id=350414
For me it was similar issue
I had maven 3.0.3 and java 1.5
and my pom had
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[3.0.3,2.2.1,)</version>
</requireMavenVersion>
<requireJavaVersion>
<version>[1.7, 1.8)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
As you can see I dont really have met rules, hence I updated Java and got mvn going and I was all set. Hope this helps someone.
Another pitfall exists when having several pluginExecutionFilters. These must be at the right spot in the pom.xml! For me it was gnarly to find as no error or warning of the displacement existed.
This is the right code for having several pluginExecutionFilters:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>enforce</goal>
</goals>
</pluginExecutionFilter>
<action><ignore/></action>
</pluginExecution>
<!-- now here follows the new filter -->
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.googlecode.maven-java-formatter-plugin</groupId>
...
How to eliminate the “maven-enforcer-plugin (goal ”enforce“) is ignored by m2e” warning by eclipse?
Although the eclipse lifecycle-mapping plugin has worked for me on other projects, I can't change the pom.xml since I am currently working in an IntelliJ shop with my covert instance of Eclipse and I don't want to expose myself by changing all of their pom files to include anything from group org.eclipse.m2e.
After some experimentation, I've found that you can get this warning to not show up by changing the Lifecycle Mappings in the Maven preferences. Frankly I'm not 100% sure what this is doing but I've not seen any side effects so...
In Eclipse, go to: Preferences &rightarrow; Maven &rightarrow; Lifecycle Mappings.
Clicking Open workspace lifecycle mappings metadata which will open the lifecycle-mapping-metadata.xml file in a tab in the background. I assume that this cooresponds to the following file under your workspace subdir:
.metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml
Next add the following stanza to the bottom of the file inside of <pluginExecutions>...</pluginExecutions>.
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>enforce</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
Once the XML file is saved you will need to go back to the preferences window and press Reload workspace lifecycle mappings metadata which compiles the file somehow.
Finally you will need to do a maven update-project on all of your projects to see the warnings go away.
Hope this helps.

How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds

I am trying to work with Spring Data and Neo4j. I started by trying to follow this guide linked to by the main site. In particular I based my pom.xml off of the "Hello, World!" example file. Here is a snip from my pom.xml for the plugin that is causing the issues...
<plugin>
<!-- Required to resolve aspectj-enhanced class features -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<outxml>true</outxml>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
<aspectLibrary>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
</aspectLibrary>
</aspectLibraries>
<source>1.6</source>
<target>1.6</target>
</configuration>
<executions>
<!-- ERROR HERE IN ECLIPSE SEE BELOW FOR FULL MESSAGE -->
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
The error I am seeing is:
Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.0:compile (execution: default, phase: process-classes)
- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.0:test-compile (execution: default, phase: process-classes)
I am running Eclipse 3.6.2 and m2e 0.13. I'm not a Maven expert, so please be very explanatory in your answers if possible.
I've also tried m2e 1.0.0 via this update site and still get the same error.
In my case of a similar problem, instead of using Andrew's suggestion for the fix, it worked simply after I introduced <pluginManagement> tag to the pom.xml in question. Looks like that error is due to a missing <pluginManagement> tag. So, in order to avoid the exceptions in Eclipse, one needs to simply enclose all the plugin tags inside a <pluginManagement> tag, like so:
<build>
<pluginManagement>
<plugins>
<plugin> ... </plugin>
<plugin> ... </plugin>
....
</plugins>
</pluginManagement>
</build>
Once this structure is in place, the error goes away.
What a mess. I don't remember where I found this but I had to add the following to get M2Eclipse to be happy. Even more sad is that it isn't exactly easy to understand why this tag is needed.
<build>
... various plugins ...
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse
m2e settings only. It has no influence on the Maven build itself. -->
<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>aspectj-maven-plugin</artifactId>
<versionRange>[1.0,)</versionRange>
<goals>
<goal>test-compile</goal>
<goal>compile</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
There were a number of other issues with the M2Eclipse plug-in that simply didn't work with Spring Data. In the end I disabled M2Eclipse in favor of the Apache Eclipse plug-in.
In Eclipse Luna 4.4.0, you can chose to ignore this error in preferences
Window > Preferences > Maven > Errors/Warnings > Plugin execution not covered by lifecycle configuration. Select Ignore / Warning / Error as you wish.
Also, in the quick fix (Ctrl + 1) for this error, it gives an option to
mark goal as ignored in Eclipse build in Eclipse preferences (experimental)
This is a cleaner way, as it doesn't modify your pom.xml.
You will need to do a Maven > Update project to fix the same error in any other project as well.
In STS(Spring-tool-suite), you can choose to ignore this error in preferences
Window > Preferences > Maven > Errors/Warnings > Plugin execution not covered by life-cycle configuration. Select Ignore / Warning / Error as your wish.
Then. Right click the project click Maven and update the project then error will gone.
Suggested solution from Eclipse m2e documentation:
Use quick-fix on the error in pom.xml and select Permanently mark goal run in pom.xml as ignored in Eclipse build - this will generate the required boilerplate code for you.
To instruct Eclipse to run your plugin during build - just replace the <ignore/> tag with <execute/> tag in the generated configuration:
<action>
<execute/>
</action>
Alternatively you can instruct Eclipse to run the plugin on incremental builds as well:
<action>
<execute>
<runOnIncremental>true</runOnIncremental>
</execute >
</action>
See https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html .
To solve some long-standing issues,
m2e 1.0 requires explicit instructions
what to do with all Maven plugins
bound to "interesting" phases of
project build lifecycle. We call these
instructions "project build lifecycle
mapping" or simply "lifecycle mapping"
because they define how m2e maps
information from project pom.xml file
to Eclipse workspace project
configuration and behaviour during
Eclipse workspace build.
Project build lifecycle mapping
configuration can be specified in
project pom.xml, contributed by
Eclipse plugins and there is also
default configuration for some
commonly used Maven plugins shipped
with m2e. We call these "lifecycle
mapping metadata sources". m2e will
create error marker like below for all
plugin executions that do not have
lifecycle mapping in any of the
mapping metadata sources.
Plugin execution not covered by lifecycle configuration:
org.apache.maven.plugins:maven-antrun-plugin:1.3:run
(execution: generate-sources-input, phase: generate-sources)
m2e matches plugin
executions to actions using
combination of plugin groupId,
artifactId, version range and goal.
There are three basic actions that m2e
can be instructed to do with a plugin
execution -- ignore, execute and
delegate to a project configurator.
m2e 0.13 introduce a m2e connectors and m2e Market Place to extend m2e features.
It's like the old m2e-extras repository.
You can access the m2e market place from the preferences: Preferences>Maven>Discovery>Open Catalog.
Installing WTP integration solved most plugin issues for me.
Note that the M2Eclipse (m2e) version 1.7.0 available in today's Eclipse Neon release train supports new syntax for specifying lifecycle mapping metadata. As a result boilerplate like this (here we're telling m2e to ignore the goal):
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<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.5.0,)</versionRange>
<goals>
<goal>exec</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
can be replaced with a single line in the plugin's execution node:
<?m2e ignore?>
See the release notes for details.
Change the Maven preferences for plugin execution from error to ignore
As an addendum to the previous answers -- there's a workaround I just discovered for if you can't or don't want to add all this boilerplate to your project POM. If you look in the following location:
{Eclipse_folder}/plugins/org.eclipse.m2e.lifecyclemapping.defaults_{m2e_version}
You should find a file called lifecycle-mapping-metadata.xml where you can make the same changes described in the other answers and in M2E plugin execution not covered.
I had the same problem with Eclipse v3.7 (Indigo) and m2eclipse as my Maven plugin. The error was easily solved by explicitly stating the execution phase within the plugin definition.
So my pom looks like this:
<project>
...
<build>
...
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<timestampFormat>yyyy-MM-dd_HH-mm-ss</timestampFormat>
</configuration>
<executions>
<execution>
*<phase>post-clean</phase>*
<goals>
<goal>create-timestamp</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
...
Go to Help > Install New Software...
Use this software repository
Make sure "Contact all update sites during install to find required software" is checked.
Install the AJDT m2e Configurator
Source: Upgrading Maven integration for SpringSource Tool Suite 2.8.0 (Andrew Eisenberg)
This should automatically install ADJT if you don't have it installed, but if it doesn't, install AspectJ Development Tools (ADJT) first from "Indigo update site" (according to your Eclipse version).
More info on AspectJ Development Tools site.
Goto workspace/rtc-ws/.metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml then create lifecycle-mapping-metadata.xml file and paste below and reload configuration as below
If you are using Eclipse 4.2 and have troubles with mapping and won't put mess into yours pom.xml create new file lifecycle-mapping-metadata.xml configure it in Windows -> Preferences -> Lifecycle mapping (don't forget press Reload workspace lifecycle mappings metadata after each change of this file!). Here is example based on eclipse/plugins/org.eclipse.m2e.lifecyclemapping.defaults_1.2.0.20120903-1050.jar/lifecycle-mapping-metadata.xml
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<goals>
<goal>create-timestamp</goal>
</goals>
<versionRange>[0.0,)</versionRange>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<goals>
<goal>list</goal>
</goals>
<versionRange>[0.0,)</versionRange>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<goals>
<goal>generate</goal>
</goals>
<versionRange>[0.0,)</versionRange>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<goals>
<goal>compile</goal>
</goals>
<versionRange>[0.0,)</versionRange>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<goals>
<goal>copy-dependencies</goal>
<goal>unpack</goal>
</goals>
<versionRange>[0.0,)</versionRange>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<versionRange>[1.7,)</versionRange>
<goals>
<goal>run</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<versionRange>[2.8,)</versionRange>
<goals>
<goal>check</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
I fixed it following blog post Upgrading Maven integration for SpringSource Tool Suite 2.8.0.
Follow the advice on the section called "Uh oh…my projects no longer build". Even when it's intended for SpringSource Tool Suite I used it to fix a regular Eclipse installation. I didn't have to modify my pom files.
I've had the same problem with indigo and a project that needs to generate Java sources from XSD.
I could fix it by supplying the missing life-cycle mapping, as described on this page
This error happens also on neon because of missing m2e connector.
Solution:
hover error and select - Discover new m2e connectors.
It will install new connector and that is it.
Use m2e 0.12, last version from Sonatype.
Where find WTP:
Mouse down on < plugin > in pom.xml and 'Discover new m2e connectors'.
I installed them all what are default checked and it works.
I had the exact same problem after updating m2e and solved it by reinstalling Maven Integration for Eclipse WTP.
As it turns out, I uninstalled it trying to update m2e from version 0.x to 1.x
I was using
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>runSomeAntTasks</id>
<phase>test-compile</phase>
.
.
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
and changed it to
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>runSomeAntTasks</id>
<phase>integration-test</phase>
.
.
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
and the error went away. Maybe it's not recommended to bind an execution to the test-compile phase so finding a different phase might be an alternate solution to adding plugin-management configuration to the maven lifecycle.
I had this problem today. I was using STS 3.4 with its bundled Roo 1.2.4. Later I tried with Eclipse Kepler and Roo 1.2.5, same error.
I've changed my pom.xml adding pluginTemplates tag after build and before plugins declaration but didn't work.
What made the magic for me:
Using jdk 1.7.0_51
Downloaded Roo 1.2.5
Downloaded Maven 3.2.1 (if not, when executes "perform eclipse" this error appears "error=2, no such file or directory")
Configured JDK, Roo and Maven bin directories on my PATH:
export PATH=/opt/jdk1.7.0_51/bin:$PATH
export PATH=/opt/spring-roo-1.2.5.RELEASE/bin:$PATH
export PATH=/opt/apache-maven-3.2.1/bin:$PATH
Made my configuration as following:
(http://docs.spring.io/spring-roo/reference/html/beginning.html)
$ mkdir hello
$ cd hello
$ roo.sh
roo> project --topLevelPackage com.foo
roo> jpa setup --provider HIBERNATE --database HYPERSONIC_PERSISTENT
roo> web mvc setup
roo> perform eclipse
Open with Eclipse (nothing of STS, but I guess it works): Import -> Existing Projects into Workspace
Changing
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.2</version>
into
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.3</version>
solved the problem for me.
I encountered exact the same problem with maven thrift plugin. Here's my solution which requires no need to mess up your pom.xml:
Use command line maven utility mvn
mvn eclipse:eclipse
to create a eclipse project
Import the project in eclipse. Remember to use
File > Import > General > Existing Projects into Workspace
to add the project into your workspace.
This should fix the problem.
This answer is just as good the top plugin-management answer above (which is to say, it's terrible).
Just delete all the offending xml code in the pom.
Done. Problem solved (except you just broke your maven config...).
Devs should be very careful they understand plugin-management tags before doing any of these solutions.
Just slapping plugin-management around your plugins are random is likely to break the maven build for everyone else just to get eclipse to work.
Instead of messing up your pom file, I would suggest you to go to Show View → Markers in Eclipse, select and delete the markers of appropriate errors.
If you are using Eclipse Juno, it could be the issue of Maven Integration For Eclipse WTP . So install the same from Eclipse Market Place.
In Eclipse IDE
Help>>Eclipse Market Place >> type the query wtp and it will show maven integration for eclipse WTP for Juno, install it and update the maven dependencies and enjoy
I got the same error. After doing the following it went away.
Right click on the project.
Select Maven > Update Project...
you can suppress this error in eclipse:
Window -> Preferences -> Maven -> Error/Warnings
I encountered this using Eclipse v4.3 (Kepler) and Maven 3.1.
The solution is to use a JDK and not a JRE for your Eclipse project. Make sure to try maven clean and test from Eclipse just to download missing JAR files.
I followed the GUI hint to finding any connector, and then I found AspectJ Integrator from SpringSource Team. After installation, it was settled.
Most of the answers are about just ignoring error and other suggested solutions doesn't work in my case [for maven-compiler-plugin]. My solution to this problem:
Go .m2 local repository in your system and find org.apache.maven.plugins directory:
C:\Users\[YOUR USERNAME]\.m2\repository\org\apache\maven\plugins
Remove maven-compiler-plugin folder from this directory
You may have to close your IDE (Eclipse)
After that open the IDE again and update project by Maven
In Eclipse right-click on the project root and choose Maven -> Update project...