Skip to content

Instantly share code, notes, and snippets.

@need4spd
Created January 17, 2013 07:06
Show Gist options
  • Select an option

  • Save need4spd/4554264 to your computer and use it in GitHub Desktop.

Select an option

Save need4spd/4554264 to your computer and use it in GitHub Desktop.
simple jar build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="logstatisticAnalyzer" default="build">
<property name="src.dir" value="src"/>
<property name="resources.dir" value="resources"/>
<property name="build.dir" value="build"/>
<property name="dist.dir" value="dist"/>
<property name="lib.dir" value="lib"/>
<path id="master-classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="clean" description="Clean output dirs (build, dist)">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="build" depends="build_main" description="Compile all source files." />
<target name="initdist">
<mkdir dir="${dist.dir}"/>
</target>
<target name="build_main" depends="initdist" description="Compile main source tree java files into class files, generate jar files">
<mkdir dir="${build.dir}/classes"/>
<javac destdir="${build.dir}/classes" source="1.6" target="1.6" debug="true" deprecation="false" optimize="false" failonerror="true" encoding="utf-8">
<src path="${src.dir}"/>
<src path="${resources.dir}"/>
<classpath refid="master-classpath"/>
</javac>
<copy overwrite="true" todir="${build.dir}/classes">
<fileset dir="${resources.dir}">
<include name="**/*.xml" />
<include name="**/*.properties" />
</fileset>
</copy>
</target>
<target name="create.jarfile" depends="build" description="Build the UCMP-OMP Common archive">
<delete file="${dist.dir}/${name}_${version}.jar"/>
<jar jarfile="${dist.dir}/${name}_${version}.jar" compress="true" basedir="${build.dir}/classes">
<manifest>
<!-- attribute name="Main-Class" value="kr.co.skcp.run.DeamonStarter" / -->
<attribute name="Class-Path" value="./lib/commons-logging-1.1.1.jar ./lib/hadoop-core-1.0.4.jar
./lib/hadoop-test-1.0.4.jar ./lib/hadoop-tools-1.0.4.jar ./lib/hamcrest-core-1.1.jar ./lib/junit-4.11.jar
./lib/log4j-1.2.14.jar ./lib/mockito-all-1.8.5.jar ./lib/mrunit-0.9.0-incubating-hadoop1.jar ./lib/mrunit-0.9.0-incubating-hadoop2.jar
./lib/slf4j-api-1.7.2.jar ./lib/slf4j-log4j12-1.7.2.jar" />
</manifest>
</jar>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment