我的 ant-contrib-0.3 中没有 antlib.xml [英] There isn't antlib.xml in my ant-contrib-0.3

查看:17
本文介绍了我的 ant-contrib-0.3 中没有 antlib.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用任务 for.我尝试使用此任务定义:

I am trying to use task for. I tried with this task definition:

    <taskdef resource="net/sf/antcontrib/antlib.xml">
        <classpath>
            <pathelement location="${infrastructure-base-dir}/apache-ant-1.9.6/lib/ant-contrib-0.3.jar"/>
        </classpath>
    </taskdef>

但是没有用.出现此消息:

But didn't work. This message appear:

问题:创建任务或类型失败

Problem: failed to create task or type for

所以我决定解压 ant-contrib-0.3.jar 看看里面有什么.并且此路径中没有 antlib.xml:net/sf/antcontrib/.那么,为了让 task FOR 工作,你会给我什么建议?

So I decider to unzip ant-contrib-0.3.jar to see what's inside. And there wasn't antlib.xml in this path: net/sf/antcontrib/. So what would you advise me in order to make task FOR to work?

推荐答案

试试这个:

  1. 在你的 build.xml 中

  1. In your build.xml

<taskdef name="for-contrib" classname="net.sf.antcontrib.logic.ForTask" classpath="${basedir}/lib/ant-contrib-1.0b3.jar"/>

将 jar 文件放置在正确的位置,即与 build.xml 处于同一级别的 lib 文件夹中.

Place jar file file in correct location, i.e. in lib folder at same level as build.xml.

根据需要使用 for,即

Use the for as needed, i.e

<顺序><echo>Letter@{letter}</echo></顺序></for>

用于任务文档

这篇关于我的 ant-contrib-0.3 中没有 antlib.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆