Gradle doesn't include transitive dependencies

I'm trying to use spring-test-mvc for testing a controller in my little application. Since I use gradle as build tool I added the dependency to it like this:

testCompile 'org.springframework:spring-test-mvc:1.0.0.M1'

It succeeds to retrieve spring-test-mvc, and compile the tests. But executing the tests fails, because it doesn't seem to include transient dependencies like mvc test.

Among others it complains about not finding

org.springframework.mock.web.MockHttpServletRequest

Which is part of the spring-test.jar, which is included as a dependency in spring-test-mvc s pom.xml https://github.com/SpringSource/spring-test-mvc/blob/master/pom.xml

I can fix that problem by including the dependency explicitely in the build file:

testCompile 'org.springframework:spring-test:3.1.1.RELEASE'

But it just gets replaced by the next problem. I tried to explicitly ask for transient dependencies:

testCompile ('org.springframework:spring-test-mvc:1.0.0.M1') {
        transitive = true
    }

But that doesn't seedm to change anything.

So the question is: How do I get gradle to include transitive dependencies in the classpath.

Note: Transitive dependencies seem to work fine outside of tests.

Answers


It's a problem with the POM. http://repo.springsource.org/libs-milestone/org/springframework/spring-test-mvc/1.0.0.M1/spring-test-mvc-1.0.0.M1.pom does not declare any dependencies.


Need Your Help

Dojo Examples work but mine doesnt

javascript dojo menubar

So I was practicing and it runs when I click it, however when i copy and paste it into my own word processor (Atom) and run it in a tab, its just blank

Why Win32 doesn't have zombie thread issue?

c++ multithreading winapi posix

Just know if we call the pthread_create with default pthread_attr_t, then Posix will keep the exited thread information for other thread to query it, there is zombie thread leak if we didn't call