2
votes

I have an Ant task that should copy some files and rename them on the fly. For example:

Copy "file1-1.0.2" and rename it to "file1", copy "file-2.5.1" and rename it to "file2".

To do this I'm trying to use 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>

When the Ant script runs, I get the following error:

The type doesn't support the nested "chainedmapper" element

Why does this error occur?

1
"works on my machine". What version of Ant are you using? ant -version - Stefan Bodewig

1 Answers

0
votes

I was using an old version of ant (1.6). The chainedmapper type is only available since Ant 1.7.0.

Ant Mapper Type