敬畏历史 Dubbo 源码

源码环境搭建

maven install 编译源码 请使用 -DarchetypeCatalog=internal -Dfile.encoding=GBK
构建项目用 eclipse 会报错 
Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:flatten-maven-plugin:1.2.5:flatten
不用慌
这表示m2e在其执行maven的生命周期管理时没有定义该插件
所以提示出错 其实m2e对此是提供了扩展机制的
以下是解决过程:
进入Window—>Preferences—>Maven配置,进入Lifecycle Mapping设置项
没有找到定义的 lifecycle-mapping-metadata.xml 我们新建一个放到指定目录

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
  <lifecycleMappings>
    <lifecycleMapping>
      <packagingType>war</packagingType>
      <lifecycleMappingId>org.eclipse.m2e.jdt.JarLifecycleMapping</lifecycleMappingId>
    </lifecycleMapping>
  </lifecycleMappings>

  <pluginExecutions>
    <!--  standard maven plugins -->
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <goals>
          <goal>resources</goal>
          <goal>testResources</goal>
          <goal>copy-resources</goal>
        </goals>
        <versionRange>[2.4,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <execute>
          <runOnIncremental>true</runOnIncremental>
        </execute>
      </action>
    </pluginExecution>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <goals>
          <goal>resources</goal>
          <goal>testResources</goal>
          <goal>copy-resources</goal>
        </goals>
        <versionRange>[0.0.1,2.4)</versionRange>
      </pluginExecutionFilter>
      <action>
        <error>
          <message>maven-resources-plugin prior to 2.4 is not supported by m2e. Use maven-resources-plugin version 2.4 or later.</message>
        </error>
      </action>
    </pluginExecution>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <goals>
          <goal>enforce</goal>
        </goals>
        <versionRange>[1.0-alpha-1,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore>
          <message>maven-enforcer-plugin (goal "enforce") is ignored by m2e.</message>
        </ignore>
      </action>
    </pluginExecution>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <goals>
          <goal>install</goal>
        </goals>
        <versionRange>[1.6-SONATYPE-r940877,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore>
          <message>maven-invoker-plugin (goal "install") is ignored by m2e.</message>
        </ignore>
      </action>
    </pluginExecution>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-remote-resources-plugin</artifactId>
        <versionRange>[1.0,)</versionRange>
        <goals>
          <goal>process</goal>
        </goals>
      </pluginExecutionFilter>
      <action>
        <ignore>
          <message>maven-remote-resources-plugin (goal "process") is ignored by m2e.</message>
        </ignore>
      </action>
    </pluginExecution>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <versionRange>[0,)</versionRange>
        <goals>
          <goal>configure-workspace</goal>
          <goal>eclipse</goal>
          <goal>clean</goal>

          <goal>to-maven</goal>
          <goal>install-plugins</goal>
          <goal>make-artifacts</goal>

          <goal>myeclipse</goal>
          <goal>myeclipse-clean</goal>

          <goal>rad</goal>
          <goal>rad-clean</goal>
        </goals>
      </pluginExecutionFilter>
      <action>
        <error>
          <message>maven-eclipse-plugin is not compatible with m2e</message>
        </error>
      </action>
    </pluginExecution>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <versionRange>[2.0,)</versionRange>
        <goals>
          <goal>jar-no-fork</goal>
          <goal>test-jar-no-fork</goal>
          <!-- theoretically, the following goals should not be bound to lifecycle, but ignore them just in case  -->
          <goal>jar</goal>
          <goal>aggregate</goal>
          <goal>test-jar</goal>
        </goals>
      </pluginExecutionFilter>
      <action>
        <ignore/>
      </action>
    </pluginExecution>

    <!-- commonly used codehaus plugins -->
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <versionRange>[1.0,)</versionRange>
        <goals>
          <goal>check</goal>
        </goals>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <versionRange>[1.0-beta-1,)</versionRange>
        <goals>
          <goal>create</goal>
        </goals>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>
    <!-- 自定义缺失的插件 -->
	<pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
         <versionRange>[1.2,)</versionRange>
        <goals>
          <goal>flatten</goal>
        </goals>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>
    
  </pluginExecutions>
</lifecycleMappingMetadata>

修改完成后 重启eclipse 对Maven项目update即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值