Hi Kevin,

Strange question: the purpose of Maven Ant Tasks is specifically to get 
transitive dependency! :)

But if that's really what you want, I see 2 ways of doing it:

1. use exclusions to exclude transitive dependencies you don't want
<dependency groupId="org.springframework" artifactId="spring" version="2.0.7" 
scope="provided">
  <exclusion groupId="" artifactId=""/>
</dependency>

2. don't use Maven Ant Tasks but simply Ant's get task
<get 
src="http://repo1.maven.org/maven2/org/springframework/spring/2.0.7/spring-2.0.7.jar";
 
dest="bogus"/>

regards,

Hervé

Le lundi 03 décembre 2007, Kevin Stembridge a écrit :
> Hi all,
> 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.
>
>     <target name="test">
>
>         <artifact:dependencies filesetId="copy.test.fileset"
> useScope="provided" verbose="true">
>             <dependency groupId="org.springframework"
> artifactId="spring" version="2.0.7" scope="provided"/>
>         </artifact:dependencies>
>
>         <copy todir="bogus" verbose="true">
>             <fileset refid="copy.test.fileset" />
>             <mapper type="flatten" />
>         </copy>
>
>     </target>
>
>
> 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 nicer.
>
> If anyone can shed some light on why this isn't working for me that
> would be great.
>
> Cheers,
> Kevin



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to