用ant打包可运行的jar文件 (将第三方jar包放进你自己的jar包)

http://blog.csdn.net/caiqcong/article/details/7618582

<span style="font-family:SimSun;font-size:12px;"><?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="create_run_jar" name="Create Runnable Jar for Project SeleniumAutomation-3.1">
    <!--this file was created by Eclipse Runnable JAR Export Wizard-->
    <!--ANT 1.7 is required                                        -->
    <target name="create_run_jar">
        <jar destfile="C:/Users/topcat/Desktop/111.jar" filesetmanifest="mergewithoutmain">
            <manifest>
                <attribute name="Main-Class" value="com.safx.processor.Starter"/>
                <attribute name="Class-Path" value="."/>
            </manifest>
            <fileset dir="D:/SeleniumAutomation/SAFX-3.1/bin"/>
            <zipfileset excludes="META-INF/*.SF" src="D:/SeleniumAutomation/SAFX-3.1/lib/jaxen-1.1-beta-6.jar"/>
            <zipfileset excludes="META-INF/*.SF" src="D:/SeleniumAutomation/SAFX-3.1/lib/log4j-1.2.16.jar"/>
            <zipfileset excludes="META-INF/*.SF" src="D:/SeleniumAutomation/SAFX-3.1/lib/mail.jar"/>
            <zipfileset excludes="META-INF/*.SF" src="D:/SeleniumAutomation/SAFX-3.1/lib/testng-6.0.1.jar"/>
            <zipfileset excludes="META-INF/*.SF" src="D:/SeleniumAutomation/SAFX-3.1/lib/dom4j-1.6.1.jar"/>
            <zipfileset excludes="META-INF/*.SF" src="D:/SeleniumAutomation/SAFX-3.1/lib/guava-r09.jar"/>
            <zipfileset excludes="META-INF/*.SF" src="D:/SeleniumAutomation/SAFX-3.1/lib/jxl.jar"/>
            <zipfileset excludes="META-INF/*.SF" src="D:/SeleniumAutomation/SAFX-3.1/lib/selenium-java-2.21.0.jar"/>
        </jar>
    </target>
</project>
</span>
原文地址:https://www.cnblogs.com/stono/p/4684265.html