Java Snippet - ANT Jar Task

Builds a JAR file Test.jar and generates a manifest specifying that class Test is the Main-Class.

<target name="dist" depends="dist-clean">
    <jar jarfile="Test.jar" index="true" compress="true">
        <fileset dir="classes"/>
        <fileset dir=".">
            <include name="Test.properties"/>
        </fileset>
        <manifest>
            <attribute name="Built-By" value="Michael Cutler"/>
        <attribute name="Main-Class" value="Test"/>
        </manifest>
    </jar>
</target>


About this entry