首页 > 导入maven项目报错

导入maven项目报错

导入maven项目到eclipse出现下面报错:

Plugin execution not covered by lifecycle configuration:
 org.codehaus.mojo:aspectj-maven-plugin:1.2:compile 
(execution: default, phase: process-sources)

pox.xml文件有报错。

                <dependency>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjtools</artifactId>
                    <version>${org.aspectj-version}</version>
                </dependency>
            </dependencies>
            <executions><!--此处有报错-->
                <execution>
                    <goals>
                        <goal>compile</goal>
                        <goal>test-compile</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <outxml>true</outxml>
                <source>${java-version}</source>
                <target>${java-version}</target>
            </configuration>

你没有将插件的goal绑定到maven的生命周期啊, 正常情况要加id和phase 就像下边一样。

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
                <execution>
                    <id>attach-source</id>
                    <phase>package</phase><!-- 要绑定到的生命周期的阶段 -->
                    <goals>
                        <goal>jar-no-fork</goal><!-- 要绑定的插件的目标 -->
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
    ……
</build>
【热门文章】
【热门文章】