I find the phrase "they are not transitive" a bit confusing here. Anyway, the way it should work is shown in the table at http://maven.apache.org/guides/introduction/introduction-to-dependency-mecha nism.html#Dependency_Scope, which shows that the scope of dependencies contributed by your 'provided' dependency should never be greater than 'provided'. In other words, you shouldn't be getting the transitive deps either... but I have no explanation as to why you might be! Are you sure some other dependency which is tighter than 'provided' isn't bringing them in?
Try running mvn dependency:tree on your project and seeing what it tells you. Jon > -----Original Message----- > From: monkeyden [mailto:[email protected]] > Sent: 24 July 2009 17:50 > To: [email protected] > Subject: Re: Primary and secondary dependencies > > > Based on this definition, which comes from the maven docs, I > should NOT get the "primary" dependency in my build, but what > about the transitive dependencies? Do you suggest I should > not be seeing this behavior when the primary dependency is > provided? thanks again. > > provided > provided dependencies are used when you expect the JDK or a > container to provide them. For example, if you were > developing a web application, you would need the Servlet API > available on the compile classpath to compile a servlet, but > you wouldn't want to include the Servlet API in the packaged > WAR; the Servlet API JAR is supplied by your application > server or servlet container. provided dependencies are > available on the compilation classpath (not runtime). They > are not transitive, nor are they packaged. > > > > > Juven Xu wrote: > > > > they are _transitive_ dependencies :) but you name them _secondary_ > > dependencies :) > > > > you would want to read this document: > > > http://www.sonatype.com/books/maven-book/reference/pom-relationships-s > > ect-project-dependencies.html > > > > On Sat, Jul 25, 2009 at 12:41 AM, monkeyden > <[email protected]> wrote: > > > >> > >> I have the scope of some 3rd party dependencies set to "provided", > >> but keep getting all the secondary dependencies in my > build. I have > >> 3 versions of ant, when I don't even need 1. > >> > >> How best to prevent secondary dependencies from being > added to the build? > >> > >> Do the secondary dependencies inherit scope from the primary > >> dependency or do they sneak in? I'd prefer not to > explicitly do any > >> of this for secondaries. > >> > >> thanks > >> -- > >> View this message in context: > >> > http://www.nabble.com/Primary-and-secondary-dependencies-tp24647841p2 > >> 4647841.html Sent from the Maven - Users mailing list archive at > >> Nabble.com. > >> > >> > >> > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [email protected] > >> For additional commands, e-mail: [email protected] > >> > >> > > > > > > -- > > - juven > > > > > > -- > View this message in context: > http://www.nabble.com/Primary-and-secondary-dependencies-tp246 47841p24647985.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
