Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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>
like image 534
Jacob Avatar asked May 09 '13 19:05

Jacob


People also ask

How to solve Maven project build lifecycle mapping problem?

Just go to Window->Preferences->Maven->Errors/Warnings and change the warning level for the last element "Plugin execution not covered by lifecycle configuration" to either warning or ignore. What whay do you recommend to run a module when using eclipse+debugging?

What is mean by plugins in Maven?

Plugins are the central feature of Maven that allow for the reuse of common build logic across multiple projects. They do this by executing an "action" (i.e. creating a WAR file or compiling unit tests) in the context of a project's description - the Project Object Model (POM).

What is plugin management in Maven?

From Maven documentation: pluginManagement: is an element that is seen along side plugins. Plugin Management contains plugin elements in much the same way, except that rather than configuring plugin information for this particular project build, it is intended to configure project builds that inherit from this one.


1 Answers

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.

like image 133
rec Avatar answered Sep 21 '22 17:09

rec