春入門版的版本,我想在gradle這個行家相當於properties
:覆蓋在gradle這個
<properties>
<spring-batch.version>4.0.0.M2</spring-batch.version>
</properties>
當我在build.gradle
添加ext['spring-batch.version'] = '4.0.0.M2'
,進口不工作。
buildscript {
ext {
springBootVersion = '1.5.4.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
ext['spring-batch.version'] = '4.0.0.M2'
dependencies {
compile('org.springframework.boot:spring-boot-starter-batch')
compile("org.hsqldb:hsqldb")
}
我也試圖在gradle.properties
添加spring-batch.version=4.0.0.M2
,但也不能工作。
指定這是正確的答案! – chenrui