java - Cant use spring-boot-starter-web dependecies when running tests -
I have a multi-module project that is using grade (web, common, batch)
< P> The project is working fineBut when I try to run the old one from the test folder of the batch module, when the spring comes, I get:
Cause by: java.lang.NoClassDefFoundError: I am checking the tree dependent from the batch module:-configuration testRuntimeand when I try to import spring-boot-start-web Bitum failed
..... | | + --- Com Kuo: Resins-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.3 978 | | + --- com.adobe.blazeds: blazeds-proxy: 3.2.0.3 978 | | + --- org.codehaus.jackson: Jackson-Core-ASL: 1.9.2 | | + --- org.codehaus.jackson: Jackson-Mapper-ASL: 1.9.2 (*) | | \ --- org.mockito: Fake-all: 1.9.5 | + --- com.mycompany.services.configuration: Configuration Manager: 2.0.8 (*) | + --- Com Kuo: Resins-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 | + --- Junior: Junit: 4.12 | | \ --- org.hamcrest: Hamstrister-Core: 1.3 | + --- org.mockito: Mokito-Core: 1.10.8 | | + --- org.hamcrest: Hamerrich-Core: 1.1 - & gt; 1.3 | | \ --- org.objenesis: objenesis: 2.1 | + --- org.hamcrest: hamcast-core: 1.3 | + --- org.hamcrest: Hamstrist-Library: 1.3 | | \ --- org.hamcrest: Hamstrister-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: FAILEDThis is my build.gradle on batch module:
buildscript {repositories {maven {url "http://repo.spring.io/libs-release"} mavenLocal () MavenCentral ()} dependency {classpath ("org.springframework.boot: spring-boot-gradle-plugin: $ project.ext.springBootVersion")}} description = 'batch' dependency {compilation ("org.springframework.boot: spring -boot-starter-batch: $ project.ext.springBootVersion ") Examination order (" org.springframework.batch: spring-batch-test: $ project.ext.springBatchVersion ") {Out (module: 'spring-test') outside Remove (module: 'spring-jdbc') out (module: 'commons-io') outside (module: 'commons-collection')} / * compilation ('org.springframework.integration: spring-integration-core: 4.1. 2.RELEASE ') * / Compilation Project (": comThanks
Any ideas are wrong
thanks.
P
You either need to provide version number when you are declaring dependency or you have to apply a spring boot Requires Plugin (you delete the plugin on the script Have declared as Bharta, but have not implemented it).
When the Spring Boot plugin is applied, it will automatically set the version of spring-boot to the same version as the plugin for the Starter-Web You can see that the plugin can set it in the document for you.
Comments
Post a Comment