Skip to content

Support Gradle 6 #18663

@daggerok

Description

@daggerok

Hello,

I'm using Spring Boot 2.2.0.RELEASE with Gradle 6.0-rc-1 and during build Gradle warns with next message:

$ ./gradlew --warning-mode all ... 
> Configure project :
The baseName property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the archiveBaseName property instead.
        at Build_gradle$4$3.invoke(build.gradle.kts:61)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)

Here is my build.gradle.kts file:

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.dsl.SpringBootExtension
import org.springframework.boot.gradle.tasks.bundling.BootJar

plugins {
    kotlin("jvm") version "1.3.50"
    kotlin("plugin.spring") version "1.3.50"
    id("org.springframework.boot") version "2.2.0.RELEASE"
    id("io.spring.dependency-management") version "1.0.8.RELEASE"
}

allprojects {
    group = "com.example"
    version = "1.0.0-SNAPSHOT"
    java.sourceCompatibility = JavaVersion.VERSION_1_8
}

repositories {
    mavenCentral()
}

dependencies {
    runtimeOnly("org.springframework.boot:spring-boot-devtools")

    implementation("org.springframework.boot:spring-boot-starter-actuator")
    implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
    implementation("org.springframework.boot:spring-boot-starter-webflux")
    implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
    implementation("org.jetbrains.kotlin:kotlin-reflect")
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
    implementation("org.webjars:webjars-locator:0.37")
    implementation("org.webjars:Semantic-UI:2.4.1")

    testImplementation("org.springframework.boot:spring-boot-starter-test") {
        exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
    }
    testImplementation("io.projectreactor:reactor-test")
}

tasks {
    withType<Test> {
        useJUnitPlatform()
        testLogging {
            showExceptions = true
            showStandardStreams = true
            events(
                    org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED,
                    org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED,
                    org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
            )
        }
    }
    withType<KotlinCompile> {
        kotlinOptions {
            freeCompilerArgs = listOf("-Xjsr305=strict")
            jvmTarget = "1.8"
        }
    }
    withType<BootJar> {
        launchScript() //                  <--- warning is here, line: 61
    }
    withType<Wrapper> {
        gradleVersion = "6.0-rc-1"
    }
}

springBoot {
    buildInfo() // http :8080/actuator/info
}

defaultTasks("clean", "build")

I have quickly looked in spring-boot-gradle-plugin and seem like warning comes because of these usages from https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LaunchScriptConfiguration.java#L53 method: org.springframework.boot.gradle.tasks.bundling.LaunchScriptConfiguration#LaunchScriptConfiguration(org.gradle.api.tasks.bundling.AbstractArchiveTask)

Thanks!


Regards,
Maksim

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions