【发布时间】:2017-12-18 18:11:30
【问题描述】:
我想要在 gradle 中等同于 properties 的 maven:
<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,但也不起作用。
【问题讨论】:
标签: java spring maven spring-boot gradle