Skip to content

Instantly share code, notes, and snippets.

@akiatoji
Created September 1, 2014 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akiatoji/2ab99c14ede323cd713d to your computer and use it in GitHub Desktop.
Save akiatoji/2ab99c14ede323cd713d to your computer and use it in GitHub Desktop.
Hadoop 2 map reduce builld.xml
<!--
Ever since Hadoop 2 deprecated hadoop-core.jar, building mapreduce jars isn't straightforward
especially if you want to use newer bits.
I just use this template ant build.xml that includes all hadoop jars, aaaaand all them variations
of the same lib jars that hadoop jars depend on.
hadoop.home is set to OS X homebrew, switch to whatever home is for the distribution.
-->
<project name="geo mapper" default="build" basedir=".">
<description>
Build geo mapper
</description>
<property name="src" location="src" />
<property name="build" location="build" />
<property name="hadoop.home" location="/usr/local/Cellar/hadoop/2.5.0" />
<target name="init">
<tstamp />
<mkdir dir="${build}" />
<mkdir dir="${build}/classes" />
</target>
<target name="compile" depends="init" description="compile the source ">
<javac srcdir="${src}" destdir="${build}/classes" includeantruntime="false">
<classpath>
<fileset dir="${hadoop.home}/libexec/share/hadoop">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</target>
<target name="build" depends="compile" description="generate the distribution">
<jar jarfile="${build}/lib/geomapper.jar" basedir="${build}/classes" />
</target>
<target name="clean" description="clean up">
<delete dir="${build}" />
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment