ant学习笔记(四)

昨天在运行ant进行junit测试的时候不停的报错:    [junit] java.io.FileNotFoundException: junitvmwatcher***.properties (系统找不到指定的文件)然后怎么都查不出错误,今天早上也同样没有解决。而且只有<batchtest>才会出问题,<test>是OK的。

下面的是我的ant脚本,原来没有红色的一行。

<!-- run junit -->
<target name="junit" depends="compilejunit">
    <junit printsummary="yes" haltonfailure="yes" >
        <classpath>
            <fileset dir="${plugin.depend}">
                <include name="**/*.jar"/>
                <exclude name="**/ant*.jar"/>
            </fileset>
            <pathelement location="${junit.bin}"/>
        </classpath>

        <test name="${release.checher}"
                  haltonfailure="yes"
                  todir="${junit.report.dir}"
                  >
            <formatter type="xml"/>
        </test>

        <batchtest fork="yes"
                            todir="${junit.report.dir}"
                            haltonfailure="yes"
                            >
           <fileset dir="${junit.src}">
               <include name="**/*Test*.java"/>
           </fileset>
           <formatter type="xml"/>
        </batchtest>
         
    </junit>
</target> 

直到后来google,终于发现了问题所在:虽然系统环境变量中设置的是1.7.0的ant,但是在load需要的jar的时候load了eclipse自带的1.6.2的ant,而1.7.0是不会有这种问题的。<test>用的是现有的环境变量设置,所以不会有问题,而<batchtest>是fork出来,使用了<classpath>中的设置的。

发现了问题,解决起来自然很快,exclude旧版本的ant就行了~~如上红色:)

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值