Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
450 views
in Technique[技术] by (71.8m points)

eclipse - 如何解决Spring Data Maven构建的“生命周期配置未涵盖的插件执行”(How to solve “Plugin execution not covered by lifecycle configuration” for Spring Data Maven Builds)

I am trying to work with Spring Data and Neo4j .

(我正在尝试使用Spring Data和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!"

(特别是,我的pom.xml基于“ Hello,World!”。)

example file .

(示例文件 。)

Here is a snip from my pom.xml for the plugin that is causing the issues...

(这是导致问题的插件的pom.xml中的一个片段...)

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

(我正在运行Eclipse 3.6.2和m2e 0.13。)

I'm not a Maven expert, so please be very explanatory in your answers if possible.

(我不是Maven专家,所以请尽可能在回答中多加解释。)

I've also tried m2e 1.0.0 via this update site and still get the same error.

(我还通过此更新站点尝试了m2e 1.0.0 ,仍然遇到相同的错误。)

  ask by Andrew White translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

(在我遇到类似问题的情况下,仅在将<pluginManagement>标记引入到有问题的pom.xml中之后,它才起作用,而不是使用Andrew的建议。)

Looks like that error is due to a missing <pluginManagement> tag.

(看起来该错误是由于缺少<pluginManagement>标记引起的。)

So, in order to avoid the exceptions in Eclipse, one needs to simply enclose all the plugin tags inside a <pluginManagement> tag, like so:

(因此,为了避免Eclipse中的异常,需要将所有插件标签简单地封装在<pluginManagement>标签内,如下所示:)

<build>
    <pluginManagement>
        <plugins>
            <plugin> ... </plugin>
            <plugin> ... </plugin>
                  ....
        </plugins>
    </pluginManagement>
</build>

Once this structure is in place, the error goes away.

(一旦建立了这种结构,错误就会消失。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...