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