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