You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Clifton Craig <cc...@icsaward.com> on 2006/04/24 21:14:58 UTC

Conditional dependencies in M2

Hello all,

I am converting from Ant/Ivy to Maven2 and I have a question regarding 
dependencies in Maven2. In Ivy I could define dependencies which would be 
conditionally considered based on my build configuration. for example, I 
could define in a project Foo, a dependency on Bar for all configurations and 
a dependecy on Box for the test configuration of project Foo. Then, another 
project, say Fuzz, could depend on Foo and use either its default 
configuration (which would transitivly bring in Bar but not Box)  or use its 
test configuration (which would transitivly bring in Bar AND Box). How is 
this done in Maven? I read up on profiles and I'm wondering if that's the 
answer, or if there's a more straight foward way of doing the same. Could 
somebody provide an example of a Maven equivalent? Thanx in advance.

--------------------------------------------------- 
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
ccc@icsaward.com
ccraig@gbg.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Conditional dependencies in M2

Posted by Alexandre Poitras <al...@gmail.com>.
This is what you are looking for :
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

On 4/24/06, Clifton Craig <cc...@icsaward.com> wrote:
> Hello all,
>
> I am converting from Ant/Ivy to Maven2 and I have a question regarding
> dependencies in Maven2. In Ivy I could define dependencies which would be
> conditionally considered based on my build configuration. for example, I
> could define in a project Foo, a dependency on Bar for all configurations and
> a dependecy on Box for the test configuration of project Foo. Then, another
> project, say Fuzz, could depend on Foo and use either its default
> configuration (which would transitivly bring in Bar but not Box)  or use its
> test configuration (which would transitivly bring in Bar AND Box). How is
> this done in Maven? I read up on profiles and I'm wondering if that's the
> answer, or if there's a more straight foward way of doing the same. Could
> somebody provide an example of a Maven equivalent? Thanx in advance.
>
> ---------------------------------------------------
> Clifton C. Craig, Software Engineer
> Intelligent Computer Systems - A Division of GBG
> ccc@icsaward.com
> ccraig@gbg.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org