eclipse - 如何解决 Spring Data Maven 构建的 "Plugin execution not covered by lifecycle configuration"

标签 eclipse maven spring-data m2eclipse

我正在尝试与 Spring Data and Neo4j 合作。我首先尝试关注 this guide由主站点链接。特别是我的 pom.xml 基于 "Hello, World!" example file 。这是我的 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>

我看到的错误是:

 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 专家,因此如果可能的话,请在您的答案中提供详细的解释。

我也尝试过m2e 1.0.0通过 this update site仍然得到同样的错误。

最佳答案

在我遇到类似问题的情况下,我没有使用 Andrew 的建议进行修复,而是在我将 标记引入到相关的 pom.xml 中后,它就起作用了。看起来该错误是由于缺少 标签造成的。因此,为了避免 Eclipse 中出现异常,只需将所有插件标签包含在 标签内,如下所示:

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

一旦该结构就位,错误就会消失。

关于eclipse - 如何解决 Spring Data Maven 构建的 "Plugin execution not covered by lifecycle configuration",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6352208/

相关文章:

java - tomcat把web应用使用的txt文件存放在哪里

java - 如何引用资源包?

java - 记录测试结果

Maven 项目依赖项 "could not find artifact"

spring - Spring Data JPA中@Modifying方法的返回值是什么意思

java - Android模拟器无法加载应用程序

windows - 在 Eclipse(或一般的 Windows GUI 宏工具)中是否有加速重复提交的热键?

java - 从 Maven 中的 Android 库 jar 中排除 BuildConfig.class 和 R.class

database - Spring 数据 : CrudRepository's save method and update

java - Spring Data Mongodb 存储库未正确实现继承