我是新来的摇篮,并有有关项目属性的一些问题。
我需要在我的build.gradle多个地点申报春天启动的依赖性,而我想用一个变量定义版本。 什么是gradle这个最好的方法是什么? (Maven中,我使用的属性)
我尝试使用额外的属性,但它不能在buildscript关闭访问属性。 我GOOGLE了四周,看了很多文章在访问自定义任务的属性。 我错过了什么?
ext {
springBootVersion = '1.1.9.RELEASE'
}
buildscript {
print project.springBootVersion //fails here
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${project.springBootVersion}")
}
}
install {
repositories.mavenInstaller {
pom.project {
parent {
groupId 'org.springframework.boot'
artifactId 'spring-boot-starter-parent'
version "${project.springBootVersion}" //this one works
}
}
}
}