linux下,ant编译eclipse插件hadoop-eclipse-plugin-2.8.4.jar

结合网上教程,发现很多都不完整,或者对2.8.4版本不适用,综合各篇文章,总结如下:

一、修改hadoop2x-eclipse-plugin-master/src/contrib/eclipse-plugin/build.xml

删除以下标签中的 depends="init, ivy-retrieve-common",在实际编译时,其实用不到该内容

   
         encoding="${build.encoding}"
     srcdir="${src.dir}"
     includes="**/*.java"
     destdir="${build.classes}"
     debug="${javac.debug}"
     deprecation="${javac.deprecation}">
     
   
 



, 删除该行,并添加下面3行

  
  
 

然后找到标签lib/htrace-core4-${htrace.version}.jar,删除该行,并添加下面3行

lib/servlet-api-${servlet-api.version}.jar,  
lib/commons-io-${commons-io.version}.jar,  
lib/htrace-core-${htrace.version}-incubating.jar"/> 


二、修改hadoop2x-eclipse-plugin-master/ivy/libraries.properties,匹配jar包版本号

#hadoop.version=2.6.0    modify
hadoop.version=2.7.3
hadoop-gpl-compression.version=0.1.0



#These are the versions of our dependencies (in alphabetical order)
apacheant.version=1.7.0
ant-task.version=2.0.10


asm.version=3.2
aspectj.version=1.6.5
aspectj.version=1.6.11


checkstyle.version=4.2


commons-cli.version=1.2
commons-codec.version=1.4
#commons-collections.version=3.2.1    modify
commons-collections.version=3.2.2
commons-configuration.version=1.6
commons-daemon.version=1.0.13
#commons-httpclient.version=3.0.1    modify
commons-httpclient.version=3.1
commons-lang.version=2.6
#commons-logging.version=1.0.4        modify
commons-logging.version=1.1.3
#commons-logging-api.version=1.0.4    modify
commons-logging-api.version=1.1.3
#commons-math.version=2.1    modify
commons-math.version=3.1.1
commons-el.version=1.0
commons-fileupload.version=1.2
#commons-io.version=2.1        modify
commons-io.version=2.4
commons-net.version=3.1
core.version=3.1.1
coreplugin.version=1.3.2


#hsqldb.version=1.8.0.10    modify
hsqldb.version=2.0.0
#htrace.version=3.0.4    modify
htrace.version=4.0.1


ivy.version=2.1.0


jasper.version=5.5.12
jackson.version=1.9.13
#not able to figureout the version of jsp & jsp-api version to get it resolved throught ivy
# but still declared here as we are going to have a local copy from the lib folder
jsp.version=2.1
jsp-api.version=5.5.12
jsp-api-2.1.version=6.1.14
jsp-2.1.version=6.1.14
#jets3t.version=0.6.1    modify
jets3t.version=0.9.0
jetty.version=6.1.26
jetty-util.version=6.1.26
#jersey-core.version=1.8    modify
#jersey-json.version=1.8    modify
#jersey-server.version=1.8    modify
jersey-core.version=1.9
jersey-json.version=1.9
jersey-server.version=1.9
#junit.version=4.5    modify
junit.version=4.11
jdeb.version=0.8
jdiff.version=1.0.9
json.version=1.0


kfs.version=0.1


log4j.version=1.2.17
lucene-core.version=2.3.1


mockito-all.version=1.8.5
jsch.version=0.1.42


oro.version=2.0.8


rats-lib.version=0.5.1


servlet.version=4.0.6
servlet-api.version=2.5
#slf4j-api.version=1.7.5    modify
#slf4j-log4j12.version=1.7.5    modify
slf4j-api.version=1.7.10
slf4j-log4j12.version=1.7.10


wagon-http.version=1.0-beta-2
xmlenc.version=0.52
#xerces.version=1.4.4    modify
xerces.version=2.9.1


protobuf.version=2.5.0
guava.version=11.0.2
netty.version=3.6.2.Final


三、修改完成后,大功告成,开始ant(使用root用户,su root)
cd /XXXXX/hadoop2x-eclipse-plugin-master/src/contrib/eclipse-plugin/
ant jar -Dhadoop.version=2.8.4 -Declipse.home=/home/hadoop/eclipse -Dhadoop.home=/usr/local/hadoop-2.8.4


然后你可以切换到 /XXXXXX/hadoop2x-eclipse-plugin-master/build/contrib/eclipse-plugin/, 下面有我们制作好的插件 hadoop-eclipse-plugin-2.8.4.jar.


四、将自己制作的插件放入到eclipse目录的plugins下,然后重启eclipse

你可能感兴趣的:(hadoop,java)