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 Chris Nokes <no...@yahoo.com> on 2009/07/22 05:20:01 UTC

Possible to perform a dependency subtraction?

Here's the confs for a module I depend on:
    runtime
    web extends runtime

"runtime" represents the jars to be added to the EAR.
"web" represents the compile classpath for the module.  Web must extend runtime because I want the jar set of runtime and web to be binary compatible and resolve conflicts.

I would like to do the following in my target module:
webPackaging->web,!runtime


"webPackaging" represents the jars to be added to the WAR.  !runtime means do not add any jars from the runtime conf.

Is there a way to do this with Ivy?

Thanks,
Chris Nokes


      

Re: Possible to perform a dependency subtraction?

Posted by Gareth Western <ga...@garethwestern.com>.
Hi Chris,

I've recently done this for our webapps, with almost exactly the same
configurations as you. All you need to do is distinguish between the
two confs in your list of dependencies. For example:

Module A is a jar (two configurations: jar and runtime) and has the
following dependencies:
    <dependency org="ojdbc" name="ojdbc" rev="1.4" conf="runtime->default"/>
    <dependency org="cewolf" name="cewolf" rev="0.9.8" conf="jar->default"/>

Module B is a webapp (two configurations: web and runtime) and has a
dependency on A:
<dependency org="com.garethwestern" name="moduleA"
conf="web->jar;runtime->runtime" />

Now Module B's "web" configuration WILL NOT bring the ojdbc
dependency, but WILL bring the cewolf one.

Does that help?

On Wed, Jul 22, 2009 at 4:20 AM, Chris Nokes<no...@yahoo.com> wrote:
> Here's the confs for a module I depend on:
>     runtime
>     web extends runtime
>
> "runtime" represents the jars to be added to the EAR.
> "web" represents the compile classpath for the module.  Web must extend runtime because I want the jar set of runtime and web to be binary compatible and resolve conflicts.
>
> I would like to do the following in my target module:
> webPackaging->web,!runtime
>
>
> "webPackaging" represents the jars to be added to the WAR.  !runtime means do not add any jars from the runtime conf.
>
> Is there a way to do this with Ivy?
>
> Thanks,
> Chris Nokes
>
>
>
>

Re: Possible to perform a dependency subtraction?

Posted by Joshua Tharp <jo...@alumni.calpoly.edu>.
You may not need/want the visibility to be private, I just tend to do that
when I have a configuration whose purpose is support and is not really meant
to be used outside of the current module.

On Tue, Jul 21, 2009 at 8:51 PM, Joshua Tharp <
joshua-tharp@alumni.calpoly.edu> wrote:

> Might you achieve the same thing with three configurations instead?
>
> <conf name="base" visibility="private" />
> <conf name="runtime" extends="base" />
> <conf name="web" extends="base" />
>
>
> On Tue, Jul 21, 2009 at 8:20 PM, Chris Nokes <no...@yahoo.com> wrote:
>
>> Here's the confs for a module I depend on:
>>     runtime
>>     web extends runtime
>>
>> "runtime" represents the jars to be added to the EAR.
>> "web" represents the compile classpath for the module.  Web must extend
>> runtime because I want the jar set of runtime and web to be binary
>> compatible and resolve conflicts.
>>
>> I would like to do the following in my target module:
>> webPackaging->web,!runtime
>>
>>
>> "webPackaging" represents the jars to be added to the WAR.  !runtime means
>> do not add any jars from the runtime conf.
>>
>> Is there a way to do this with Ivy?
>>
>> Thanks,
>> Chris Nokes
>>
>>
>>
>>
>

Re: Possible to perform a dependency subtraction?

Posted by Joshua Tharp <jo...@alumni.calpoly.edu>.
Might you achieve the same thing with three configurations instead?

<conf name="base" visibility="private" />
<conf name="runtime" extends="base" />
<conf name="web" extends="base" />

On Tue, Jul 21, 2009 at 8:20 PM, Chris Nokes <no...@yahoo.com> wrote:

> Here's the confs for a module I depend on:
>     runtime
>     web extends runtime
>
> "runtime" represents the jars to be added to the EAR.
> "web" represents the compile classpath for the module.  Web must extend
> runtime because I want the jar set of runtime and web to be binary
> compatible and resolve conflicts.
>
> I would like to do the following in my target module:
> webPackaging->web,!runtime
>
>
> "webPackaging" represents the jars to be added to the WAR.  !runtime means
> do not add any jars from the runtime conf.
>
> Is there a way to do this with Ivy?
>
> Thanks,
> Chris Nokes
>
>
>
>