spring-boot 的 gradle 插件 bootRepackage 任务给出弃用警告
spring-boot's gradle plugin bootRepackage task gives deprecation warning
以下是我的gradle大牛-
allprojects {
group = "org.coderearth"
version = "0.1.SNAPSHOT"
ext {
springBootVersion = "1.4.3.RELEASE"
}
}
project(":core") {
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
mavenCentral()
}
dependencies {
compile 'org.slf4j:jcl-over-slf4j:1.7.21'
compile 'ch.qos.logback:logback-classic:1.1.7'
testCompile 'junit:junit:4.12'
}
}
project.ext {
recipeModules = subprojects.findAll {
it.name.startsWith('recipe') || it.name == "service"
}
}
configure(project.ext.recipeModules) {
buildscript {
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
repositories {
mavenCentral()
}
}
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
mavenCentral()
}
dependencies {
compile project(":core")
}
}
subprojects {
task info {
doLast {
println "========================================================="
println "\t project.group = $project.group"
println "\t project.name = $project.name"
println "\t project.parent = $project.parent.name"
println "\t project.version = $project.version"
println "========================================================="
}
}
}
service/build.gradle
apply plugin: 'org.springframework.boot'
dependencies {
compile("org.springframework.boot:spring-boot-starter")
}
// bootRepackage.enabled = false
我在 运行 build
任务中看到一个构建警告。
:core:compileJava UP-TO-DATE
:core:processResources UP-TO-DATE
:core:classes UP-TO-DATE
:core:jar UP-TO-DATE
:service:compileJava UP-TO-DATE
:service:processResources UP-TO-DATE
:service:classes UP-TO-DATE
:service:findMainClass
:service:jar UP-TO-DATE
:service:bootRepackage
The ProjectDependency.getProjectConfiguration() method has been deprecated and is scheduled to be removed in Gradle 4.0.
ModuleDependency.getConfiguration() has been deprecated and is scheduled to be removed in Gradle 4.0. Use ModuleDependency.getTargetConfiguration() instead.
:service:assemble
:service:compileTestJava UP-TO-DATE
:service:processTestResources UP-TO-DATE
:service:testClasses UP-TO-DATE
:service:test UP-TO-DATE
:service:check UP-TO-DATE
:service:build
BUILD SUCCESSFUL
Total time: 0.973 secs
奇怪的是 - 如果我在 service/build.gradle 中禁用 bootRepackage,它就会消失。虽然这只是一个警告,但我很想知道我错过了什么。我相信 springboot 的 gradle 插件使用的某些东西已被弃用,但如果它在我的构建中 - 那么我需要修复它。
提前致谢,
/kp
显然发现其 spring-boot 的问题已在即将发布的 1.5 版(目前为 1.4.3.RELEASE)中修复。
等待这个版本的到来并检查与我们项目的兼容性。
感谢@Thanksforallthefish
以下是我的gradle大牛-
allprojects {
group = "org.coderearth"
version = "0.1.SNAPSHOT"
ext {
springBootVersion = "1.4.3.RELEASE"
}
}
project(":core") {
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
mavenCentral()
}
dependencies {
compile 'org.slf4j:jcl-over-slf4j:1.7.21'
compile 'ch.qos.logback:logback-classic:1.1.7'
testCompile 'junit:junit:4.12'
}
}
project.ext {
recipeModules = subprojects.findAll {
it.name.startsWith('recipe') || it.name == "service"
}
}
configure(project.ext.recipeModules) {
buildscript {
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
repositories {
mavenCentral()
}
}
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
mavenCentral()
}
dependencies {
compile project(":core")
}
}
subprojects {
task info {
doLast {
println "========================================================="
println "\t project.group = $project.group"
println "\t project.name = $project.name"
println "\t project.parent = $project.parent.name"
println "\t project.version = $project.version"
println "========================================================="
}
}
}
service/build.gradle
apply plugin: 'org.springframework.boot'
dependencies {
compile("org.springframework.boot:spring-boot-starter")
}
// bootRepackage.enabled = false
我在 运行 build
任务中看到一个构建警告。
:core:compileJava UP-TO-DATE
:core:processResources UP-TO-DATE
:core:classes UP-TO-DATE
:core:jar UP-TO-DATE
:service:compileJava UP-TO-DATE
:service:processResources UP-TO-DATE
:service:classes UP-TO-DATE
:service:findMainClass
:service:jar UP-TO-DATE
:service:bootRepackage
The ProjectDependency.getProjectConfiguration() method has been deprecated and is scheduled to be removed in Gradle 4.0.
ModuleDependency.getConfiguration() has been deprecated and is scheduled to be removed in Gradle 4.0. Use ModuleDependency.getTargetConfiguration() instead.
:service:assemble
:service:compileTestJava UP-TO-DATE
:service:processTestResources UP-TO-DATE
:service:testClasses UP-TO-DATE
:service:test UP-TO-DATE
:service:check UP-TO-DATE
:service:build
BUILD SUCCESSFUL
Total time: 0.973 secs
奇怪的是 - 如果我在 service/build.gradle 中禁用 bootRepackage,它就会消失。虽然这只是一个警告,但我很想知道我错过了什么。我相信 springboot 的 gradle 插件使用的某些东西已被弃用,但如果它在我的构建中 - 那么我需要修复它。
提前致谢, /kp
显然发现其 spring-boot 的问题已在即将发布的 1.5 版(目前为 1.4.3.RELEASE)中修复。
等待这个版本的到来并检查与我们项目的兼容性。
感谢@Thanksforallthefish