How to solve “Plugin execution not covered by life

2018-12-31 02:17发布

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.

30条回答
残风、尘缘若梦
2楼-- · 2018-12-31 02:53

I had this problem today. I was using STS 3.4 with its bundled Roo 1.2.4. Later I tried with Eclipse Kepler and Roo 1.2.5, same error.

I've changed my pom.xml adding pluginTemplates tag after build and before plugins declaration but didn't work.

What made the magic for me:

  • Using jdk 1.7.0_51
  • Downloaded Roo 1.2.5
  • Downloaded Maven 3.2.1 (if not, when executes "perform eclipse" this error appears "error=2, no such file or directory")
  • Configured JDK, Roo and Maven bin directories on my PATH:

    export PATH=/opt/jdk1.7.0_51/bin:$PATH export PATH=/opt/spring-roo-1.2.5.RELEASE/bin:$PATH export PATH=/opt/apache-maven-3.2.1/bin:$PATH

Made my configuration as following: (http://docs.spring.io/spring-roo/reference/html/beginning.html)

$ mkdir hello 
$ cd hello
$ roo.sh
roo> project --topLevelPackage com.foo
roo> jpa setup --provider HIBERNATE --database HYPERSONIC_PERSISTENT 
roo> web mvc setup
roo> perform eclipse

Open with Eclipse (nothing of STS, but I guess it works): Import -> Existing Projects into Workspace

查看更多
骚的不知所云
3楼-- · 2018-12-31 02:53

I got the same error. After doing the following it went away.

  1. Right click on the project.
  2. Select Maven > Update Project...
查看更多
怪性笑人.
4楼-- · 2018-12-31 02:54

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.

查看更多
听够珍惜
5楼-- · 2018-12-31 02:54

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.

查看更多
高级女魔头
6楼-- · 2018-12-31 02:56
  1. Go to Help > Install New Software...
  2. Use this software repository

    Make sure "Contact all update sites during install to find required software" is checked.

  3. Install the AJDT m2e Configurator

Source: Upgrading Maven integration for SpringSource Tool Suite 2.8.0 (Andrew Eisenberg)

This should automatically install ADJT if you don't have it installed, but if it doesn't, install AspectJ Development Tools (ADJT) first from "Indigo update site" (according to your Eclipse version).

More info on AspectJ Development Tools site.

查看更多
若你有天会懂
7楼-- · 2018-12-31 02:56

This answer is just as good the top plugin-management answer above (which is to say, it's terrible).

Just delete all the offending xml code in the pom.

Done. Problem solved (except you just broke your maven config...).

Devs should be very careful they understand plugin-management tags before doing any of these solutions. Just slapping plugin-management around your plugins are random is likely to break the maven build for everyone else just to get eclipse to work.

查看更多
登录 后发表回答