Installation
-
apt-get install groovy;
-
apt-get install gant;
or install gant manually:
-
download gant-standalone_1.9.9-1_all.deb from http://gant.codehaus.org/Prepackaged+Distributions;
-
dpkg -i gant-standalone_1.9.9-1_all.deb;
Translate ant to gant
- write a ant script:
<project name="MyHadoopRunner" basedir="./" default="run">
<path id="lib.path">
<fileset dir="/home/lichao/apps/hadoop-1.1.2">
<include name="**/*.jar" />
</fileset>
</path>
<target name="compile">
<javac srcdir="src" destdir="bin" classpathref="lib.path" />
</target>
<target name="run" depends="compile">
<java classname="chapter1.WordCount" classpathref="lib.path" classpath="bin">
<arg value="src"/>
<arg value="out"/>
</java>
</target>
</project>
-
download ant2gant.groovy from gant website;
-
groovy ant2gant.groovy build.xml > build.gant
; -
gant
.