maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Stembridge (JIRA)" <>
Subject [jira] Commented: (MANTTASKS-102) Provided scope doesn't filter out transitive dependencies
Date Sat, 05 Jan 2008 21:25:57 GMT


Kevin Stembridge commented on MANTTASKS-102:

Hi Herve,
I sent the following reply to you on the user's list but it got bounced as spam. 

Hi Herve,
Thanks for the reply.

I'm not so sure that the purpose of the Ant tasks is to specifically get transitive dependencies.
I would say that its purpose is to make use of Maven's dependency management features, transitive
dependencies being one of them, but scope recognition being another. (The first paragraph
on the Maven Ant Tasks site would seem to back me up on this  ). It seems to me that it is
failing on the scope recognition part of it. 

The documentation on the site is pretty clear that declaring a dependency with provided scope
is supposed to behave the same way for the Ant task as it does for Maven itself. So I think
we've got a bug here. Even if its not a bug, it would still be nice to implement this scope
recognition as per the Maven dependency mechanism. That would be much more preferable than
having to add exclusion elements or perform an Ant get. As a side note, I've decided to use
the Ant copy task to copy the artifacts directly from my local Maven repo.

I'm going to raise a JIRA for it and see what the dev team thinks. 
Thanks for your help and suggestions.


Here is the paragraph I am referring to from the top of the [Maven Ant Tasks site|]:

Maven comes with a set of Ant tasks that can be used to utilise Maven's artifact handling
features from within Ant. This includes:

    * Dependency management - including transitive dependencies, scope recognition and SNAPSHOT
    * ...

And from under the section that describes the dependencies task:

You can also specify a scope parameter on each dependency. This changes the behaviour of transitive
dependencies and is useful for building different types of classpaths. To see how it affects
the behaviour of the dependencies, see the  Dependency Mechanism  documentation in the Maven
2.0 site.

I don't think you should be closing this issue. My opinion is that the documentation is correct
and the ant tasks should be consistent with the Maven dependency mechanism. So either we have
a bug or the documentation needs to change.


> Provided scope doesn't filter out transitive dependencies
> ---------------------------------------------------------
>                 Key: MANTTASKS-102
>                 URL:
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: dependencies task
>    Affects Versions: 2.0.7
>            Reporter: Kevin Stembridge
>            Assignee: Herve Boutemy
>            Priority: Minor
> Copied from a posting to the Maven users list:
> I'm trying to use the dependencies ant task to copy artifacts to a given location but
I'm having trouble excluding transitive dependencies. 
> My understanding from the documentation is that I should be able to use the following
XML to copy an artifact, without its transitives. But, nothing at all gets copied.
> {code:xml}
> <target name="test">
>     <artifact:dependencies filesetId="copy.test.fileset" useScope="provided" verbose="true">
>         <dependency groupId="org.springframework" artifactId="spring" version="2.0.7"
>     </artifact:dependencies>
>     <copy todir="bogus" verbose="true">
>         <fileset refid="copy.test.fileset" />
>         <mapper type="flatten" />
>     </copy>
> </target>
> {code}
> I've tried the following combinations of the useScope and scope attributes:
> ||useScope || scope || Result||
> |provided | provided | Nothing copied|
> |provided | runtime | Nothing copied|
> |provided | compile | Nothing copied|
> |runtime | provided | Nothing copied|
> |runtime | runtime | Dependency and transitives copied|
> |runtime | compile | Dependency and transitives copied|
> |compile | provided | Dependency and transitives copied|
> |compile | runtime | Nothing copied|
> |compile | compile | Dependency and transitives copied|
> Note that none of these configurations gives me a dependency without any transitives.
I understand that I can specify exclusion elements to exclude all the transitives but it seems
to me that specifying provided scope is supposed to achieve the same goal, and would be much

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message