How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds
Solution 1
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.
Solution 2
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.
Solution 3
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.
Solution 4
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>
Solution 5
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.
Andrew White
Updated on September 25, 2021Comments
-
Andrew White almost 3 years
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.
-
Nathan Feger about 13 yearsWhat plugin repository hosts the org.eclipse.m2e:lifecycle-mapping plugin?
-
Andrew White about 13 yearsThat is an explanation of the problem, not a solution at least not one that I can take and work with.
-
Thomas Broyer about 13 yearsYou gave the answer yourself, and it can be found on the page I linked to. If find it more important to understand what an error means (and then easily find how to fix it) than to blindly copy/paste some snippets. "Science without conscience is but the ruin of the soul." (François Rabelais)
-
Andrew White about 13 yearshmm, that wiki page has been updating since I posted my answer and also since I last read it.
-
Ed Staub almost 13 yearsI don't see "WTP integration" in the list. Are you using some non-default catalog?
-
noirbizarre almost 13 yearsI'm using the default catalog but you're right: I don't see it anymore.
-
prusswan almost 13 yearscommunity.jboss.org/en/tools/blog/2011/06/23/…. See update 2, anyway +1 for big mess
-
mkraemerx almost 13 yearsIf your eclipse can´t find org.eclipse.m2e:lifecycle-mapping plugin it´s because you put the snippet above in the wrong plugin list in the pom, it has to go under pluginManagement
-
Bert F almost 13 yearsFYI: If a custom plugin was specified in a profile, then I had to setup the lifecycle mapping in the same profile. Specifying it "in general" in build/pluginManagement outside of the profile that contained the plug-in did not resolve the error. Configuring the same information in the profile/build/pluginManagement did.
-
Brad Cupit almost 13 yearsnote: m2e 1.x can do this automatically as a Quick Fix from the Problems view
-
Donal Fellows over 12 years@Brad: The problem with the Quick Fix is that this modifies the project files that are necessarily part of the project in the repository.
-
Chepech over 12 yearsThe last resource it to revert to an older version of m2e or the IDE you use.
-
stivlo over 12 yearsas of Nov 2011, m2e wtp can be found in Eclipse Marketplace
-
Admin over 12 yearsIt works, add update site from this url: download.jboss.org/jbosstools/updates/m2eclipse-wtp
-
Nei over 12 yearsSorry, but I agree with Andrew, use this plugin is far more complicated then it should be. I was starting a new application and first i though the problem was my pow file, just when I try a pow that I know it should work, I saw that this problem was caused by m2e. Sorry guys, but I think a good pow file should just Work. Nobody knows everything about everything, i just want to use this plugin dont want know how it works.
-
Mahmoud Saleh over 12 yearsi tried that but i got the error:
Missing requirement: Maven Integration for AJDT (Optional) 0.13.0.201107281640 (org.maven.ide.eclipse.ajdt.feature.feature.group 0.13.0.201107281640) requires 'org.eclipse.ajdt.feature.group 1.5.0' but it could not be found
-
Brill Pappin over 12 yearsI have to agree that this has gone the opposite way of the Maven manifesto (so to speak). It makes a simple thing so complex that even reading all about it, I can't get it to work half the time. I would much, much rather have to deal with some maven idiosyncrasy than deal with plugins not binding to lifecycle phases when they are supposed to. If this is an interim solution, then fine... but get it fixed because it's broken now.
-
Brill Pappin over 12 yearsApparently this particular problem is actually a plugin problem. See: wiki.eclipse.org/M2E_compatible_maven_plugins Try updating the plugin version. However, I have to say that maven should not be crapping out this easily for the legacy plugins... possibly printing a huge warning, but not crapping out.
-
laher over 12 yearsThanks: m2e offered me a 'quickfix' for a plugin it didn't recognise, which generated all the above except with <ignore /> instead of <execute />. It didn't offer the <execute /> option, which works! Maddening!
-
Marvo over 12 yearsJust want to add that I was a little confused as to where this hunk of magic goes. In my case, because I was trying to get rid of Hibernate schema and Java code generation plugin errors, I had to add this to the <build> section where I added those Hibernate plugins.
-
Hendy Irawan over 12 yearsMsaleh, try my revised answer
-
jjohn over 12 yearsYes, <pluginmanagement> stuff goes under <build>. You would think the m2 page would mention this trifle.
-
Christopher Klewes over 12 yearsNow it's getting executed but leads to an error "
Execution default of goal my.maven.plugin failed
", but if I use it from the console it works great. Is there any way to get a stacktrace out of this? I can't figure out what happens since it only procudes this error in the "Problem" view. -
Eric Freese over 11 yearsThis worked for me. My pom.xml was generated by Spring Roo and was missing the pluginManagement tag. Looks like this might be a Roo issue in some cases...
-
RMorrisey over 11 yearsI was very miffed that the spring-mvc-showcase project did not work out-of-the-box when downloaded via STS; but, this fixed my issue. Thanks.
-
Markus Schulte over 11 yearsYou might have found this solution on wiki.eclipse.org/M2E_plugin_execution_not_covered.
-
Stijn de Witt over 11 yearsIt's not Maven that's crapping out. Builds from the command line work. It's the m2eclipse plugin (built by the Eclipse folk) that is spewing out the error. I think the problem is that Maven has a different build lifecycle than Eclipse so they need you to make an explicit mapping. That's a great shame as it means you can apparently never use POM's as they are. You always have to add this mapping....
-
juckele about 11 yearsWorks for me too, but can anyone explain why?
-
SJuan76 about 11 yearsYes it is a mess. Fortunately, with Eclipse Juno and m2e 1.3 I can open the
pom.xml
in Eclipse, left-click in the offendingexecution
tag (duly marked in red) and a contextual menu offers me to add theignore
Eclipse markup. -
GreenGiant about 11 years@Andrew I think this works because m2e is not looking for plugins in
pluginManagement
, but only inbuild/plugins
. In the Maven world, there is a difference between the two - the former defines "if you happen to use this plugin, here's the configuration to use", whereas the latter states "use this plugin". See this post and its top two answers. -
Harry Cutts almost 11 yearsIt might be worth mentioning that this tag is needed in addition to the
<plugins>
tag. As a Maven newbie I spent an afternoon wondering why my plugins weren't running after applying this fix. (Or I might be misunderstanding, correct me if I'm wrong.) -
Stanley almost 11 yearsRead this to understand more about the configuration in your answer: wiki.eclipse.org/M2E_plugin_execution_not_covered
-
matbrgz almost 11 years"Discovery" is not present in Eclipse 4.3 Kepler.
-
Pierre almost 11 yearsI agree with @GreenGiant. I tried this solution but it then breaks the compilation since the aspectj plugin is not called before compilation.
-
Matthias Wuttke almost 11 yearsWorked fine with Spring Roo / STS, switched project to Eclipse Kepler, did not work there, adding this tag made it work - thanks!
-
demaniak over 10 yearssigh this did NOT work for me (running Kepler, with maven 3.1.1). On the upside, the project builds fine with a Maven build configuration. So I guess I have that going for me.
-
Iain over 10 yearsGrrr, I hate having to pick between two evils. Adding scores of lines of garbage to pom = bad. Your way = also bad, because it keeps reappearing (every time you save the pom) and I have to tell everyone that this is ok.
-
izilotti about 10 yearsThis will help you get rid of the error, but if you are using AOP you might be actually needing to install these plugins: AJDT and/or AJDT Configurator.
-
gammay almost 10 yearsI use this for eclipselink static weaving. If we add
pluginManagement
weaving step is not executed. I had upvoted this answer long ago as this had solved another problem of mine, but now i think this is not the right solution (cannot change the upvote as it is locked now). I used "ignore this error" option in eclipse - weaving still happens from command-line maven build. -
Matthias B almost 10 yearsAlso you can add
<runOnIncremental>false|true</runOnIncremental>
inside the execute tag, to make eclipse call this maven plugin on incremental builds. -
Andrew White almost 10 years@JBCP it was but I changed it since the higher voted answer also worked and appeared to fit better into the maven philosophy
-
JBCP almost 10 years@AndrewWhite - moving the definition to pluginManagement just hides the execution of the plugin from the current module. Configuring the lifecycle-mapping plugin tells Eclipse how and when to actually run the plugin. Unless you have other modules that depend on the module in question, moving the definition to pluginManagement is the same as deleting it entirely: maven.apache.org/pom.html#Plugin_Management
-
Nufail over 9 yearsYou can also edit the
WORKSPACE/.metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml
file instead of fiddling with the jars. More details can be found underPreferences > Maven > Lifecycle Mappings
. Also if you select the quick-fix"Mark goal xxxxx as ignored in Eclipse build in Eclipse preferences (experimental)"
it would add all the required changes to the above file. -
JBCP over 9 years@AndrewWhite - thanks for changing it back. The higher voted answer is incorrect and misleading.
-
Valerio Schiavoni over 9 yearsThis solution worked for me as well, but it was not necessary to execute step 2) of the proposed workaround.
-
Raphael Bossek over 9 yearsI got the same issue with Eclipse 4.4.SR1 Luna while importing a maven project. The only fix was installing Maven Integration for Eclipse (Luna and newer) 1.5 (marketplace.eclipse.org/content/…) and re-import he project again.
-
mrod over 9 yearsIf you don't mark them as "execute", the eclipse build won't run those plugin executions, but it might work as well.
-
nephewtom over 9 yearsNot valid for me. Fixes the error in Eclipse, but breaks the generation of WS code with <goal> wsimport using jaxws-maven-plugin. "Permanently mark goal wsimport in pom.xml as ignored in Eclipse build" seems to add more stuff in pom.xml and fixes it for m2e.
-
Vedran about 9 yearsI guess whomever down-voted you did so because your answer doesn't provide any tangible solution to the problem.
-
St.Antario over 8 yearsInteresting. So, am I right in thinking that we should not be modifying
pom
, but do it on theEclipse
level (e.g. add customlifecycle-metadata-mapping.xml
). In case of someone usesItelliJIdea
, they probably don't want to seem2e
-specific plugin declaration inpom
.... -
St.Antario over 8 yearsIs it really good to delcare m2e-specific things in
pom
? It's useless forIntelliJIdea
users, isn't? -
Thomas Broyer over 8 yearsFrom the link: “If you have multiple Eclipse workspaces and/or work in a team, it is easy to get workspace-level configuration out-of-sync. This is unlikely to cause any confusion for
<ignore />
mappings, but for<execute />
and<configurator />
mappings configuration inpom.xml
or maven-plugin is strongly recommended.” – so yes and no. Ideally, plugins should provide their ownlifecycle-mapping-metadata.xml
(or an Eclipse configurator, as an Eclipse plugin) so that as a user you don't have anything to configure. -
Brian Reinhold over 8 yearsTry and understand all the jargon pointed to by Thomas Broyer's link. Gees, you have to be an Eclipse plug-in expert.I wouldn't know where to begin.
-
Michael Haefele about 8 yearsErrrr... It looks like that only works because it turns off all the plugins in question..... Taking them out entirely would also work, but I'm assuming they're in there for a reason? Devs should make sure they absolutely understand what they are doing with maven before using this "fix".
-
Vortex almost 8 yearsReading and struggling w/ this lifecycle nonsense, I thought that either Eclipse should be smarter or Maven is not designed with IDEs in mind. Thomas Broyer provided a good under the hood explanation but do I really want to become an expert in Maven to run the damn thing?
-
nwinkler almost 8 yearsThis is clearly the wrong solution, as it simply disables all plugins. Plugins listed under
pluginManagement
are no longer executed, they are simply there to provide configuration in case the plugin is used. Please don't use this fix, as it will simply create new problems for you... -
lastmannorth over 7 yearsI believe this works with multi-module projects in which the plugins are managed by the parent pom. In single module projects this might cause issues. I'm not sure but I assume that is why it works for some people.
-
omni over 7 yearsJust in case you have a multi-module project: in my case I was calling the plugin execution from the parent but not all child modules were using the plugin. Thus I had to enclose the
<plugin><executions></executions></plugin>
of the parent in<pluginManagement></pluginManagement>
and I did not have to change anything in the child modules. -
Blessed Geek over 6 yearsOf course the IDE build cycles cannot be the same as for batch built.Of course you NEED to understand maven basics to use maven. Of course you need to understand maven because horrid people like me keep configuring our projects with maven. Of course you need to understand the very basic info Thomas Broyer is expressing. And finally - OF COURSE you need to understand the problem first before the solution !! Duurh !.
-
PhoneixS over 6 yearsNote that you can also add it globally to Eclipse with
Permanently mark goal run in eclipse preferences
and change <ignore> to <execute> in Eclipse preferences > Maven > Lifecycle Mappings > Open workspace lifecycle mappings metadata. -
Lucas over 6 yearsBe careful with this solution. Like others comments fixes errors in Eclipse, but it disables plugins like "maven-antrun-plugin" and "grails-maven-plugin". I choosed this solution because it has a lot of positive votes, so I didn't read the warnings in the comments. Now, I cannot vote down.
-
coderplus about 6 yearsthis answer has some details on why this is needed
-
Alz about 6 yearsI had the same issue as the original poster, Mr. White with his org.codehaus errors, while importing the spring-mvc-showcase into Eclipse Oxygen today. Quick Fix alone did the trick, no manual editing of any kind, and it pulled AspectJ and AJDT just fine on its own to resolve the error.
-
PMorganCA about 6 yearsI like this solution because you don`t have to mess with the POM (which we use in JBoss Dev Studio (Eclipse), command line and CI in the cloud. The only difference I can add (my error was showing for the toolchains plugin) is that the wording for my Quick Fix was "Mark goal toolchain as ignored in eclipse preferences"
-
user3804769 almost 6 yearsThank you, this is the actual solution. Adding the <pluginManagement> tag only disables the plugin.
-
Nick Straguzzi almost 6 yearsReally strongly recommend that this be the new accepted answer. Many other solutions will stop Maven from executing the plugin entirely during the specified build step, which is rarely what the user wants. This is usually a configuration issue, not an actual error. The Eclipse default ought to be Warning, not Error.
-
GeraldScott over 5 yearsAdding <pluginManagement> broke Maven builds on the commandline. In the end, I marked the goal as ignored in Eclipse build, thanks @nephewtom
-
n4feng about 5 yearsFor me even though this solution stopped eclipse from complaining, it still broke during the compilation time. I believe the answer that suggesst configuring this plugin with m2e is more deserved to show on top, since I tried that and everything works after that, my plugin will run every time when I call Maven update.
-
Buurman about 5 yearsNote everyone saying this disabled all plugins: If you simply enclose all plugins by <pluginManagement> then yes, you effectively turn most plugins off since you're only configuring them, not actually calling them. You need a separate <plugins>...</plugins> under build with a <plugin><groupId>...</groupId><artifactId>...</artifactId></plugin> for each plugin you want to run (without any config, since you put the config in the pluginmgmt). This makes sure the plugin is actually called during the build.
-
nimo23 over 4 yearsThis is not a solution. It only ignores the error by not showing it anymore. The only solution is to install the missing plugin.
-
Ajay Kumar over 4 yearsPerfect. Worked for me flawlessly. Thanks for sharing.
-
funder7 about 4 yearsI used it too in eclipse 2020-03, I'm not sure why the error came out this time when I imported the project, I did it before at least 4 times on other computers without any problem. I'm new to eclipse I have to say that, i'm still understanding how it build things, which of them, and when :-D
-
Igor Vuković about 4 yearsThis is the right answer. Thanks. I'am using Red Hat CodeReady Studio which is Eclipse based tool.
-
mbmast about 4 yearsHow is this a fix? Instead of Eclipse complaining that it's not generating my source code (by flagging a line in POM.XML with a red X and the error message "Plugin execution not covered by lifecycle configuration"), with this change Eclipse just silently doesn't generate my source code.
-
Alex Byrth about 4 yearsThis just DISABLES the plugin!!
-
Raedwald over 3 yearsThe central Maven repository no longer seems to have that plugin: search.maven.org/search?q=lifecycle-mapping
-
Komal over 3 yearsNot valid one...It remove error from eclipse only...My avro plugin not working after adding this pluginmanagement....after removing pluginmanagement,It only show error in eclipse but pom working fine....
-
AJPerez about 3 years@AndrewWhite could you mark this as the accepted answer? I know it's an old question, but extremely visited. This answer solves the problem, while the accepted one doesn't (it only hides it by actually removing the plugin...).
-
JanM almost 3 yearsBy far the best and cleanest answer to this problem. To anyone wondering how it works: it utilizes the xml processing instructions feature. w3.org/TR/xml/#sec-pi
-
JanM almost 3 yearsCheck David's answer which utilizes the <?m2e ..?> "New syntax for specifying lifecycle mapping metadata" feature of M2Eclipse plugin. That is the way!
-
D-Klotz over 2 yearsThis worked for me as well. Took about 15 minutes but after installing the extension, my builds no longer have this lifecycle error.
-
PAA over 2 yearsIt did not work for me.