spring-boot的gradle插件bootRepackage任务提供了弃用警告

时间:2017-01-11 10:22:56

标签: java gradle spring-boot gradle-plugin spring-boot-gradle-plugin

以下是我的gradle bulld -

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 "========================================================="
        }
    }
}

服务/的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

1 个答案:

答案 0 :(得分:1)

显然发现它的spring-boot问题已在即将发布的1.5版(目前为1.4.3.RELEASE)中修复。

等待发布此版本并检查与我们项目的兼容性。

感谢@Thanksforallthefish