3

I use gradle, and has a module/project that has spring boot plugin applied. Lets Say in a project sub-module, I have apply plugin: "spring-boot".

Now from a another module/project I am adding a testCompile dependency to the sub-module. Say from another project main-module, I have added the below dependency

dependencies {
   testCompile project(":sub-module")
}

But when I test compile main-module, I get the below error,

* What went wrong:
Could not resolve all dependencies for configuration ':main-module:testCompile'.
> Could not find org.springframework.boot:spring-boot-starter-logging:.
  Searched in the following locations:
      https://jcenter.bintray.com/org/springframework/boot/spring-boot-starter-logging//spring-boot-starter-logging-.pom
      https://jcenter.bintray.com/org/springframework/boot/spring-boot-starter-logging//spring-boot-starter-logging-.jar
  Required by:
      com.xx.xx-main-module:1.0-SNAPSHOT > com.xx.xx:sub-module:1.0-SNAPSHOT
> Could not find org.springframework.boot:spring-boot-starter-data-solr:.
  Searched in the following locations:
      https://jcenter.bintray.com/org/springframework/boot/spring-boot-starter-data-solr//spring-boot-starter-data-solr-.pom
      https://jcenter.bintray.com/org/springframework/boot/spring-boot-starter-data-solr//spring-boot-starter-data-solr-.jar
  Required by:
      com.xx.xx:main-module:1.0-SNAPSHOT > com.xx.xx:sub-module:1.0-SNAPSHOT

The above error implies that I need to apply spring-boot in main-module as well and have all the buildScript dependencies to spring repos in the main-module build.gradle.

Just seems wrong that main-module has to declare plugins and dependencies that it is least bothered about.

Gradle version : 2.10 Spring-boot version : 1.3.2.RELEASE

Sathyakumar Seshachalam
  • 2,013
  • 3
  • 20
  • 32

0 Answers0