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/33390377/

相关文章:

java - 如何打包jar文件在jar文件中包含类

eclipse - LibGDX 双 Assets 设置、Eclipse、Gradle

java - 如何在Spring/Spring Boot pom.xml中指定Java版本?

java - 如何在play框架中使用多个实体管理器-使用spring data JPA?

hibernate - JPA 2.0/Hibernate - 为什么 hibernate 在删除之前发出选择计数 (*) 查询

java - Spring中如何在一个事务方法中管理多个事务?

eclipse - 安装了 WTP,但 Web -> 动态 Web 项目没有出现

eclipse - 找不到扩展点的架构

java - 使用 Maven 构建具有非模块化依赖项的 JDK 9 项目需要什么

Maven 和 Ant 无法运行 Java - CreateProcess error=206,文件名或扩展名太长