无法使用spring启动插件解析子模块的依赖关系

时间:2016-02-22 10:58:10

标签: spring-boot spring-boot-gradle-plugin

我使用gradle,并且有一个应用了spring boot插件的模块/项目。让我们在项目sub-module中说,我有apply plugin: "spring-boot"

现在从另一个模块/项目我将testCompile依赖项添加到子模块。从另一个项目main-module说,我添加了以下依赖项

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

但是当我测试编译main-module时,我得到以下错误,

* 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

上述错误意味着我需要在main-module中应用spring-boot,并将所有buildScript依赖项添加到main-module build.gradle中的spring repos。

main-module必须声明最不受打扰的插件和依赖项,这似乎是错误的。

Gradle版本:2.10 Spring-boot版本:1.3.2.RELEASE

0 个答案:

没有答案