Note that there are some explanatory texts on larger screens.

plurals
  1. POGradle doesn't include transitive dependencies
    text
    copied!<p>I'm trying to use <a href="https://github.com/SpringSource/spring-test-mvc" rel="nofollow">spring-test-mvc</a> for testing a controller in my little application. Since I use gradle as build tool I added the dependency to it like this:</p> <pre><code>testCompile 'org.springframework:spring-test-mvc:1.0.0.M1' </code></pre> <p>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.</p> <p>Among others it complains about not finding</p> <pre><code>org.springframework.mock.web.MockHttpServletRequest </code></pre> <p>Which is part of the spring-test.jar, which is included as a dependency in spring-test-mvc s pom.xml <a href="https://github.com/SpringSource/spring-test-mvc/blob/master/pom.xml" rel="nofollow">https://github.com/SpringSource/spring-test-mvc/blob/master/pom.xml</a></p> <p>I can fix that problem by including the dependency explicitely in the build file:</p> <pre><code>testCompile 'org.springframework:spring-test:3.1.1.RELEASE' </code></pre> <p>But it just gets replaced by the next problem. I tried to explicitly ask for transient dependencies:</p> <pre><code>testCompile ('org.springframework:spring-test-mvc:1.0.0.M1') { transitive = true } </code></pre> <p>But that doesn't seedm to change anything.</p> <p>So the question is: How do I get gradle to include transitive dependencies in the classpath.</p> <p>Note: Transitive dependencies seem to work fine outside of tests.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload