From 17c0214cc6aa8b63f4f2ca4058f37f33a33f7fe6 Mon Sep 17 00:00:00 2001 From: Krzysztof Koziol Date: Thu, 28 Mar 2019 00:08:22 +0100 Subject: [PATCH] Add missing class condition on thymeleaf-spring5 This commit adds an extra check for the presence of thymeleaf-spring5 library on the classpath. ThymeleafAutoConfiguration is now only considered if both thymeleaf-spring5 and thymeleaf jars are present. Closes gh-16341 --- .../autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java index dd96ac06cc..0d03efc678 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java @@ -77,7 +77,7 @@ import org.springframework.web.servlet.resource.ResourceUrlEncodingFilter; */ @Configuration @EnableConfigurationProperties(ThymeleafProperties.class) -@ConditionalOnClass(TemplateMode.class) +@ConditionalOnClass({ TemplateMode.class, SpringTemplateEngine.class }) @AutoConfigureAfter({ WebMvcAutoConfiguration.class, WebFluxAutoConfiguration.class }) public class ThymeleafAutoConfiguration {