当前位置:Gxlcms > mysql > Hadoop1.1.2Eclipse插件编译

Hadoop1.1.2Eclipse插件编译

时间:2021-07-01 10:21:17 帮助过:35人阅读

可以直接下载我编译好的插件 hadoop-eclipse-plugin-1.1.2 http://download.csdn.net/detail/wind520/5784389 1:方法一: copy src\contrib\build-contrib.xml 到src\contrib\eclipse-plugin目录下,然后修改 ?xml version=1.0?!-- Licensed to the Apache S

可以直接下载我编译好的插件

hadoop-eclipse-plugin-1.1.2

http://download.csdn.net/detail/wind520/5784389

1:方法一:

copy src\contrib\build-contrib.xml 到src\contrib\eclipse-plugin目录下,然后修改

  1. <!--?xml version="1.0"?-->
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- Imported by contrib/*/build.xml files to share generic targets. -->
  17. <project name="hadoopbuildcontrib" xmlns:ivy="antlib:org.apache.ivy.ant">
  18. <property name="name" value="${ant.project.name}">
  19. <property name="eclipse.home" location="D:/oracle/get/eclipse">
  20. <property name="version" value="1.1.2">
  21. <property name="root" value="${basedir}">
  22. <property name="hadoop.root" location="${root}/../../../">
  23. <!-- Load all the default properties, and any the user wants -->
  24. <!-- to contribute (without having to type -D or edit this file -->
  25. <property file="${user.home}/${name}.build.properties">
  26. <property file="${root}/build.properties">
  27. <property file="${hadoop.root}/build.properties">
  28. <property name="src.dir" location="${root}/src/java">
  29. <property name="src.test" location="${root}/src/test">
  30. <property name="src.test.data" location="${root}/src/test/data">
  31. <!-- Property added for contrib system tests -->
  32. <property name="build-fi.dir" location="${hadoop.root}/build-fi">
  33. <property name="system-test-build-dir" location="${build-fi.dir}/system">
  34. <property name="src.test.system" location="${root}/src/test/system">
  35. <property name="src.examples" location="${root}/src/examples">
  36. <!-- Property added for contrib system tests -->
  37. <property name="conf.dir" location="${hadoop.root}/conf">
  38. <property name="test.junit.output.format" value="plain">
  39. <property name="test.output" value="no">
  40. <property name="test.timeout" value="900000">
  41. <property name="build.contrib.dir" location="${hadoop.root}/build/contrib">
  42. <property name="build.dir" location="${hadoop.root}/build/contrib/${name}">
  43. <property name="build.classes" location="${build.dir}/classes">
  44. <property name="build.test" location="${build.dir}/test">
  45. <property name="build.examples" location="${build.dir}/examples">
  46. <property name="hadoop.log.dir" location="${build.dir}/test/logs">
  47. <!-- all jars together -->
  48. <property name="javac.deprecation" value="off">
  49. <property name="javac.debug" value="on">
  50. <property name="build.ivy.lib.dir" value="${hadoop.root}/build/ivy/lib">
  51. <property name="javadoc.link" value="http://java.sun.com/j2se/1.4/docs/api/">
  52. <property name="build.encoding" value="ISO-8859-1">
  53. <fileset id="lib.jars" dir="${root}" includes="lib/*.jar">
  54. <!-- Property added for contrib system tests -->
  55. <property name="build.test.system" location="${build.dir}/system">
  56. <property name="build.system.classes" location="${build.test.system}/classes">
  57. <!-- IVY properties set here -->
  58. <property name="ivy.dir" location="ivy">
  59. <property name="ivysettings.xml" location="${hadoop.root}/ivy/ivysettings.xml">
  60. <loadproperties srcfile="${ivy.dir}/libraries.properties">
  61. <loadproperties srcfile="${hadoop.root}/ivy/libraries.properties">
  62. <property name="ivy.jar" location="${hadoop.root}/ivy/ivy-${ivy.version}.jar">
  63. <property name="ivy_repo_url" value="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar">
  64. <property name="build.dir" location="build">
  65. <property name="build.ivy.dir" location="${build.dir}/ivy">
  66. <property name="build.ivy.lib.dir" location="${build.ivy.dir}/lib">
  67. <property name="build.ivy.report.dir" location="${build.ivy.dir}/report">
  68. <property name="common.ivy.lib.dir" location="${build.ivy.lib.dir}/${ant.project.name}/common">
  69. <!--this is the naming policy for artifacts we want pulled down-->
  70. <property name="ivy.artifact.retrieve.pattern" value="${ant.project.name}/[conf]/[artifact]-[revision].[ext]">
  71. <!-- the normal classpath -->
  72. <!-- the unit test classpath -->
  73. <!-- The system test classpath -->
  74. <!-- to be overridden by sub-projects -->
  75. <target name="check-contrib">
  76. <target name="init-contrib">
  77. <!-- ====================================================== -->
  78. <!-- Stuff needed by all targets -->
  79. <!-- ====================================================== -->
  80. <target name="init" depends="check-contrib" unless="skip.contrib">
  81. <echo message="contrib: ${name}">
  82. <mkdir dir="${build.dir}">
  83. <mkdir dir="${build.classes}">
  84. <mkdir dir="${build.test}">
  85. <!-- The below two tags added for contrib system tests -->
  86. <mkdir dir="${build.test.system}">
  87. <mkdir dir="${build.system.classes}">
  88. <mkdir dir="${build.examples}">
  89. <mkdir dir="${hadoop.log.dir}">
  90. </mkdir></mkdir></mkdir></mkdir></mkdir></mkdir></mkdir></echo></target>
  91. <!-- ====================================================== -->
  92. <!-- Compile a Hadoop contrib's files -->
  93. <!-- ====================================================== -->
  94. <target name="compile" depends="init, ivy-retrieve-common" unless="skip.contrib">
  95. <echo message="contrib: ${name}">
  96. <javac encoding="${build.encoding}" srcdir="${src.dir}" includes="**/*.java" destdir="${build.classes}" debug="${javac.debug}" deprecation="${javac.deprecation}">
  97. <classpath refid="contrib-classpath">
  98. </classpath></javac>
  99. </echo></target>
  100. <!-- ======================================================= -->
  101. <!-- Compile a Hadoop contrib's example files (if available) -->
  102. <!-- ======================================================= -->
  103. <target name="compile-examples" depends="compile" if="examples.available">
  104. <echo message="contrib: ${name}">
  105. <javac encoding="${build.encoding}" srcdir="${src.examples}" includes="**/*.java" destdir="${build.examples}" debug="${javac.debug}">
  106. <classpath refid="contrib-classpath">
  107. </classpath></javac>
  108. </echo></target>
  109. <!-- ================================================================== -->
  110. <!-- Compile test code -->
  111. <!-- ================================================================== -->
  112. <target name="compile-test" depends="compile-examples" if="test.available">
  113. <echo message="contrib: ${name}">
  114. <javac encoding="${build.encoding}" srcdir="${src.test}" includes="**/*.java" excludes="system/**/*.java" destdir="${build.test}" debug="${javac.debug}">
  115. <classpath refid="test.classpath">
  116. </classpath></javac>
  117. </echo></target>
  118. <!-- ================================================================== -->
  119. <!-- Compile system test code -->
  120. <!-- ================================================================== -->
  121. <target name="compile-test-system" depends="compile-examples" if="test.system.available">
  122. <echo message="contrib: ${name}">
  123. <javac encoding="${build.encoding}" srcdir="${src.test.system}" includes="**/*.java" destdir="${build.system.classes}" debug="${javac.debug}">
  124. <classpath refid="test.system.classpath">
  125. </classpath></javac>
  126. </echo></target>
  127. <!-- ====================================================== -->
  128. <!-- Make a Hadoop contrib's jar -->
  129. <!-- ====================================================== -->
  130. <target name="jar" depends="compile" unless="skip.contrib">
  131. <echo message="contrib: ${name}">
  132. <jar jarfile="${build.dir}/hadoop-${name}-${version}.jar" basedir="${build.classes}">
  133. </jar></echo></target>
  134. <!-- ====================================================== -->
  135. <!-- Make a Hadoop contrib's examples jar -->
  136. <!-- ====================================================== -->
  137. <target name="jar-examples" depends="compile-examples" if="examples.available" unless="skip.contrib">
  138. <echo message="contrib: ${name}">
  139. <jar jarfile="${build.dir}/hadoop-${name}-examples-${version}.jar">
  140. <fileset dir="${build.classes}">
  141. </fileset>
  142. <fileset dir="${build.examples}">
  143. </fileset>
  144. </jar>
  145. </echo></target>
  146. <!-- ====================================================== -->
  147. <!-- Package a Hadoop contrib -->
  148. <!-- ====================================================== -->
  149. <target name="package" depends="jar, jar-examples" unless="skip.contrib">
  150. <mkdir dir="${dist.dir}/contrib/${name}">
  151. <copy todir="${dist.dir}/contrib/${name}" includeemptydirs="false" flatten="true">
  152. <fileset dir="${build.dir}">
  153. <include name="hadoop-${name}-${version}.jar">
  154. </include></fileset>
  155. </copy>
  156. </mkdir></target>
  157. <!-- ================================================================== -->
  158. <!-- Run unit tests -->
  159. <!-- ================================================================== -->
  160. <target name="test" depends="compile-test, compile" if="test.available">
  161. <echo message="contrib: ${name}">
  162. <delete dir="${hadoop.log.dir}">
  163. <mkdir dir="${hadoop.log.dir}">
  164. <junit printsummary="yes" showoutput="${test.output}" haltonfailure="no" fork="yes" maxmemory="512m" errorproperty="tests.failed" failureproperty="tests.failed" timeout="${test.timeout}">
  165. <sysproperty key="test.build.data" value="${build.test}/data">
  166. <sysproperty key="build.test" value="${build.test}">
  167. <sysproperty key="src.test.data" value="${src.test.data}">
  168. <sysproperty key="contrib.name" value="${name}">
  169. <!-- requires fork=yes for:
  170. relative File paths to use the specified user.dir
  171. classpath to use build/contrib/*.jar
  172. -->
  173. <sysproperty key="user.dir" value="${build.test}/data">
  174. <sysproperty key="fs.default.name" value="${fs.default.name}">
  175. <sysproperty key="hadoop.test.localoutputfile" value="${hadoop.test.localoutputfile}">
  176. <sysproperty key="hadoop.log.dir" value="${hadoop.log.dir}">
  177. <sysproperty key="taskcontroller-path" value="${taskcontroller-path}">
  178. <sysproperty key="taskcontroller-ugi" value="${taskcontroller-ugi}">
  179. <classpath refid="test.classpath">
  180. <formatter type="${test.junit.output.format}">
  181. <batchtest todir="${build.test}" unless="testcase">
  182. <fileset dir="${src.test}" includes="**/Test*.java" excludes="**/${test.exclude}.java, system/**/*.java">
  183. </fileset></batchtest>
  184. <batchtest todir="${build.test}" if="testcase">
  185. <fileset dir="${src.test}" includes="**/${testcase}.java" excludes="system/**/*.java">
  186. </fileset></batchtest>
  187. </formatter></classpath></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></junit>
  188. </mkdir></delete></echo></target>
  189. <!-- ================================================================== -->
  190. <!-- Run system tests -->
  191. <!-- ================================================================== -->
  192. <target name="test-system" depends="compile, compile-test-system, jar" if="test.system.available">
  193. <delete dir="${build.test.system}/extraconf">
  194. <mkdir dir="${build.test.system}/extraconf">
  195. <property name="test.src.dir" location="${hadoop.root}/src/test">
  196. <property name="test.junit.printsummary" value="yes">
  197. <property name="test.junit.haltonfailure" value="no">
  198. <property name="test.junit.maxmemory" value="512m">
  199. <property name="test.junit.fork.mode" value="perTest">
  200. <property name="test.all.tests.file" value="${test.src.dir}/all-tests">
  201. <property name="test.build.dir" value="${hadoop.root}/build/test">
  202. <property name="basedir" value="${hadoop.root}">
  203. <property name="test.timeout" value="900000">
  204. <property name="test.junit.output.format" value="plain">
  205. <property name="test.tools.input.dir" value="${basedir}/src/test/tools/data">
  206. <property name="c++.src" value="${basedir}/src/c++">
  207. <property name="test.include" value="Test*">
  208. <property name="c++.libhdfs.src" value="${c++.src}/libhdfs">
  209. <property name="test.build.data" value="${build.test.system}/data">
  210. <property name="test.cache.data" value="${build.test.system}/cache">
  211. <property name="test.debug.data" value="${build.test.system}/debug">
  212. <property name="test.log.dir" value="${build.test.system}/logs">
  213. <patternset id="empty.exclude.list.id">
  214. <exec executable="sed" inputstring="${os.name}" outputproperty="nonspace.os">
  215. </exec>
  216. <property name="build.platform" value="${nonspace.os}-${os.arch}-${sun.arch.data.model}">
  217. <property name="build.native" value="${hadoop.root}/build/native/${build.platform}">
  218. <property name="lib.dir" value="${hadoop.root}/lib">
  219. <property name="install.c++.examples" value="${hadoop.root}/build/c++-examples/${build.platform}">
  220. <condition property="tests.testcase">
  221. <isset property="testcase">
  222. </isset></condition>
  223. <property name="test.junit.jvmargs" value="-ea">
  224. <macro-system-test-runner test.file="${test.all.tests.file}" classpath="test.system.classpath" test.dir="${build.test.system}" fileset.dir="${hadoop.root}/src/contrib/${name}/src/test/system" hadoop.conf.dir.deployed="${hadoop.conf.dir.deployed}">
  225. </macro-system-test-runner>
  226. </property></property></property></property></property></patternset></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></mkdir></delete></target>
  227. <macrodef name="macro-system-test-runner">
  228. <sequential>
  229. <delete dir="@{test.dir}/data">
  230. <mkdir dir="@{test.dir}/data">
  231. <delete dir="@{test.dir}/logs">
  232. <mkdir dir="@{test.dir}/logs">
  233. <copy file="${test.src.dir}/hadoop-policy.xml" todir="@{test.dir}/extraconf">
  234. <copy file="${test.src.dir}/fi-site.xml" todir="@{test.dir}/extraconf">
  235. <junit showoutput="${test.output}" printsummary="${test.junit.printsummary}" haltonfailure="${test.junit.haltonfailure}" fork="yes" forkmode="${test.junit.fork.mode}" maxmemory="${test.junit.maxmemory}" dir="${basedir}" timeout="${test.timeout}" errorproperty="tests.failed" failureproperty="tests.failed">
  236. <jvmarg value="${test.junit.jvmargs}">
  237. <sysproperty key="java.net.preferIPv4Stack" value="true">
  238. <sysproperty key="test.build.data" value="@{test.dir}/data">
  239. <sysproperty key="test.tools.input.dir" value="${test.tools.input.dir}">
  240. <sysproperty key="test.cache.data" value="${test.cache.data}">
  241. <sysproperty key="test.debug.data" value="${test.debug.data}">
  242. <sysproperty key="hadoop.log.dir" value="@{test.dir}/logs">
  243. <sysproperty key="test.src.dir" value="@{fileset.dir}">
  244. <sysproperty key="taskcontroller-path" value="${taskcontroller-path}">
  245. <sysproperty key="taskcontroller-ugi" value="${taskcontroller-ugi}">
  246. <sysproperty key="test.build.extraconf" value="@{test.dir}/extraconf">
  247. <sysproperty key="hadoop.policy.file" value="hadoop-policy.xml">
  248. <sysproperty key="java.library.path" value="${build.native}/lib:${lib.dir}/native/${build.platform}">
  249. <sysproperty key="install.c++.examples" value="${install.c++.examples}">
  250. <syspropertyset dynamic="no">
  251. <propertyref name="hadoop.tmp.dir">
  252. </propertyref></syspropertyset>
  253. <!-- set compile.c++ in the child jvm only if it is set -->
  254. <syspropertyset dynamic="no">
  255. <propertyref name="compile.c++">
  256. </propertyref></syspropertyset>
  257. <!-- Pass probability specifications to the spawn JVM -->
  258. <syspropertyset id="FaultProbabilityProperties">
  259. <propertyref regex="fi.*">
  260. </propertyref></syspropertyset>
  261. <sysproperty key="test.system.hdrc.deployed.hadoopconfdir" value="@{hadoop.conf.dir.deployed}">
  262. <classpath refid="@{classpath}">
  263. <formatter type="${test.junit.output.format}">
  264. <batchtest todir="@{test.dir}" unless="testcase">
  265. <fileset dir="@{fileset.dir}" excludes="**/${test.exclude}.java aop/** system/**">
  266. <patternset>
  267. <includesfile name="@{test.file}">
  268. </includesfile></patternset>
  269. </fileset>
  270. </batchtest>
  271. <batchtest todir="@{test.dir}" if="testcase">
  272. <fileset dir="@{fileset.dir}" includes="**/${testcase}.java">
  273. </fileset></batchtest>
  274. </formatter></classpath></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></sysproperty></jvmarg></junit>
  275. </copy></copy></mkdir></delete></mkdir></delete></sequential>
  276. </macrodef>
  277. <target name="checkfailure" if="tests.failed">
  278. <touch file="${build.contrib.dir}/testsfailed">
  279. <fail unless="continueOnFailure">Contrib Tests failed!</fail>
  280. </touch></target>
  281. <!-- ================================================================== -->
  282. <!-- Clean. Delete the build files, and their directories -->
  283. <!-- ================================================================== -->
  284. <target name="clean">
  285. <echo message="contrib: ${name}">
  286. <delete dir="${build.dir}">
  287. </delete></echo></target>
  288. <target name="ivy-probe-antlib">
  289. <condition property="ivy.found">
  290. <typefound uri="antlib:org.apache.ivy.ant" name="cleancache">
  291. </typefound></condition>
  292. </target>
  293. <target name="ivy-download" description="To download ivy " unless="offline">
  294. <get src="${ivy_repo_url}" dest="${ivy.jar}" usetimestamp="true">
  295. </get></target>
  296. <target name="ivy-init-antlib" depends="ivy-download,ivy-probe-antlib" unless="ivy.found">
  297. <typedef uri="antlib:org.apache.ivy.ant" onerror="fail" loaderref="ivyLoader">
  298. <classpath>
  299. <!-- Override classpath to include Eclipse SDK jars -->
  300. <!-- Skip building if eclipse.home is unset. -->
  301. <target name="check-contrib" unless="eclipse.home">
  302. <property name="skip.contrib" value="yes">
  303. <echo message="eclipse.home unset: skipping eclipse plugin">
  304. </echo></property></target>
  305. <target name="compile" depends="init, ivy-retrieve-common" unless="skip.contrib">
  306. <echo message="contrib: ${name}">
  307. <javac encoding="${build.encoding}" srcdir="${src.dir}" includes="**/*.java" destdir="${build.classes}" debug="${javac.debug}" deprecation="${javac.deprecation}">
  308. <classpath refid="classpath">
  309. </classpath></javac>
  310. </echo></target>
  311. <!-- Override jar target to specify manifest -->
  312. <target name="jar" depends="compile" unless="skip.contrib">
  313. <mkdir dir="${build.dir}/lib">
  314. <copy file="${hadoop.root}/hadoop-core-${version}.jar" tofile="${build.dir}/lib/hadoop-core.jar" verbose="true">
  315. <copy file="${hadoop.root}/lib/commons-cli-1.2.jar" todir="${build.dir}/lib" verbose="true">
  316. <copy file="${hadoop.root}/lib/commons-configuration-1.6.jar" todir="${build.dir}/lib" verbose="true">
  317. <copy file="${hadoop.root}/lib/commons-httpclient-3.0.1.jar" todir="${build.dir}/lib" verbose="true">
  318. <copy file="${hadoop.root}/lib/jackson-core-asl-1.8.8.jar" todir="${build.dir}/lib" verbose="true">
  319. <copy file="${hadoop.root}/lib/commons-lang-2.4.jar" todir="${build.dir}/lib" verbose="true">
  320. <copy file="${hadoop.root}/lib/jackson-mapper-asl-1.8.8.jar" todir="${build.dir}/lib" verbose="true">
  321. <jar jarfile="${build.dir}/hadoop-${name}-${version}.jar" manifest="${root}/META-INF/MANIFEST.MF">
  322. <fileset dir="${build.dir}" includes="classes/ lib/">
  323. <fileset dir="${root}" includes="resources/ plugin.xml">
  324. </fileset></fileset></jar>
  325. </copy></copy></copy></copy></copy></copy></copy></mkdir></target>
  326. </classpath></typedef></target></target></target></property></property></property></property></property></property></property></property></loadproperties></loadproperties></property></property></property></property></fileset></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></property></project>

修改src\contrib\eclipse-plugin\META-INF下的MANIFEST.MF

  1. Manifest-Version: 1.0
  2. Bundle-ManifestVersion: 2
  3. Bundle-Name: MapReduce Tools for Eclipse
  4. Bundle-SymbolicName: org.apache.hadoop.eclipse;singleton:=true
  5. Bundle-Version: 0.18
  6. Bundle-Activator: org.apache.hadoop.eclipse.Activator
  7. Bundle-Localization: plugin
  8. Require-Bundle: org.eclipse.ui,
  9. org.eclipse.core.runtime,
  10. org.eclipse.jdt.launching,
  11. org.eclipse.debug.core,
  12. org.eclipse.jdt,
  13. org.eclipse.jdt.core,
  14. org.eclipse.core.resources,
  15. org.eclipse.ui.ide,
  16. org.eclipse.jdt.ui,
  17. org.eclipse.debug.ui,
  18. org.eclipse.jdt.debug.ui,
  19. org.eclipse.core.expressions,
  20. org.eclipse.ui.cheatsheets,
  21. org.eclipse.ui.console,
  22. org.eclipse.ui.navigator,
  23. org.eclipse.core.filesystem,
  24. org.apache.commons.logging
  25. Eclipse-LazyStart: true
  26. Bundle-ClassPath: classes/,lib/hadoop-core.jar,lib/commons-cli-1.2.jar,lib/commons-configuration-1.6.jar,lib/commons-httpclient-3.0.1.jar,lib/commons-lang-2.4.jar,lib/jackson-core-asl-1.8.8.jar,lib/jackson-mapper-asl-1.8.8.jar
  27. Bundle-Vendor: Apache Hadoop



编译:

  1. Buildfile: E:\big\Hadoop\hadoop-1.1.2\src\contrib\eclipse-plugin\build.xml
  2. check-contrib:
  3. init:
  4. [echo] contrib: eclipse-plugin
  5. [mkdir] Created dir: E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin
  6. [mkdir] Created dir: E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\classes
  7. [mkdir] Created dir: E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\test
  8. [mkdir] Created dir: E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\system
  9. [mkdir] Created dir: E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\system\classes
  10. [mkdir] Created dir: E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\examples
  11. [mkdir] Created dir: E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\test\logs
  12. init-contrib:
  13. ivy-download:
  14. [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar
  15. [get] To: E:\big\Hadoop\hadoop-1.1.2\ivy\ivy-2.1.0.jar
  16. [get] Not modified - so not downloaded
  17. ivy-probe-antlib:
  18. ivy-init-antlib:
  19. ivy-init:
  20. [ivy:configure] :: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ ::
  21. [ivy:configure] :: loading settings :: file = E:\big\Hadoop\hadoop-1.1.2\ivy\ivysettings.xml
  22. ivy-resolve-common:
  23. [ivy:resolve] :: resolving dependencies :: org.apache.hadoop#eclipse-plugin;working@lenovo-PC
  24. [ivy:resolve]
  25. confs: [common]
  26. [ivy:resolve]
  27. found commons-logging#commons-logging;1.0.4 in maven2
  28. [ivy:resolve]
  29. found log4j#log4j;1.2.15 in maven2
  30. [ivy:resolve] :: resolution report :: resolve 335ms :: artifacts dl 8ms
  31. ---------------------------------------------------------------------
  32. | | modules || artifacts |
  33. | conf | number| search|dwnlded|evicted|| number|dwnlded|
  34. ---------------------------------------------------------------------
  35. | common | 2 | 0 | 0 | 0 || 2 | 0 |
  36. ---------------------------------------------------------------------
  37. ivy-retrieve-common:
  38. [ivy:retrieve] :: retrieving :: org.apache.hadoop#eclipse-plugin [sync]
  39. [ivy:retrieve]
  40. confs: [common]
  41. [ivy:retrieve]
  42. 2 artifacts copied, 0 already retrieved (419kB/114ms)
  43. [ivy:cachepath] DEPRECATED: 'ivy.conf.file' is deprecated, use 'ivy.settings.file' instead
  44. [ivy:cachepath] :: loading settings :: file = E:\big\Hadoop\hadoop-1.1.2\ivy\ivysettings.xml
  45. compile:
  46. [echo] contrib: eclipse-plugin
  47. [javac] E:\big\Hadoop\hadoop-1.1.2\src\contrib\eclipse-plugin\build.xml:62: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
  48. [javac] Compiling 45 source files to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\classes
  49. [javac] 注意:某些输入文件使用或覆盖了已过时的 API。
  50. [javac] 注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。
  51. [javac] 注意:某些输入文件使用了未经检查或不安全的操作。
  52. [javac] 注意:要了解详细信息,请使用 -Xlint:unchecked 重新编译。
  53. jar:
  54. [mkdir] Created dir: E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  55. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  56. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\hadoop-core-1.1.2.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\hadoop-core.jar
  57. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  58. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\lib\commons-cli-1.2.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\commons-cli-1.2.jar
  59. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  60. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\lib\commons-configuration-1.6.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\commons-configuration-1.6.jar
  61. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  62. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\lib\commons-httpclient-3.0.1.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\commons-httpclient-3.0.1.jar
  63. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  64. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\lib\jackson-core-asl-1.8.8.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\jackson-core-asl-1.8.8.jar
  65. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  66. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\lib\commons-lang-2.4.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\commons-lang-2.4.jar
  67. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  68. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\lib\jackson-mapper-asl-1.8.8.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\jackson-mapper-asl-1.8.8.jar
  69. [jar] Building jar: E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\hadoop-eclipse-plugin-1.1.2.jar
  70. BUILD SUCCESSFUL
  71. Total time: 10 seconds


方法2:

修改 eclipse-plugin目录下的build.xml 文件

  1. <!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
  2. <project default="jar" name="eclipse-plugin">
  3. <property name="name" value="${ant.project.name}">
  4. <property name="root" value="${basedir}">
  5. <property name="hadoop.root" location="E:/big/Hadoop/hadoop-1.1.2">
  6. <property name="version" value="1.1.2">
  7. <property name="eclipse.home" location="D:/oracle/get/eclipse">
  8. <property name="build.dir" location="${hadoop.root}/build/contrib/${name}">
  9. <property name="build.classes" location="${build.dir}/classes">
  10. <property name="src.dir" location="${root}/src/java">
  11. <!-- Override classpath to include Eclipse SDK jars -->
  12. <target name="compile">
  13. <mkdir dir="${build.dir}/classes">
  14. <javac encoding="ISO-8859-1" srcdir="${src.dir}" includes="**/*.java" destdir="${build.classes}" debug="on" deprecation="off">
  15. <classpath refid="classpath">
  16. </classpath></javac>
  17. </mkdir></target>
  18. <!-- Override jar target to specify manifest-->
  19. <target name="jar" depends="compile">
  20. <mkdir dir="${build.dir}/lib">
  21. <copy file="${hadoop.root}/hadoop-core-${version}.jar" tofile="${build.dir}/lib/hadoop-core.jar" verbose="true">
  22. <copy file="${hadoop.root}/lib/commons-cli-1.2.jar" todir="${build.dir}/lib" verbose="true">
  23. <copy file="${hadoop.root}/lib/commons-configuration-1.6.jar" todir="${build.dir}/lib" verbose="true">
  24. <copy file="${hadoop.root}/lib/commons-httpclient-3.0.1.jar" todir="${build.dir}/lib" verbose="true">
  25. <copy file="${hadoop.root}/lib/jackson-core-asl-1.8.8.jar" todir="${build.dir}/lib" verbose="true">
  26. <copy file="${hadoop.root}/lib/commons-lang-2.4.jar" todir="${build.dir}/lib" verbose="true">
  27. <copy file="${hadoop.root}/lib/jackson-mapper-asl-1.8.8.jar" todir="${build.dir}/lib" verbose="true">
  28. <jar jarfile="${build.dir}/hadoop-${name}-${version}.jar" manifest="${root}/META-INF/MANIFEST.MF">
  29. <fileset dir="${build.dir}" includes="classes/ lib/">
  30. <fileset dir="${root}" includes="resources/ plugin.xml">
  31. </fileset></fileset></jar>
  32. </copy></copy></copy></copy></copy></copy></copy></mkdir></target>
  33. </property></property></property></property></property></property></property></property></project>

修改src\contrib\eclipse-plugin\META-INF下的MANIFEST.MF

同方法一的


为了和方法一步冲突,我修改buildOK.xml

编译:

  1. Buildfile: E:\big\Hadoop\hadoop-1.1.2\src\contrib\eclipse-plugin\buildOK.xml
  2. compile:
  3. [mkdir] Created dir: E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\classes
  4. [javac] E:\big\Hadoop\hadoop-1.1.2\src\contrib\eclipse-plugin\buildOK.xml:42: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
  5. [javac] Compiling 45 source files to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\classes
  6. [javac] 注意:某些输入文件使用或覆盖了已过时的 API。
  7. [javac] 注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。
  8. [javac] 注意:某些输入文件使用了未经检查或不安全的操作。
  9. [javac] 注意:要了解详细信息,请使用 -Xlint:unchecked 重新编译。
  10. jar:
  11. [mkdir] Created dir: E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  12. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  13. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\hadoop-core-1.1.2.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\hadoop-core.jar
  14. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  15. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\lib\commons-cli-1.2.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\commons-cli-1.2.jar
  16. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  17. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\lib\commons-configuration-1.6.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\commons-configuration-1.6.jar
  18. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  19. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\lib\commons-httpclient-3.0.1.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\commons-httpclient-3.0.1.jar
  20. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  21. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\lib\jackson-core-asl-1.8.8.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\jackson-core-asl-1.8.8.jar
  22. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  23. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\lib\commons-lang-2.4.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\commons-lang-2.4.jar
  24. [copy] Copying 1 file to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib
  25. [copy] Copying E:\big\Hadoop\hadoop-1.1.2\lib\jackson-mapper-asl-1.8.8.jar to E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\lib\jackson-mapper-asl-1.8.8.jar
  26. [jar] Building jar: E:\big\Hadoop\hadoop-1.1.2\build\contrib\eclipse-plugin\hadoop-eclipse-plugin-1.1.2.jar
  27. BUILD SUCCESSFUL
  28. Total time: 2 seconds

人气教程排行