異常處理:Eclipse下解決Plugin execution not covered by lifecycle configuration異常 .

在把selenium的源碼在myeclipse2013中構建時,pom.xml文件報錯


Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:properties-maven-plugin:1.0-alpha-1:write-project-properties (execution: default, phase:  generate-resources)


原因是eclipse的m2e插件還沒有支持到execution:http://wiki.eclipse.org/M2E_plugin_execution_not_covered


解決辦法如下:

在<build> 和 <plugins> 直接加入 <pluginManagement>


例如:之前的代碼如下


 <build>
        <plugins>
            <!-- See http://maven.apache.org/plugins/maven-antrun-plugin -->
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy_java_files</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <tasks>
                                <delete dir="src/main/java" />
                            。。。。。

                        </configuration>
                    </plugin>
               </plugins>
   </build>

 修改後的代碼就是:

<build>
    <pluginManagement>
        <plugins>
            <!-- See http://maven.apache.org/plugins/maven-antrun-plugin -->
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy_java_files</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <tasks>
                                <delete dir="src/main/java" />
                            

     。。。。。

                        </configuration>
                    </plugin>
               </plugins>
   </build>




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章