我开始研究Gradle multi project
,我有像
Parent
build.gradle
Project A
build.gradle
Project B
build.gradle
我正在尝试使用spring-boot,因为我在Parent Gradle中添加了apply plugin: 'spring-boot'
但是我得到Plugin with id 'spring-boot' not found.
我将应用插件放在Project A
中并在父级中删除但仍然同样的问题。如果我将Project A
与Parent
项目分开并作为新的单个项目运行,它可以正常工作,但在多项目的情况下无法正常工作。
如果我从整个项目中删除apply plugin: 'spring-boot'
,则会Could not find method compile() for arguments [org.springframework.boot:spring-boot-starter-web] on root project 'Project A'.
感谢您对此的帮助。感谢。
在此处添加了我的Gradle文件
group 'com.mydomain'
version '1.0-SNAPSHOT'
buildscript {
repositories{
mavenCentral()
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.2.6.RELEASE'
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'spring-boot'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile("org.springframework.boot:spring-boot-starter-web")
testCompile('org.springframework.boot:spring-boot-starter-test')
}
}
项目A.
group 'com.mydomain'
version '1.0-SNAPSHOT'
// I added dependencies and apply plug-in here but got same issue
项目B.
group 'com.mydomain'
version '1.0-SNAPSHOT'
rootProject.name = 'Parent'
include 'Project A'
include 'Project B'