title: Cant use spring-boot-starter-web dependecies when running tests
body: <p>I have multi-module project using gradle(web,common,batch)</p>
  
  <p>The project is running fine</p>
  
  <p>however when I am trying to run junit from test folder of batch module when the spring comes up I get this:</p>
  
  <pre><code>Caused by: java.lang.NoClassDefFoundError: org/springframework/http/converter/xml/MappingJackson2XmlHttpMessageConverter
  </code></pre>
  
  <p>I checked dependency tree from the batch module:</p>
  
  <pre><code>&lt;batch&gt;gradle -q dependencies --configuration testRuntime
  </code></pre>
  
  <p>And I see in the buttom FAILED while trying to import spring-boot-start-web</p>
  
  <pre><code>.....
  |    |         +--- com.caucho:resin-hessian:4.0.23
  |    |         +--- org.springframework:spring-jdbc:3.1.0.RELEASE -&gt; 4.1.4.RELEASE (*)
  |    |         +--- com.adobe.blazeds:blazeds-common:3.2.0.3978
  |    |         +--- com.adobe.blazeds:blazeds-proxy:3.2.0.3978
  |    |         +--- org.codehaus.jackson:jackson-core-asl:1.9.2
  |    |         +--- org.codehaus.jackson:jackson-mapper-asl:1.9.2 (*)
  |    |         \--- org.mockito:mockito-all:1.9.5
  |    +--- com.mycompany.services.configuration:ConfigurationManager:2.0.8 (*)
  |    +--- com.caucho:resin-hessian:4.0.23
  |    +--- mysql:mysql-connector-java:5.1.34
  |    \--- javax.inject:javax.inject:1
  +--- org.springframework.boot:spring-boot-starter-test:1.2.1.RELEASE
  |    +--- junit:junit:4.12
  |    |    \--- org.hamcrest:hamcrest-core:1.3
  |    +--- org.mockito:mockito-core:1.10.8
  |    |    +--- org.hamcrest:hamcrest-core:1.1 -&gt; 1.3
  |    |    \--- org.objenesis:objenesis:2.1
  |    +--- org.hamcrest:hamcrest-core:1.3
  |    +--- org.hamcrest:hamcrest-library:1.3
  |    |    \--- org.hamcrest:hamcrest-core:1.3
  |    +--- org.springframework:spring-core:4.1.4.RELEASE (*)
  |    \--- org.springframework:spring-test:4.1.4.RELEASE
  |         \--- org.springframework:spring-core:4.1.4.RELEASE (*)
  +--- org.springframework.batch:spring-batch-test:3.0.2.RELEASE
  |    +--- junit:junit:4.11 -&gt; 4.12 (*)
  |    +--- org.hamcrest:hamcrest-all:1.3
  |    \--- org.springframework.batch:spring-batch-core:3.0.2.RELEASE (*)
  \--- org.springframework.boot:spring-boot-starter-web: FAILED
  </code></pre>
  
  <p>this is my build.gradle on the batch module:</p>
  
  <pre><code>buildscript {
      repositories {
          maven { url "http://repo.spring.io/libs-release" }
          mavenLocal()
          mavenCentral()
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:$project.ext.springBootVersion")
  
      }
  }
  
  description = 'batch'
  
  dependencies {
      compile("org.springframework.boot:spring-boot-starter-batch:$project.ext.springBootVersion")
      testRuntime("org.springframework.batch:spring-batch-test:$project.ext.springBatchVersion") {
          exclude(module: 'spring-test')
          exclude(module: 'spring-jdbc')
          exclude(module: 'commons-io')
          exclude(module: 'commons-collections')
      }
  
      /* compile ('org.springframework.integration:spring-integration-core:4.1.2.RELEASE')*/
      compile project(":common")
      testRuntime("org.springframework.boot:spring-boot-starter-web")
  
  }
  </code></pre>
  
  <p>Any idea what's wrong ?</p>
  
  <p>Thank you.</p>