ITPub博客

首页 > 大数据 > Hadoop > 编译eclipse的hadoop插件

编译eclipse的hadoop插件

Hadoop 作者:xuliang2002 时间:2013-10-16 10:08:15 0 删除 编辑
${hadoophome}:是hadoop的安装目录
${eclipsehome}:是eclipse的安装目录

1.修改${hadoophome}/src/contrib/eclipse-plugin/build.xml
  <path id="classpath">
    <pathelement location="${build.classes}"/>
    <pathelement location="${hadoop.root}/build/classes"/>
    <path refid="eclipse-sdk-jars"/>

   




  path>

<target name="jar" depends="compile" unless="skip.contrib">
    <mkdir dir="${build.dir}/lib"/>

    <copy file="${hadoop.root}/hadoop-core-${version}.jar" tofile="${build.dir}/lib/hadoop-core.jar" verbose="true"/>
    <copy file="${hadoop.root}/lib/commons-cli-1.2.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.root}/lib/commons-lang-2.4.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.root}/lib/commons-configuration-1.6.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.root}/lib/jackson-mapper-asl-1.8.8.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.root}/lib/jackson-core-asl-1.8.8.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.root}/lib/commons-httpclient-3.0.1.jar"  todir="${build.dir}/lib" verbose="true"/>
    <jar
      jarfile="${build.dir}/hadoop-${name}-${version}.jar"
      manifest="${root}/META-INF/MANIFEST.MF">
      <fileset dir="${build.dir}" includes="classes/ lib/"/>
      <fileset dir="${root}" includes="resources/ plugin.xml"/>
    jar>
  target>

2.在${hadoophome}/src/contrib下面的build-contrib.xml中添加

<property name="version" value="1.2.1"/>
<property name="ivy.version" value="2.1.0"/>
<property name="eclipse.home" location="${eclipsehome}"/>


3.修改${hadoophome}/src/contrib/ecipse-plugin/META-INF/
MANIFEST.MF
修改最后的
Bundle-ClassPath:(最后把Bundle-ClassPath:都覆盖掉,否则可能会出现MANIFEST.MF无效的问题)
Bundle-ClassPath: classes/,lib/hadoop-core.jar,lib/jackson-core-asl-1.8.8.jar ,lib/jackson-mapper-asl-1.8.8.jar, lib/commons-configuration-1.6.jar,lib/commons-lang-2.4.jar, lib/commons-httpclient-3.0.1.jar,lib/commons-cli-1.2.jar
4.回到${hadoophome}/src/contrib/ecipse-plugin,ant编译
5.在
${hadoophome}/build/contrib/eclipse-plugin找到编译好的插件hadoop-eclipse-plugin-1.2.1.jar并将其copy到eclipse下的plugin目录下

<!-- 正文结束 -->

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23182370/viewspace-1119409/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2010-01-14

  • 博文量
    1
  • 访问量
    817