From cd808d2f189a7a550adec286c1722b5b6f1c19e7 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 17 Jun 2021 17:27:03 +0100 Subject: [PATCH] Only get Kotlin plugin's version once we know we need it Fixes gh-26946 --- .../springframework/boot/gradle/plugin/KotlinPluginAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 896cc7e929..3bc43e0ccf 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 @@ -33,9 +33,9 @@ class KotlinPluginAction implements PluginApplicationAction { @Override public void execute(Project project) { - String kotlinVersion = project.getPlugins().getPlugin(KotlinPluginWrapper.class).getKotlinPluginVersion(); ExtraPropertiesExtension extraProperties = project.getExtensions().getExtraProperties(); if (!extraProperties.has("kotlin.version")) { + String kotlinVersion = project.getPlugins().getPlugin(KotlinPluginWrapper.class).getKotlinPluginVersion(); extraProperties.set("kotlin.version", kotlinVersion); } enableJavaParametersOption(project);