Ant打包时,如何保留类文件内容的行号

有时候将自己的程序打包成jar文件作为类库调用,出错时,遇到自己的jar包里的类文件报异常信息时,无法打印出行号,而是(Unknown Source)

解决办法:在编译任务中加上如下参数debug="true" debuglevel="lines,vars,source"

例如:

<target name="compile" depends="prepare" description="编绎源码">
   <javac encoding="utf-8" destdir="${build.dir}" source="1.5" target="1.5"
        deprecation="false" optimize="false" failοnerrοr="true"
        debug="true" debuglevel="lines,vars,source">
     <src refid="src-paths" />
     <classpath refid="lib-paths" />
   </javac>

   <copy todir="${build.dir}" preservelastmodified="true">
     <fileset dir="${src.dir}">
       <include name="**/*.txt"/>
       <include name="**/*.xml"/>
       <include name="**/*.dtd"/>
       <include name="**/*.properties"/>
     </fileset>
   </copy>
</target>

转载于:https://www.cnblogs.com/jadmin/archive/2010/03/14/2206014.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值