Spring Data Maven ビルドの「プラグイン実行がライフサイクル構成でカバーされていない」を解決する方法 質問する

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

同様の問題があった私のケースでは、Andrew の提案に従って修正する代わりに、問題の pom.xml に<pluginManagement>タグを導入するだけで問題が解決しました。このエラーは、<pluginManagement> タグが欠落していることが原因であるようです。したがって、Eclipse で例外を回避するには、次のように、すべてのプラグイン タグを<pluginManagement>タグで囲む必要があります。

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

この構造が確立されると、エラーはなくなります。

おすすめ記事