maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Baptiste MATHUS ...@batmat.net>
Subject Re: Transitive Dependency Question
Date Mon, 03 Jun 2013 17:53:17 GMT
Hi,
Tree is showing the tree. So it seems correct at first sight. Its showing
you the dependency beetween your test-utils of the project and junit which
is in fact scope compile.

What you seem to actually want to have is the resolved list of dependencies
for your application project.
That goal is called dependency:list.

Hope this helps.

Cheers

-- Baptiste
Le 3 juin 2013 19:21, "Jamal B" <jm15119b@gmail.com> a écrit :

> Hello, I have a question about transitive dependencies.  According to the
> pom documentation here: http://maven.apache.org/pom.html#Dependencies
>
> project dependencies marked with test scope are not transitive.  I assumed
> that this also applied to it's dependencies, so my question is if I declare
> a dependency on a project at test scope, that project's dependencies should
> all be included at test scope.  For example, given the following project(s)
>
> Project test-utils defines a junit dependency like such:
>
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> </dependency>
>
> Project application defines a dependency on test-utils with a scope of test
> like such
> <dependency>
> <groupId>${project.groupId}</groupId>
> <artifactId>test-utils</artifactId>
> <version>${project.version}</version>
> <scope>test</scope>
> </dependency>
>
> Now running mvn clean dependency:tree shows that the junit dependency is
> being passed to the application project at compile scope which is not
> expected.
>
> [INFO] --- maven-dependency-plugin:2.7:tree (default-cli) @ application ---
> [INFO] org.sandbox:application:war:1.0.0-SNAPSHOT
> ....
> [INFO] \- org.sandbox:test-utils:jar:1.0.0-SNAPSHOT:test
> [INFO]    +- junit:junit:jar:4.8.2:compile
> [INFO]    +- org.mockito:mockito-all:jar:1.8.5:test
> [INFO]    +- com.h2database:h2:jar:1.3.165:test
> [INFO]    \- log4j:log4j:jar:1.2.16:test
>
>
> Is this a bug or was my interpretation of the transitive dependency logic
> incorrect?
>
> Thank you for your time.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message