<copy>不支持Ant </copy>中嵌套的“chainedmapper”错误

时间:2015-02-18 18:04:07

标签: ant

我有一个Ant任务,应该复制一些文件并动态重命名。例如:

  

复制“file1-1.0.2”并将其重命名为“file1”,复制“file-2.5.1”并将其重命名为“file2”。

要做到这一点,我正在尝试使用copy + fileset + chainedmapper + globmapper:

<copy todir="${version.dir}/WEB-INF/lib/" failonerror="false">
    <fileset dir="${version.dir}/WEB-INF/lib/" casesensitive="yes">
       <include name="file1-*.jar"/>
       <include name="file2-*."/>
       <include name="taxclient-v2-v2014-server-*.jar"/>
    </fileset>
    <chainedmapper>
       <globmapper from="file1-*.jar" to="file1.jar"/>
       <globmapper from="file2-*.jar" to="file2.jar"/>
    </chainedmapper>
</copy>

当Ant脚本运行时,我收到以下错误:

  

该类型不支持嵌套的“chainedmapper”元素

为什么会出现此错误?

1 个答案:

答案 0 :(得分:0)

我使用的是旧版本的ant(1.6)。 chainedmapper类型仅在Ant 1.7.0之后可用。

Ant Mapper Type

相关问题