Re: inline use of antlib with namespace?

Alan Snyder <[email protected]> Mon, 21 Sep 2020 08:29:16 -0700
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
If I have to include the xmlns attribute at each use of a task from the library, then this is not what I want.

> On Sep 21, 2020, at 1:24 AM, Stefan Bodewig <[email protected]> wrote:
> 
> On 2020-09-13, Alan Snyder wrote:
> 
>> Given that I have installed an external ant task library in an appropriate location, I know of two ways to make the tasks accessible in a build script:
> 
>> 1. Add an xmlns attribute to some element, such as
> 
>>   <project ... xmlns:resolver="antlib:org.apache.maven.resolver.ant" ... >
> 
>> 2. Add a taskdef inline, such as
> 
>>  <taskdef resource="org/apache/maven/resolver/ant/antlib.xml"/>
> 
>> The first method puts the tasks in a separate namespace. The second method adds the tasks to the current namespace.
> 
>> What I would like is a method that can be used inline (like #2) and also puts the tasks in a separate namespace (like #1).
> 
> I think
> 
>  <taskdef resource="org/apache/maven/resolver/ant/antlib.xml"
>           uri="some-uri" />
> 
> does just that. Say the antlib defines a task foo you'd use it as
> 
>  <myprefix:foo xmlns:myprefix="some-uri"/>
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected] <mailto:[email protected]>
> For additional commands, e-mail: [email protected] <mailto:[email protected]>