From 28959ff0c3b78aa547ac1026961ae0e1dfc3ca46 Mon Sep 17 00:00:00 2001 From: Vladimir Orany Date: Wed, 9 Feb 2022 16:20:44 +0100 Subject: [PATCH] Spring Boot 2.1.x compatibility (#29) --- .../micronaut-grails-web-boot/micronaut-grails-web-boot.gradle | 3 +-- .../grails/web/boot/MicronautGrailsAppServletInitializer.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/subprojects/micronaut-grails-web-boot/micronaut-grails-web-boot.gradle b/subprojects/micronaut-grails-web-boot/micronaut-grails-web-boot.gradle index 1df90219..f6025ecc 100644 --- a/subprojects/micronaut-grails-web-boot/micronaut-grails-web-boot.gradle +++ b/subprojects/micronaut-grails-web-boot/micronaut-grails-web-boot.gradle @@ -27,6 +27,5 @@ dependencies { compileOnly 'javax.servlet:javax.servlet-api:4.0.1' compileOnly 'org.springframework:spring-webmvc:5.2.12.RELEASE' - compileOnly 'org.springframework.boot:spring-boot:2.4.1' - + compileOnly 'org.springframework.boot:spring-boot:2.1.15.RELEASE' } diff --git a/subprojects/micronaut-grails-web-boot/src/main/groovy/com/agorapulse/micronaut/grails/web/boot/MicronautGrailsAppServletInitializer.java b/subprojects/micronaut-grails-web-boot/src/main/groovy/com/agorapulse/micronaut/grails/web/boot/MicronautGrailsAppServletInitializer.java index 31b82ad7..ccbe6739 100644 --- a/subprojects/micronaut-grails-web-boot/src/main/groovy/com/agorapulse/micronaut/grails/web/boot/MicronautGrailsAppServletInitializer.java +++ b/subprojects/micronaut-grails-web-boot/src/main/groovy/com/agorapulse/micronaut/grails/web/boot/MicronautGrailsAppServletInitializer.java @@ -55,7 +55,7 @@ protected WebApplicationContext createRootApplicationContext(ServletContext serv builder.initializers(new ParentContextApplicationContextInitializer(parent)); } builder.initializers(new ServletContextApplicationContextInitializer(servletContext)); - builder.contextFactory(webApplicationType -> new AnnotationConfigServletWebServerApplicationContext()); + builder.application().setApplicationContextClass(AnnotationConfigServletWebServerApplicationContext.class); builder = configure(builder); SpringApplication application = builder.build(); if (application.getAllSources().isEmpty() && AnnotationUtils.findAnnotation(getClass(), Configuration.class) != null) {