https://bz.apache.org/bugzilla/show_bug.cgi?id=57719

--- Comment #1 from Stefan Bodewig <[email protected]> ---
This applies to all nested elements of tasks that are using the createXYZ()
method rather than the addXYZ() variant.  This means in order to change this
we'd need to modify all Ant tasks using create(), which is certainly possible
for Ant's own tasks but not for third party tasks.

The "create" variant is there so that tasks can have full control over the
classloader they use.  I don't think this applies to the Mapper case so it may
be possible to replace create with add - but that would be breaking API
backwards compatibility.

Are you using the <mapper class="xxxx"/> way of specifying the mapper?  If your
class implements FileNameMapper you should be able to typedef it and add it to
copy directly (since it also contains an add method for FileNameMapper) and use
the core loader.  This would also work for all other tasks supporting mappers
since <mapper> itself has an add method for FileNameMapper.

So rather than

<copy>
  <mapper classname="foo.bar.Mapper"/>
</copy>

you'd use

<typedef name="mymapper" classname="foo.bar.Mapper"/>
<copy>
  <mymapper/>
</copy>

or 

<typedef name="mymapper" classname="foo.bar.Mapper"/>
<copy>
  <mapper>
    <mymapper/>
  </mapper>
</copy>

and should be able to control the classloader used for the typedef.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to