From ff79787defc95cca1b96a4e74a979e4de25c38ea Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 8 Jul 2021 10:45:09 +0100 Subject: [PATCH] Avoid using deprecated API to get Kotlin Plugin's version Closes gh-27090 --- .../boot/gradle/plugin/KotlinPluginAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/KotlinPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/KotlinPluginAction.java index cbd18e26e9..06774b3075 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/KotlinPluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/KotlinPluginAction.java @@ -20,6 +20,7 @@ import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.plugins.ExtraPropertiesExtension; import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper; +import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapperKt; import org.jetbrains.kotlin.gradle.tasks.KotlinCompile; /** @@ -41,9 +42,8 @@ class KotlinPluginAction implements PluginApplicationAction { enableJavaParametersOption(project); } - @SuppressWarnings("deprecation") private String getKotlinVersion(Project project) { - return project.getPlugins().getPlugin(KotlinPluginWrapper.class).getKotlinPluginVersion(); + return KotlinPluginWrapperKt.getKotlinPluginVersion(project); } private void enableJavaParametersOption(Project project) {