3

I get an error in my pom.xml, saying:

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.4:add-source (execution: add-generated-sources, phase: process-sources)

Here is an extract of my pom.xml:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <executions>
      <execution>
        <id>add-generated-sources</id>
        <phase>process-sources</phase>
        <goals>
          <goal>add-source</goal>
        </goals>
        <configuration>
          <sources>
            <source>${project.build.directory}/generated-sources/entitygenerator</source>
            <source>${basedir}/src/main/groovy</source>
          </sources>
        </configuration>
      </execution>
    </executions>
</plugin>

The error is on the <execution> tag.

Now, I'm struggling to find the need Eclipse plugin, but somehow, I'm not able to find it. Can you help?

I'm using Eclipse Indigo and Maven 3.0.3, with a JDK 1.6_22, on a Windows XP SP3.

Alexis Dufrenoy
  • 11,784
  • 12
  • 82
  • 124
  • 1
    possible duplicate of [How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds](http://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin) – Sean Patrick Floyd Feb 13 '12 at 17:01

2 Answers2

5

Select the message in the problem view and press Ctrl+1 (or select "Quick fix" from the context menu).

That will give you the option to ignore this plugin. Select this and m2e will add some XML to your POM and the error will be gone.

The plugin will still work if you call it explicitly!

See M2E plugin execution not covered for details.

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • The problem is: I need this plugin in order to navigate to the classes generated by the Groovy-based DSL. What you propose is a workaround, not a solution. – Alexis Dufrenoy Feb 13 '12 at 19:59
  • You completely misunderstand: The quick fix just makes m2e ignore the error; the plugin still works. As I understand it, the error means that m2e has no idea what to do with the plugin. Since it might be essential for the build inside of Eclipse, you get an error. The quick fix says: "Stop bothering me" – Aaron Digulla Feb 14 '12 at 08:09
  • Do you mean taht the plugin not working with m2e doesn't necessarily means it doesn't work with Maven? Thank you, I'll give it a try... – Alexis Dufrenoy Feb 14 '12 at 08:50
  • 1
    There are two different "works" here. One is the automatic code compile which runs in the background. Some Maven plugins (like the resource plugin) need to be called when this happens but others (like the surefire plugin) must not. Your case is a corner case. The code generation *should* run but it would probably make Eclipse very slow. So you need to tell m2e how to handle the situation: Ignore the plugin or add it to the build. See http://wiki.eclipse.org/M2E_plugin_execution_not_covered – Aaron Digulla Feb 14 '12 at 09:14
2

It seems like build-helper m2e connector fixes the issue: build-helper-maven-plugin

Efthymis
  • 1,326
  • 11
  • 13
Flavio Garcia
  • 1,491
  • 1
  • 14
  • 20