diff --git a/spring-boot-project/spring-boot-autoconfigure/pom.xml b/spring-boot-project/spring-boot-autoconfigure/pom.xml
index 1fe5e13337..901d53cbe1 100755
--- a/spring-boot-project/spring-boot-autoconfigure/pom.xml
+++ b/spring-boot-project/spring-boot-autoconfigure/pom.xml
@@ -623,6 +623,11 @@
thymeleaf-extras-springsecurity4
true
+
+ org.thymeleaf.extras
+ thymeleaf-extras-springsecurity5
+ true
+
javax.jms
javax.jms-api
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 7475e0f45d..a0635401db 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
@@ -327,14 +327,34 @@ public class ThymeleafAutoConfiguration {
@ConditionalOnClass({ SpringSecurityDialect.class })
protected static class ThymeleafSecurityDialectConfiguration {
+ private final Log logger = LogFactory
+ .getLog(ThymeleafSecurityDialectConfiguration.class);
+
@Bean
@ConditionalOnMissingBean
public SpringSecurityDialect securityDialect() {
+ if (this.logger.isWarnEnabled()) {
+ this.logger.warn("Auto-configuration for thymeleaf-extras-springsecurity4"
+ + " is deprecated in favour of thymeleaf-extras-springsecurity5");
+ }
return new SpringSecurityDialect();
}
}
+ @Configuration
+ @ConditionalOnClass({
+ org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect.class })
+ protected static class ThymeleafSecurity5DialectConfiguration {
+
+ @Bean
+ @ConditionalOnMissingBean
+ public org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect securityDialect() {
+ return new org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect();
+ }
+
+ }
+
@Configuration
@ConditionalOnClass(Java8TimeDialect.class)
protected static class ThymeleafJava8TimeDialect {
diff --git a/spring-boot-project/spring-boot-dependencies/pom.xml b/spring-boot-project/spring-boot-dependencies/pom.xml
index c9e5be8040..7cd06f2a3a 100644
--- a/spring-boot-project/spring-boot-dependencies/pom.xml
+++ b/spring-boot-project/spring-boot-dependencies/pom.xml
@@ -172,7 +172,9 @@
3.1.0
${javax-mail.version}
3.0.10.RELEASE
+
3.0.3.RELEASE
+ ${thymeleaf-extras-springsecurity4.version}
2.3.0
2.0.1
3.0.1.RELEASE
@@ -2951,7 +2953,12 @@
org.thymeleaf.extras
thymeleaf-extras-springsecurity4
- ${thymeleaf-extras-springsecurity4.version}
+ ${thymeleaf-extras-springsecurity.version}
+
+
+ org.thymeleaf.extras
+ thymeleaf-extras-springsecurity5
+ ${thymeleaf-extras-springsecurity.version}
org.webjars