maven


Plugin execution not covered by lifecycle configuration error in Eclipse Juno


Why does my Maven build work perfectly fine on the command line but when I run in Eclipse, it requires I add this section to my pom.xml, otherwise I get this error:
Plugin execution not covered by lifecycle configuration
: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
(execution: default-testCompile, phase: test-compile)
Isn't it strange that this occurs around the 'maven-compiler-plugin' plugin?? I cannot find another question like this anywhere on google, although I find many fix suggestions around 3rd party plugins. I've done a great deal of researching and searching and found no explanation of this, not even from here.
And the pom.xml required to fix this:
<!--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-compiler-plugin</artifactId>
<versionRange>[3.1,)</versionRange>
<goals>
<goal>testCompile</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
And , here is my simple project on GitHub if you want to see my source.
I finally solved it. It appears that the "pluginManagement" section I posted above is required by an Eclipse Maven project in general, even though I resisted it, and even though no documentation that I can find on the internet ever mentions this explicitly.
ALso, the "versionRange" in the lifecycle exclusion section seems to also require the version number of the "gmaven-plugin" rather than the "version of Maven" which I was trying to give it above.
<pluginExecutionFilter>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<versionRange>[1.5,)</versionRange>
<goals>
<goal>testCompile</goal>
<goal>compile</goal>
</goals>
</pluginExecutionFilter>
You may require an M2E "connector" to understand maven-compiler-plugin using the Eclipse (JDT) compiler.
Select "discover connectors" and choose M2E connector for Eclipse JDT compiler provided by JBoss, or install it manually.
M2E connector for the Eclipse JDT Compiler 1.0.1.201209200903
You may also be offered a Groovy connector -- maybe it uses similar technology under the hood? -- but unless you are using Groovy, it probably does not make sense to install such integration.
Help -> Install new Software
Install the Groovy Compiler 2.2 / 2.1 Feature
Install Groovy-Eclipse M2E integration
Window -> Preferences -> Maven -> Lifecycle Mappings -> Open workspace lifecycle mappings metadata
Add the following xml:
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<versionRange>[1.3,)</versionRange>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
Reload the Lifecycle Mappings and invoke a projekt update on your maven project. (ALT+F5)

Related Links

How to display dependency updates only for release versions
How can I find artifact upload panel in NEXUS 3.0 version?
What do the configuration lines at verbose output of Maven represent?
Installing node once only and not each time with Maven build
Avoiding maven repository version collision when using feature branches
Maven + OSGi bundle build complication
How can we rename GWT nocache.js?
Why is a simple Weld SE 1.1, JUnit, Maven unittest no longer working
Deploying snapshots always fails but deploying releases works fine
Which settings are needed to make use of EL 3 in a JavaEE environment?
How to read values from .properties using maven plugin
Unable to install Ubik load pack using Maven
IntelliJ Maven Module Cannot resolve dependencies
Adding JPA support to an existing Maven project in IntelliJ
Specify which jar wins when conflicts in Maven Shade
JGitFlow maven plugin release-start from custom branch

Categories

HOME
isabelle
tinymce
iot
sd-card
cvs
sharepoint-designer
ckeditor
ebean
fingerprint
fancybox
ios-charts
synchronization
kibana-4
windows-10-universal
node-pdfkit
quicklook
google-cloud-spanner
task
telephony
progressive-web-apps
google-static-maps
http-status-code-504
undefined
database-replication
interop
excel-vba-mac
contextmenu
custom-wordpress-pages
errorlevel
sox
telerik-reporting
zurb-foundation-6
autosys
firebase-crash-reporting
intel-pin
applozic
neo4j-spatial
nat
socialengine
react-chartjs
google-qpx-express-api
calibre
typed.js
hybridauth
sequential
temporary-files
elasticsearch-plugin
cookiecutter-django
ensembles
reportingservices-2005
powershell-dsc
google-closure
turbogears
checkboxlist
scorm
osx-mavericks
theming
sage-one
togetherjs
tropo
android-cursor
windows-mobile-6.5
pearson
iso8601
spring-cache
color-profile
setuptools
radtreelist
transmitfile
mathematica-frontend
hexdump
pervasive-sql
mutation-observers
content-length
jqgrid-formatter
sframe
dundas
geonetwork
nsmutabledictionary
wp-query
message-driven-bean
sitemesh
runtime.exec
dataadapter
padarn
isnullorempty
gdata-api
objective-c-2.0
windows-phone-7.1.1
buildr
pendrive
gwt-ext
deobfuscation
celltable
dbal
perfect-hash
nintendo-ds
microsoft-virtualization
exchange-server-2003
signal-handling

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App