How to compile the eclipse plug-in for hadoop1.x
Editor to share with you how to compile the eclipse plug-in for hadoop1.x. I hope you will get something after reading this article. Let's discuss it together.
Note: the following operations are based on Hadoop-1.2.1,Eclipse Luna,Win7 64-bit
1. Import the project of hadoop eclipse plug-in into Eclipse. The plug-in source code directory is as follows:
D:\ Lab\ lib\ hadoop\ hadoop-1.2.1\ src\ contrib\ eclipse-plugin
2. Configuration project dependence
3. Prepare the configuration file of ant
D:\ Lab\ lib\ hadoop\ hadoop-1.2.1\ src\ contrib\ build-contrib.xml
Copy the above build-contrib.xml to the project directory and modify the contents of the file. The details are as follows:
4. Modify build.xml
5. Modify MENIFEST.MF to add some dependent jar to Bundule-ClassPath.
Bundle-ClassPath: classes/, D:/Lab/lib/hadoop/hadoop-1.2.1/lib/hadoop-core-1.2.1.jar, D:/Lab/lib/hadoop/hadoop-1.2.1/lib/commons-cli-1.2.jar, D:/Lab/lib/hadoop/hadoop-1.2.1/lib/commons-configuration-1.6.jar, D:/Lab/lib/hadoop/hadoop-1.2.1/lib/commons-httpclient-3.0.1.jar D:/Lab/lib/hadoop/hadoop-1.2.1/lib/commons-lang-2.4.jar, D:/Lab/lib/hadoop/hadoop-1.2.1/lib/jackson-core-asl-1.8.8.jar, D:/Lab/lib/hadoop/hadoop-1.2.1/lib/jackson-mapper-asl-1.8.8.jar
5. Add Ant Builder.
6. Compilation
Build Project in the Project menu
7. Running result
Buildfile: d:\ Lab\ ws-back-end\ MapReduceTools\ build.xmlcheck-contrib:init: [echo] contrib: eclipse-plugin [mkdir] Created dir: d:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin [mkdir] Created dir: d:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ classes [mkdir] Created dir: d:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib \ eclipse-plugin\ test [mkdir] Created dir: d:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ system [mkdir] Created dir: d:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ system\ classes [mkdir] Created dir: d:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ examples [mkdir] Created dir: d:\ Lab\ ws-back-end \ MapReduceTools\ build\ contrib\ eclipse-plugin\ test\ logsinit-contrib:ivy-download: [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar [get] To: d:\ Lab\ lib\ hadoop\ hadoop-1.2.1\ ivy\ ivy-2.1.0.jar [get] http://repo2.maven.org/ Maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar moved to http://120.195.54.5:801/videoplayer/ivy-2.1.0.jar?ich_u_r_i=ae068fe40ff82e58486dd0954048cc19&ich_s_t_a_r_t=0&ich_e_n_d=0&ich_k_e_y=1445088923750763152452&ich_t_y_p_e=1&ich_d_i_s_k_i_d=6&ich_u_n_i _ get 1 [get] Not modified-so not downloadedivy-probe-antlib:ivy-init-antlib:ivy-init: [ivy:configure]:: Ivy 2.1.0-20090925235825:: http://ant.apache.org/ivy/:: [ivy:configure]:: loading settings:: file = D:\ Lab\ lib\ hadoop\ hadoop-1.2.1\ ivy\ ivysettings.xmlivy-resolve-common:ivy-retrieve-common: [ivy:cachepath] DEPRECATED: 'ivy.conf.file' is deprecated Use 'ivy.settings.file' instead [ivy:cachepath]:: loading settings:: file = D:\ Lab\ lib\ hadoop\ hadoop-1.2.1\ ivy\ ivysettings.xmlcompile: [echo] contrib: eclipse-plugin [javac] D:\ Lab\ ws-back-end\ MapReduceTools\ build.xml:65: warning:' includeantruntime' was not set, defaulting to build.sysclasspath=last Set to false for repeatable builds [javac] Compiling 45 source files to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ classes [javac] Note: some input files use or overwrite obsolete API. [javac] Note: for more information, use-Xlint:deprecation to recompile. [javac] Note: some input files use unchecked or unsafe operations. [javac] Note: for more information, use-Xlint:unchecked to recompile. Jar: [mkdir] Created dir: d:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ lib [copy] Copying 1 file to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ lib [copy] Copying D:\ Lab\ lib\ hadoop\ hadoop-1.2.1\ hadoop-core-1.2.1.jar to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib \ eclipse-plugin lib\ hadoop-core.jar [copy] Copying 1 file to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ lib [copy] Copying D:\ Lab\ lib\ hadoop\ hadoop-1.2.1\ lib\ commons-cli-1.2.jar to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ lib\ commons-cli-1.2.jar [copy ] Copying 1 file to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ lib [copy] Copying D:\ Lab\ lib\ hadoop\ hadoop-1.2.1\ lib\ commons-lang-2.4.jar to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ lib\ commons-lang-2.4.jar [copy] Copying 1 file to D:\ Lab\ ws-back-end\ MapReduceTools Build\ contrib\ eclipse-plugin\ lib [copy] Copying D:\ Lab\ lib\ hadoop\ hadoop-1.2.1\ lib\ commons-configuration-1.6.jar to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ lib\ copy] Copying 1 file to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ lib [copy] Copying D. :\ Lab\ lib\ hadoop\ hadoop-1.2.1\ lib\ commons-httpclient-3.0.1.jar to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ lib\ commons-httpclient-3.0.1.jar [copy] Copying 1 file to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ lib [copy] Copying D:\ Lab\ lib\ hadoop\ hadoop-1.2. 1\ lib\ jackson-mapper-asl-1.8.8.jar to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ lib\ jackson-mapper-asl-1.8.8.jar [copy] Copying 1 file to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ lib [copy] Copying D:\ Lab\ lib\ hadoop\ hadoop-1.2.1\ lib\ jackson-core-asl- 1.8.8.jar to D:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ lib\ jackson-core-asl-1.8.8.jar [jar] Building jar: d:\ Lab\ ws-back-end\ MapReduceTools\ build\ contrib\ eclipse-plugin\ hadoop-eclipse-plugin-1.2.1.jarBUILD SUCCESSFULTotal time: 6 seconds
After reading this article, I believe you have some understanding of "how to compile the eclipse plug-in for hadoop1.x". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!