ant 打jar包

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
              Any modifications will be overwritten.
              To include a user specific buildfile here, simply create one in the same
              directory with the processing instruction <?eclipse.ant.import?>
              as the first entry and export the buildfile again. -->
              <project basedir="." default="jar" name="Utility">
    <property environment="env"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.8"/>
    <property name="source" value="1.8"/>
         <!-- 构建路径 -->
    <path id="Maven Dependencies.libraryclasspath">
         <fileset dir="../lib"></fileset>
    </path>
    <path id="Utility.classpath">
        <pathelement location="target/classes"/>
        <path refid="Maven Dependencies.libraryclasspath"/>
    </path>
                  
       <!-- 初始化 -->
    <target name="init" depends="clean">
        <mkdir dir="target/classes"/>
        <copy includeemptydirs="false" todir="target/classes">
            <fileset dir="src/main/java"></fileset>
        </copy>
    </target>
    <target name="clean">
        <delete dir="target/classes"/>
    </target>
                <!-- 编译 -->
    <target depends="init" name="build-project">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac encoding="utf-8" debug="true" debuglevel="${debuglevel}" destdir="target/classes" includeantruntime="false" source="${source}" target="${target}">
            <src path="src/main/java"/>
            <classpath refid="Utility.classpath"/>
        </javac>
    </target>
                <!-- 打jar包 -->
        <target name="jar" depends="build-project">
               <jar destfile="target/Utility.jar" basedir="target/classes">    
                </jar> 
        </target>      
                  
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
</project>
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值