1

以下是我的毕业典礼 -

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

4

1 回答 1

1

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

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

感谢@Thanksforallthefish

于 2017-01-16T11:23:21.750 回答