From 382c75959d4bc99367f729d26289ba3b496cefcf Mon Sep 17 00:00:00 2001 From: Krzysztof Koziol Date: Thu, 28 Mar 2019 00:08:22 +0100 Subject: [PATCH] ThymeleafAutoConfiguration fails if thymeleaf-spring5 is not present This commit adds an extra check for the presence of thymeleaf-spring5 library on the classpath. Since now ThymeleafAutoConfiguration is considered only if both thymeleaf-spring5 and thymeleaf jars are present. gh-16079 --- .../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 3342ad902a59..b12a8a96c423 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 @@ -76,7 +76,7 @@ */ @Configuration(proxyBeanMethods = false) @EnableConfigurationProperties(ThymeleafProperties.class) -@ConditionalOnClass(TemplateMode.class) +@ConditionalOnClass({ TemplateMode.class, SpringTemplateEngine.class }) @AutoConfigureAfter({ WebMvcAutoConfiguration.class, WebFluxAutoConfiguration.class }) public class ThymeleafAutoConfiguration {