zoukankan      html  css  js  c++  java
  • maven项目-修复Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.8:add-resource (execution: add-resource, phase: generate-resources) pom.xml报错

    1:pom.xml代码

       <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.8</version>
                    <executions>
                        <execution>
                            <id>add-resource</id>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>add-resource</goal>
                            </goals>
                            <configuration>
                                <resources>
                                    <resource>
                                        <directory>src/main/java</directory>
                                        <includes>
                                            <include>**/*.xml</include>
                                        </includes>
                                    </resource>
                                </resources> 
                            </configuration>
                          </execution>
                     </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.19.1</version>
                    <configuration>
                        <useSystemClassLoader>false</useSystemClassLoader>
                    </configuration>
                </plugin>

    2:报错信息如下

    Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.8:
      add-resource (execution: add-resource, phase: generate-resources) pom.xml

    3:错误原因

    eclipse的m2e插件还没支持到execution

    4:解决办法

    <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        org.codehaus.mojo
                                    </groupId>
                                    <artifactId>
                                        build-helper-maven-plugin
                                    </artifactId>
                                    <versionRange>
                                        [1.8,)
                                    </versionRange>
                                    <goals>
                                        <goal>add-source</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
  • 相关阅读:
    ios app 开发中ipa重新签名步骤介绍-备
    推荐IOS开发3个工具:Homebrew、TestFight、Crashlytics-b
    iOS开发工具——统计Crash的工具Crashlytics-备用
    摘要算法
    Xcode中将图片放入Images.xcassets和直接拖入的区别
    PHP面向对象的基本写法(区别于java)
    PHP 解决时差8小时的问题
    Java-Hirbernate小结大纲
    PHP替换数据库的换行符
    Java-strurs总结
  • 原文地址:https://www.cnblogs.com/zhangliang1990/p/8453616.html
Copyright © 2011-2022 走看看