You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Munoz, Pablo" <Pa...@rodale.com> on 2007/01/18 23:55:03 UTC

Turning off transitive dependencies in Maven2

Help,
 
I need to figure out how to turn off transitive dependencies in Maven 2.  I know which libs I need and don't need any transitive dependencies.  Its causing a lot of problem and rather than trying to figure out what should be excluded from about 70 dependencies I'd like to just turn off this feature.  Please help!
 
Thanks,
 
Pablo Muñoz | Rodale, Inc. | 733 3rd Ave, New York, NY | 212.573.0349 | aimpmunoz
 

Re: Turning off transitive dependencies in Maven2

Posted by franz see <fr...@gmail.com>.
Good day, 

You can turn off transitive dependencies of a direct dependency via the
exclusions tag ( see [1] ).  However, that may be too troublesome if you
want to turn it off completely since you have declare each transitive
dependency to exclude from each direct dependency.

To know what dependencies are derived, you can use the -X option ( i.e. mvn
install -X ) and view the debug logs, do an mvn site and check the
dependency reports, or if your mvn site takes too long to finish ( i.e.
creates other reports such as javadoc ), do a mvn
project-info-reports:dependencies ( which will produce the dependency
reports only ).

The best approach however for you would probably to declare all those
dependencies on your project. Maven will always prefer the direct dependency
over the transitive ones. The more "direct" a dependency is, the higher its
priority ( see [2] ).

Cheers,
Franz

[1]
http://maven.apache.org/ref/current/maven-model/maven.html#class_exclusion
[2] http://docs.codehaus.org/display/MAVENUSER/Dependency+Mechanism


Wayne Fay wrote:
> 
> (As Patrick stated...) Unless something significant has changed that
> I'm unaware of, you can't turn off transitive dependencies.
> 
> Instead, you will need to generate the entire list (run mvn site and
> check the dependencies report), find the transitive dependencies you
> don't need, and add exclusions on those artifacts to your pom.
> 
> Wayne
> 
> On 1/18/07, Patrick Schneider <ps...@gmail.com> wrote:
>> I believe creating an exclusion list is your only option.  Transitive
>> dependency resolution is not switchable, as far as I know.
>>
>>
>> Patrick
>>
>> On 1/18/07, Munoz, Pablo <Pa...@rodale.com> wrote:
>> >
>> > Help,
>> >
>> > I need to figure out how to turn off transitive dependencies in Maven
>> > 2.  I know which libs I need and don't need any transitive
>> > dependencies.  Its causing a lot of problem and rather than trying to
>> figure
>> > out what should be excluded from about 70 dependencies I'd like to just
>> turn
>> > off this feature.  Please help!
>> >
>> > Thanks,
>> >
>> > Pablo Muñoz | Rodale, Inc. | 733 3rd Ave, New York, NY | 212.573.0349 |
>> > aimpmunoz
>> >
>> >
>> >
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Turning-off-transitive-dependencies-in-Maven2-tf3037242s177.html#a8441979
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Turning off transitive dependencies in Maven2

Posted by Wayne Fay <wa...@gmail.com>.
(As Patrick stated...) Unless something significant has changed that
I'm unaware of, you can't turn off transitive dependencies.

Instead, you will need to generate the entire list (run mvn site and
check the dependencies report), find the transitive dependencies you
don't need, and add exclusions on those artifacts to your pom.

Wayne

On 1/18/07, Patrick Schneider <ps...@gmail.com> wrote:
> I believe creating an exclusion list is your only option.  Transitive
> dependency resolution is not switchable, as far as I know.
>
>
> Patrick
>
> On 1/18/07, Munoz, Pablo <Pa...@rodale.com> wrote:
> >
> > Help,
> >
> > I need to figure out how to turn off transitive dependencies in Maven
> > 2.  I know which libs I need and don't need any transitive
> > dependencies.  Its causing a lot of problem and rather than trying to figure
> > out what should be excluded from about 70 dependencies I'd like to just turn
> > off this feature.  Please help!
> >
> > Thanks,
> >
> > Pablo Muñoz | Rodale, Inc. | 733 3rd Ave, New York, NY | 212.573.0349 |
> > aimpmunoz
> >
> >
> >
>
>

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


Re: Turning off transitive dependencies in Maven2

Posted by Patrick Schneider <ps...@gmail.com>.
I believe creating an exclusion list is your only option.  Transitive
dependency resolution is not switchable, as far as I know.


Patrick

On 1/18/07, Munoz, Pablo <Pa...@rodale.com> wrote:
>
> Help,
>
> I need to figure out how to turn off transitive dependencies in Maven
> 2.  I know which libs I need and don't need any transitive
> dependencies.  Its causing a lot of problem and rather than trying to figure
> out what should be excluded from about 70 dependencies I'd like to just turn
> off this feature.  Please help!
>
> Thanks,
>
> Pablo Muñoz | Rodale, Inc. | 733 3rd Ave, New York, NY | 212.573.0349 |
> aimpmunoz
>
>
>