17

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?

Jeroen
  • 60,696
  • 40
  • 206
  • 339
Ayyoudy
  • 3,641
  • 11
  • 47
  • 65

3 Answers3

30

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....

Community
  • 1
  • 1
FrVaBe
  • 47,963
  • 16
  • 124
  • 157
  • @FrVaBe does the second eclipse quickfix for this (Permamnently mark goal add-classes in pom.xml as ignored in eclipse build). can affect my web application execution?? – Amira Manai Jul 12 '12 at 14:18
  • @Amira Manai It should not affect the execution as it has no influence on the maven build. – FrVaBe Jul 12 '12 at 15:34
  • As far as I can see in my tests, that approach is directly omitting maven-warpath-plugin from the Maven build, isn't it? I mean, I expect to receive a `warpath` artifact as a dependency in my main war, which it can't be identified. – Aritz Feb 06 '13 at 10:26
  • @Xtreme Biker I am not sure what you mean by "omitting maven-warpath-plugin" - The pluginManagement section has no influence on the build - it just eliminates the eclipse error message. I do not know if there is a connector available yet for the maven-warpath-plugin. This would make this section unnecessary. – FrVaBe Feb 18 '13 at 07:23
2

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

Community
  • 1
  • 1
leef
  • 593
  • 8
  • 12
0

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!

anhlt
  • 1