如何解决“生命周期配置未涵盖的插件执行"用于 Spring Data Maven 构建 [英] How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds

查看:31
本文介绍了如何解决“生命周期配置未涵盖的插件执行"用于 Spring Data Maven 构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Spring Data 和 Neo4j.我首先尝试遵循主站点链接的本指南.特别是我基于我的 pom.xml 关闭了 你好,世界!"示例文件.这是从我的 pom.xml 中截取的导致问题的插件...

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>

我看到的错误是:

 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)

我正在运行 Eclipse 3.6.2 和 m2e 0.13.我不是 Maven 专家,所以如果可能的话,请在你的回答中解释清楚.

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.

推荐答案

真是一团糟.我不记得我在哪里找到的,但我必须添加以下内容才能让 M2Eclipse 满意.更可悲的是,要理解为什么需要这个标签并不容易.

What a mess. I don't remember where I found this but I had to add the following to get M2Eclipse to be happy. Even more sad is that it isn't exactly easy to understand why this tag is needed.

<build>
      ... various plugins ...

      <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.codehaus.mojo</groupId>
                                    <artifactId>aspectj-maven-plugin</artifactId>
                                    <versionRange>[1.0,)</versionRange>
                                    <goals>
                                        <goal>test-compile</goal>
                                        <goal>compile</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

M2Eclipse 插件存在许多其他问题,这些问题根本无法与 Spring Data 一起使用.最后我禁用了 M2Eclipse,转而使用 Apache Eclipse 插件.

There were a number of other issues with the M2Eclipse plug-in that simply didn't work with Spring Data. In the end I disabled M2Eclipse in favor of the Apache Eclipse plug-in.

这篇关于如何解决“生命周期配置未涵盖的插件执行"用于 Spring Data Maven 构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆