You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Carlton Brown <cb...@silverpop.com> on 2009/10/31 10:56:39 UTC

Question on semantics of rules in Ivy 2.1.0

Greetings all,

 

I have a resolution chain containing Maven central, but my company's
modules are published internally only, hence I wish to avoid searching
Maven central for artifacts in the 'mycompany' organization, and vice
versa.

 

The first case is easy... I just define 

<module organisation="mycompany" name=".*" resolver="integration"/>

 

And everything is good.

 

The problem is when I wish to have Ivy use a subset of 2 resolvers for
non-'mycompany' artifacts.

 

For just one resolve, a zero-width negative lookahead seems sufficient:

<module organisation="^(?!mycompany).*" name=".*"
resolver="thirdparty"/>

 

But it seems that I can't apply more this regex to more than one
resolver.   If I use multiple rules, only the first rule is observed:

<module organisation="^(?!mycompany).*" name=".*"
resolver="thirdparty"/>

<module organisation="^(?!mycompany).*" name=".*" resolver="public"/> 

 

The result is that Ivy matches artifacts in 'thirdparty' but not in
'public'.

 

What is the correct semantics to use in this case?

 

Thanks,

Carlton

 

 



***CONFIDENTIALITY NOTICE and DISCLAIMER*** 
This message and any attachment are confidential and may be
privileged or otherwise protected from disclosure and solely for
the use of the person(s) or entity to whom it is intended. If you
have received this message in error and are not the intended
recipient, please notify the sender immediately and delete this
message and any attachment from your system. If you are not the
intended recipient, be advised that any use of this message is
prohibited and may be unlawful, and you must not copy this
message or attachment or disclose the contents to any other person.

RE: Re: Question on semantics of rules in Ivy 2.1.0

Posted by Carlton Brown <cb...@silverpop.com>.
> -----Original Message-----
> From: news [mailto:news@ger.gmane.org] On Behalf Of Tom Widmer
> Sent: Monday, November 02, 2009 8:38 AM
> To: ivy-user@ant.apache.org
> Subject: Re: Question on semantics of <module> rules in Ivy 2.1.0
> 
> > But it seems that I can't apply more this regex to more than one
> > resolver.   If I use multiple rules, only the first rule is
observed:
> >
> > <module organisation="^(?!mycompany).*" name=".*"
> > resolver="thirdparty"/>
> >
> > <module organisation="^(?!mycompany).*" name=".*"
resolver="public"/>
> >
> >
> >
> > The result is that Ivy matches artifacts in 'thirdparty' but not in
> > 'public'.
> >
> >
> >
> > What is the correct semantics to use in this case?
> 
> Set up a chain resolver containing thirdparty and public, and
reference
> that in your module element. e.g.
> 
> <module organisation="^(?!mycompany).*" name=".*"
> resolver="non-mycompany"/>
> 
> <chain name="non-mycompany" returnFirst="true">
>    <resolver ref="thirdparty"/>
>    <resolver ref="public"/>
> </chain>

Clever idea.. I'll give it a try.

***CONFIDENTIALITY NOTICE and DISCLAIMER*** 
This message and any attachment are confidential and may be
privileged or otherwise protected from disclosure and solely for
the use of the person(s) or entity to whom it is intended. If you
have received this message in error and are not the intended
recipient, please notify the sender immediately and delete this
message and any attachment from your system. If you are not the
intended recipient, be advised that any use of this message is
prohibited and may be unlawful, and you must not copy this
message or attachment or disclose the contents to any other person.

Re: Question on semantics of rules in Ivy 2.1.0

Posted by Tom Widmer <to...@googlemail.com>.
Carlton Brown wrote:
> Greetings all,
> 
>  
> 
> I have a resolution chain containing Maven central, but my company's
> modules are published internally only, hence I wish to avoid searching
> Maven central for artifacts in the 'mycompany' organization, and vice
> versa.
> 
>  
> 
> The first case is easy... I just define 
> 
> <module organisation="mycompany" name=".*" resolver="integration"/>
> 
>  
> 
> And everything is good.
> 
>  
> 
> The problem is when I wish to have Ivy use a subset of 2 resolvers for
> non-'mycompany' artifacts.
> 
>  
> 
> For just one resolve, a zero-width negative lookahead seems sufficient:
> 
> <module organisation="^(?!mycompany).*" name=".*"
> resolver="thirdparty"/>
> 
>  
> 
> But it seems that I can't apply more this regex to more than one
> resolver.   If I use multiple rules, only the first rule is observed:
> 
> <module organisation="^(?!mycompany).*" name=".*"
> resolver="thirdparty"/>
> 
> <module organisation="^(?!mycompany).*" name=".*" resolver="public"/> 
> 
>  
> 
> The result is that Ivy matches artifacts in 'thirdparty' but not in
> 'public'.
> 
>  
> 
> What is the correct semantics to use in this case?

Set up a chain resolver containing thirdparty and public, and reference 
that in your module element. e.g.

<module organisation="^(?!mycompany).*" name=".*" 
resolver="non-mycompany"/>

<chain name="non-mycompany" returnFirst="true">
   <resolver ref="thirdparty"/>
   <resolver ref="public"/>
</chain>

Tom