You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stuart Sierra <th...@gmail.com> on 2012/01/15 18:12:09 UTC

Restricting versions of transitive dependencies

Hello, list!

I have a project A that has a dependency on library B. Library B has a
dependency on library C with a version range like [2.1,3.0). I want to
pin library C to a specific version in my project A. But I also want
to declare, in the POM, that library C is not a *direct* dependency of
my project A. Is there a way to do this?

Thanks,
-Stuart

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


Re: Restricting versions of transitive dependencies

Posted by Ron Wheeler <rw...@artifact-software.com>.
Why?
What problem are you actually trying to solve?
It sounds like you know the right way to do it already but don't want to.

Ron


On 15/01/2012 12:12 PM, Stuart Sierra wrote:
> Hello, list!
>
> I have a project A that has a dependency on library B. Library B has a
> dependency on library C with a version range like [2.1,3.0). I want to
> pin library C to a specific version in my project A. But I also want
> to declare, in the POM, that library C is not a *direct* dependency of
> my project A. Is there a way to do this?
>
> Thanks,
> -Stuart
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102



Re: Restricting versions of transitive dependencies

Posted by Ansgar Konermann <an...@googlemail.com>.
Am 15.01.2012 18:13 schrieb "Stuart Sierra" <th...@gmail.com>:
>
> Hello, list!
>
> I have a project A that has a dependency on library B. Library B has a
> dependency on library C with a version range like [2.1,3.0). I want to
> pin library C to a specific version in my project A. But I also want
> to declare, in the POM, that library C is not a *direct* dependency of
> my project A. Is there a way to do this?

Add C to A's dependencyManagement section with the version you desire.

HTH

Regards

Ansgar

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