如何解决Spring Data Maven构建的“生命周期配置未涵盖的插件执行”

我正在尝试使用Spring Data和Neo4j 。 我首先尝试遵循主站点链接的本指南 。 特别是,我的pom.xml基于“ Hello,World!”。 示例文件 。 这是导致问题的插件的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 ,仍然遇到相同的错误。


#1楼

我在用

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
    <execution>
        <id>runSomeAntTasks</id>
        <phase>test-compile</phase>
        .
        .
        <goals>
            <goal>run</goal>
        </goals>
    </execution>
</executions>

并将其更改为

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
    <id>runSomeAntTasks</id>
    <phase>integration-test</phase>
        .
        .

        <goals>
            <goal>run</goal>
        </goals>
    </execution>
</executions>

错误消失了。 也许不建议将执行绑定到test-compile阶段,因此找到不同的阶段可能是将插件管理配置添加到maven生命周期的替代解决方案。


#2楼

作为先前答案的附录,我发现了一个变通办法,即您是否可以将所有这些样板添加到项目POM中。 如果您在以下位置查看:

{Eclipse_folder}/plugins/org.eclipse.m2e.lifecyclemapping.defaults_{m2e_version}
</
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值