下面是我的build.gradle
buildscript {
ext {
springBootVersion = '2.0.0.M3'
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'org.springframework.boot'
apply plugin: 'maven-publish'
dependencyManagement {
imports {
mavenBom 'org.springframework.cloud:spring-cloud-starter-parent:Brixton.SR7'
}
}
dependencies {
compile("org.springframework.cloud:spring-cloud-starter-eureka")
compile "org.elasticsearch:elasticsearch:5.5.0"
testCompile('org.springframework.boot:spring-boot-starter-test')
}
Run Code Online (Sandbox Code Playgroud)
我使用gradle 2.14并得到以下错误
> Failed to apply plugin [id 'org.springframework.boot']
> Spring Boot plugin requires Gradle 3.4 or later. The current version is Gra
dle 2.14
Run Code Online (Sandbox Code Playgroud)
然后我按照错误消息中的建议将gradle升级到3.4.
现在我得到以下错误
无法在类型为org.gradle.api.Project的根项目"myproject"上找到参数[build_79bcact4bkf1 sckkod1j3zl7l $ _run_closure1 @ 4a2d71c9]的方法dependencyManagement().
方法dependencyManagement()在gradle 3.4中不再可用吗?如果有人知道在gradle 3.4中使用的替代方法,请回复