Artículo
Fecha: 2010-03-02 10:33:33
How to create a runnable jar using an ant task
Example of how to create a runnable jar using an ant task (also the lib jar used are going to be included in the jar file):
<target name="create_run_jar" depends="compile">
<jar destfile="dist/test.jar" filesetmanifest="mergewithoutmain">
<fileset dir="properties">
<include name="properties/*.properties"/>
</fileset>
<manifest>
<attribute name="Built-By" value="company"/>
<attribute name="Implementation-Title" value="tester"/>
<attribute name="Implementation-Version" value="1.0.0"/>
<attribute name="Main-Class" value="com.company.Test"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="build"/>
<zipfileset excludes="META-INF/*.SF" src="lib/activation.jar"/>
<zipfileset excludes="META-INF/*.SF" src="lib/commons-collections-3.2.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="lib/commons-discovery-0.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="lib/commons-httpclient-3.0-rc2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="lib/commons-lang-2.3.jar"/>
<zipfileset excludes="META-INF/*.SF" src="lib/commons-logging.jar"/>
<zipfileset excludes="META-INF/*.SF" src="lib/jcert.jar"/>
<zipfileset excludes="META-INF/*.SF" src="lib/jnet.jar"/>
...
</jar>
</target>
|
Autor:Jose Miguel Bataller
Buscador
Últimas entradas
Preseleccionar un option de un element select html con jQuery »
Testing for Empty elements in XSL »
Java Keytool Commands for Managing security certificates »
Execute servlet filter before calling Axis web service »
Set trustStore for SSL connection in Java »
Example of a client-wsdd.config »
Convert Axis Java Object to XML »