0
是否可以爲builscript設置分辨率策略,以便可以集中設置gradle插件的版本?例如:Gradle:buildscript的分辨率策略
的build.gradle:
buildscript {
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin'
}
}
apply from: 'common.gradle'
apply plugin: 'spring-boot'
dependencies {
...
}
common.gradle:
allprojects { project ->
buildscript {
repositories {
jcenter()
}
}
configurations.all {
resolutionStrategy {
eachDependency { details ->
if (details.requested.group == 'org.springframework.boot' and details.requested.name == 'spring-boot-gradle-plugin')
details.useVersion '1.3.1.RELEASE'
}
}
}
}
我已經試過以上的約100個不同變種,都會導致一個錯誤,說春天開機gradle插件版本無法解析(仍爲空)
我想你可以用gradle.properties做同樣的事情 – RaGe