Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Gradle 6 #18663

Closed
daggerok opened this issue Oct 19, 2019 · 6 comments
Closed

Support Gradle 6 #18663

daggerok opened this issue Oct 19, 2019 · 6 comments
Assignees
Milestone

Comments

@daggerok
Copy link

@daggerok daggerok commented Oct 19, 2019

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

@daggerok daggerok changed the title Gradle 6.x warning Gradle 6.x deprecation warning for getBaseName() usage Oct 19, 2019
@daggerok daggerok changed the title Gradle 6.x deprecation warning for getBaseName() usage Gradle 6.x deprecation warning for getBaseName() usage in spring-boot-gradle-plugin Oct 19, 2019
@wilkinsona

This comment has been minimized.

Copy link
Member

@wilkinsona wilkinsona commented Oct 21, 2019

Thanks for the report. We don't test against or support Gradle 6.0 at the moment. This particular warning seems fairly easy to fix. We'll have to see what else is involved.

@wilkinsona wilkinsona changed the title Gradle 6.x deprecation warning for getBaseName() usage in spring-boot-gradle-plugin Support Gradle 6 Oct 21, 2019
@wilkinsona wilkinsona self-assigned this Oct 21, 2019
@wilkinsona wilkinsona added this to the 2.2.x milestone Oct 26, 2019
@wilkinsona

This comment has been minimized.

Copy link
Member

@wilkinsona wilkinsona commented Nov 5, 2019

I have a branch that contains the changes that are necessary to avoid deprecation warnings with Gradle 6. There's a bit of reflection involved but it's not too bad. It's currently testing against Gradle 6.0-rc2. I'd like to wait for 6.0 to GA before merging.

@wilkinsona

This comment has been minimized.

Copy link
Member

@wilkinsona wilkinsona commented Nov 12, 2019

This needs to be tweaked a little to handle archive base name properly.

@darioseidl

This comment has been minimized.

Copy link

@darioseidl darioseidl commented Nov 26, 2019

I get another deprecation warning with Gradle 6 and spring-boot-starter-test:

The testCompile configuration has been deprecated for dependency declaration. This will fail with an error in Gradle 7.0. Please use the testImplementation configuration instead.
at Build_gradle$3.invoke(build.gradle.kts:269)

Where the line 269 in my build.gradle.kts is

testImplementation("org.springframework.boot:spring-boot-starter-test")
@wilkinsona

This comment has been minimized.

Copy link
Member

@wilkinsona wilkinsona commented Nov 26, 2019

@darioseidl That doesn't seem to be related to Spring Boot's Gradle plugin but to your build script and Gradle itself. If you believe it is caused by Boot's Gradle plugin, can you please provide a small sample that reproduces the problem and we'll take a look.

@darioseidl

This comment has been minimized.

Copy link

@darioseidl darioseidl commented Nov 26, 2019

OK, thanks, you're probably right. I can't seem to reproduce it in a simply project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.