【发布时间】:2016-02-07 06:26:05
【问题描述】:
我有以下项目结构:
java/
构建.gradle
settings.gradle
项目A/
构建.gradle
项目B/
build.gradle
当我输入以下代码时,例如projectA的build.gradle,
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.6.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
...
一切正常。
但是如果我把上面的代码放在Java的build.gradle中:
subprojects {
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.6.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
...
}
运行gradle clean build时,一直报如下错误:
未找到 ID 为“spring-boot”的插件。
以前有人遇到过这个问题吗?为什么?
【问题讨论】:
标签: java gradle spring-boot