On 2026-08-09, Jaikiran Pai wrote:

> Hello Stefan,
> My worries with introducing any feature related to classloaders is
> that as soon as it gets used widely, chances are that users will run
> into odd classloading issues either due to advanced usages or just
> because of the complexity involved with classloaders.

True

> I wasn't aware we had a "classloader" task already. If that works
> currently for the AntLibs usage, then I think we should use it.

Just to be clear. I'm not so much concerned of the Antlib's build
process, rather of how we document people shall use the Antlib and its
Ivy feature (assuming people outside of the Ant projec will ever us it).

Apart from the simple options of

- putting Ivy on the system classloader
- defining the Antlib without ever using Ivy before defining it
- performing the "define Ivy twice dance" I currently use in my PR

I see (leaving out details of paths)

    <taskdef resource="org/apache/ivy/ant/antlib.xml"
             uri="antlib:org.apache.ivy.ant"
             loaderRef="ivy.loader"/>
    <typedef uri="antlib:org.apache.ant.cyclonedx"
             resource="org/apache/ant/cyclonedx/antlib.xml"
             loaderRef="cdx.loader" parentLoaderRef="ivy.loader"/>

or

    <taskdef resource="org/apache/ivy/ant/antlib.xml"
             uri="antlib:org.apache.ivy.ant"
             loaderRef="ivy.loader"/>
    <classloader name="cdx.loader" parentName="ivy.loader/>
    <typedef uri="antlib:org.apache.ant.cyclonedx"
             resource="org/apache/ant/cyclonedx/antlib.xml"
             loaderRef="cdx.loader"/>

and I don't think we can put the last option into the docs of the Antlib
without also documenting the classloader task which will make it more
official than it is today.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to