ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Nesbitt <>
Subject Re: first question about dependency confs
Date Wed, 28 Feb 2007 22:05:41 GMT
On Wednesday 28 February 2007 12:51:16 pm Matt Benson wrote:
> ACK!  I think I get it now.  The dependency conf, duh,
> shows for each local conf in which this dependency is
> required, what is the corresponding conf of the
> dependency, right?
> Sorry for the stupid question.  ;)
> -Matt


Take modules BAR and BAZ

BAR declares an artifact FOO with a conf = client. BAR is essentially 
saying "I publish an artifact FOO and I expect that depednents will use 
me as a client".

Now take module BAZ which declares two configurations - compilation and 
test - with a dependency on FOO when testing. BAZ is basically saying "I 
am dependent on the artifact FOO from module BAR in the context of 
testing, but not in the context of compilation."

To declare this dependency I need to add a dependency element in BAZ's ivy 
file. Since I only need BAR in the context of testing I will set the conf 
on the dependency to test: <dependency name="BAR" conf="test" />.

Now Ivy goes to work. I tell Ivy I am working in the test context (request 
the test conf). Ivy scans the dependencies and sees that when in the test 
context BAZ has a dependency on BAR. Ivy then scans BAR looking for 
artifacts that BAR publishes with the "test" conf. But wait a minute, BAR 
doesn't publish any artifacts for the test conf so when I do an Ivy 
resolve in the test context I don't get FOO(FOO has a conf of client not 

To fix this I need to declare a mapping, and tell Ivy that 1) I have a 
dependency on BAR in the test context and 2) that when resolving BAR 
artifacts in the test context I should look for BAR artifacts with a conf 
of client. Ergo:
<dependency name="BAR" conf="test->client" />


Stephen Nesbitt
CM Architect/Lead
The Cobalt Group

View raw message