Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

Commit 9e0e01e

Browse files
committed
Grails 7
1 parent 4c4dc29 commit 9e0e01e

File tree

13 files changed

+39
-60
lines changed

13 files changed

+39
-60
lines changed

.sdkmanrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
java=11.0.24-librca
1+
java=17.0.12-librca

build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,5 @@ plugins {
55
allprojects {
66
group = 'org.grails'
77

8-
compileJava.options.release = 11
9-
10-
repositories {
11-
mavenLocal()
12-
mavenCentral()
13-
maven { url "https://repo.grails.org/grails/core/" }
14-
}
8+
compileJava.options.release = 17
159
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=6.2.2-SNAPSHOT
2-
grailsVersion=6.2.2-SNAPSHOT
1+
version=7.0.0-SNAPSHOT
2+
grailsVersion=7.0.0-SNAPSHOT

grails-gsp-spring-boot/build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ buildscript {
33
maven { url = 'https://repo.grails.org/grails/core' }
44
}
55
dependencies {
6-
classpath "org.grails:grails-gradle-plugin:6.2.2-SNAPSHOT"
6+
classpath "org.grails:grails-gradle-plugin:7.0.0-SNAPSHOT"
77
}
88
}
99

@@ -14,9 +14,13 @@ plugins {
1414
apply plugin: 'org.grails.grails-plugin'
1515
apply plugin: "org.grails.internal.grails-plugin-publish"
1616

17+
repositories {
18+
mavenCentral()
19+
maven { url "https://repo.grails.org/grails/core/" }
20+
}
21+
1722
dependencies {
18-
api "org.sitemesh:grails-plugin-sitemesh3:6.2.0"
19-
compileOnly "javax.servlet.jsp:javax.servlet.jsp-api:2.3.3"
23+
api "org.sitemesh:grails-plugin-sitemesh3:7.0.0-SNAPSHOT"
2024
}
2125

2226
grailsPublish {

grails-gsp-spring-boot/src/main/java/grails/gsp/boot/GspAutoConfiguration.java

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
import org.grails.encoder.CodecLookup;
2929
import org.grails.gsp.GroovyPagesTemplateEngine;
3030
import org.grails.gsp.io.GroovyPageScriptSource;
31+
import org.grails.gsp.jsp.TagLibraryResolver;
3132
import org.grails.plugins.web.taglib.RenderSitemeshTagLib;
33+
import org.grails.taglib.TagLibraryLookup;
3234
import org.grails.web.gsp.GroovyPagesTemplateRenderer;
3335
import org.grails.web.pages.StandaloneTagLibraryLookup;
3436
import org.grails.web.gsp.io.CachingGrailsConventionGroovyPageLocator;
3537
import org.grails.web.gsp.io.GrailsConventionGroovyPageLocator;
3638
import org.grails.gsp.jsp.TagLibraryResolverImpl;
37-
import org.grails.web.servlet.view.GrailsLayoutViewResolver;
3839
import org.grails.web.servlet.view.GroovyPageViewResolver;
39-
import org.grails.web.sitemesh.GroovyPageLayoutFinder;
4040
import org.sitemesh.autoconfigure.SiteMeshAutoConfiguration;
4141
import org.sitemesh.grails.plugins.sitemesh3.GrailsLayoutHandlerMapping;
4242
import org.sitemesh.grails.plugins.sitemesh3.Sitemesh3GrailsPlugin;
@@ -69,7 +69,7 @@
6969
import org.grails.plugins.web.taglib.SitemeshTagLib;
7070
import org.grails.plugins.web.taglib.RenderTagLib;
7171

72-
import javax.servlet.ServletContext;
72+
import jakarta.servlet.ServletContext;
7373

7474
@Configuration
7575
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
@@ -111,15 +111,17 @@ protected static class GspTemplateEngineAutoConfiguration extends AbstractGspCon
111111
@Value("${sitemesh.decorator.default:}")
112112
String defaultLayoutName;
113113

114-
@Bean(autowire=Autowire.BY_NAME)
114+
@Bean
115115
@ConditionalOnMissingBean(name="groovyPagesTemplateEngine")
116-
GroovyPagesTemplateEngine groovyPagesTemplateEngine() {
116+
GroovyPagesTemplateEngine groovyPagesTemplateEngine(TagLibraryResolver tagLibraryResolver, TagLibraryLookup tagLibraryLookup) {
117117
GroovyPagesTemplateEngine templateEngine = new GroovyPagesTemplateEngine();
118118
templateEngine.setReloadEnabled(gspReloadingEnabled);
119+
templateEngine.setJspTagLibraryResolver(tagLibraryResolver);
120+
templateEngine.setTagLibraryLookup(tagLibraryLookup);
119121
return templateEngine;
120122
}
121123

122-
@Bean(autowire=Autowire.BY_NAME)
124+
@Bean
123125
@ConditionalOnMissingBean(name="groovyPageLocator")
124126
GrailsConventionGroovyPageLocator groovyPageLocator() {
125127
final List<String> templateRootsCleaned=resolveTemplateRoots();
@@ -175,17 +177,6 @@ protected List<String> resolveTemplateRoots() {
175177
}
176178

177179
@Bean
178-
@ConditionalOnMissingBean(name = "groovyPageLayoutFinder")
179-
public GroovyPageLayoutFinder groovyPageLayoutFinder() {
180-
GroovyPageLayoutFinder groovyPageLayoutFinder = new GroovyPageLayoutFinder();
181-
groovyPageLayoutFinder.setGspReloadEnabled(gspReloadingEnabled);
182-
groovyPageLayoutFinder.setCacheEnabled(gspLayoutCaching);
183-
groovyPageLayoutFinder.setEnableNonGspViews(false);
184-
groovyPageLayoutFinder.setDefaultDecoratorName(defaultLayoutName);
185-
return groovyPageLayoutFinder;
186-
}
187-
188-
@Bean(autowire=Autowire.BY_NAME)
189180
@ConditionalOnMissingBean(name = "groovyPagesTemplateRenderer")
190181
GroovyPagesTemplateRenderer groovyPagesTemplateRenderer() {
191182
GroovyPagesTemplateRenderer groovyPagesTemplateRenderer = new GroovyPagesTemplateRenderer();
@@ -217,16 +208,12 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
217208
protected static class GspViewResolverConfiguration extends AbstractGspConfig {
218209
@Bean
219210
@ConditionalOnMissingBean(name = "gspViewResolver")
220-
public ViewResolver gspViewResolver(GroovyPagesTemplateEngine groovyPagesTemplateEngine, GrailsConventionGroovyPageLocator groovyPageLocator, GroovyPageLayoutFinder groovyPageLayoutFinder) {
211+
public ViewResolver gspViewResolver(GroovyPagesTemplateEngine groovyPagesTemplateEngine, GrailsConventionGroovyPageLocator groovyPageLocator) {
221212
GroovyPageViewResolver groovyPageViewResolver = new GroovyPageViewResolver(groovyPagesTemplateEngine, groovyPageLocator);
222213
groovyPageViewResolver.setResolveJspView(jspEnabled);
223214
groovyPageViewResolver.setAllowGrailsViewCaching(!gspReloadingEnabled || viewCacheTimeout != 0);
224215
groovyPageViewResolver.setCacheTimeout(gspReloadingEnabled ? viewCacheTimeout : -1);
225-
if (!sitemesh3) {
226-
return new GrailsLayoutViewResolver(groovyPageViewResolver, groovyPageLayoutFinder);
227-
} else {
228-
return groovyPageViewResolver;
229-
}
216+
return groovyPageViewResolver;
230217
}
231218
}
232219

@@ -317,10 +304,10 @@ public void setEnvironment(Environment environment) {
317304
}
318305
}
319306

320-
@ConditionalOnClass({javax.servlet.jsp.tagext.JspTag.class, TagLibraryResolverImpl.class})
307+
@ConditionalOnClass({TagLibraryResolverImpl.class})
321308
@Configuration
322309
protected static class GspJspIntegrationConfiguration implements EnvironmentAware {
323-
@Bean(autowire = Autowire.BY_NAME)
310+
@Bean
324311
public TagLibraryResolverImpl jspTagLibraryResolver() {
325312
return new TagLibraryResolverImpl();
326313
}

grails-gsp-spring-boot/src/main/resources/META-INF/spring.factories

Lines changed: 0 additions & 2 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
grails.gsp.boot.GspAutoConfiguration

sample-apps/gsp/gsp-example/build.gradle

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@ buildscript {
33
maven { url "https://repo.grails.org/grails/core/" }
44
}
55
dependencies {
6-
classpath "org.grails:grails-gradle-plugin:6.2.2-SNAPSHOT"
6+
classpath "org.grails:grails-gradle-plugin:7.0.0-SNAPSHOT"
77
}
88
}
99

1010
plugins {
1111
id 'java'
1212
id 'war'
13-
id 'org.springframework.boot' version "2.7.18"
14-
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
13+
id 'org.springframework.boot' version "3.3.5"
14+
id 'io.spring.dependency-management' version '1.1.6'
1515
id "groovy"
1616
}
1717

1818
apply plugin: "org.grails.grails-gsp"
1919

2020
repositories {
21-
mavenLocal()
2221
mavenCentral()
2322
maven { url "https://repo.grails.org/grails/core/" }
2423
}
@@ -34,13 +33,11 @@ compileGroovyPages {
3433
dependencies {
3534
implementation project(':grails-gsp-spring-boot')
3635

37-
implementation("org.springframework.boot:spring-boot-starter-web:2.7.18")
36+
implementation "org.hibernate.validator:hibernate-validator:8.0.0.Final" // validation
3837

39-
implementation("org.hibernate:hibernate-validator:6.0.10.Final") // validation
38+
implementation "org.grails:grails-web-jsp:7.0.0-SNAPSHOT"
39+
implementation "org.grails:grails-plugin-controllers:7.0.0-SNAPSHOT" // only needed for GrailsFilters
4040

41-
implementation("org.grails:grails-web-jsp:6.2.2-SNAPSHOT")
42-
implementation("javax.servlet.jsp:javax.servlet.jsp-api:2.3.3")
43-
implementation("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.2")
4441
implementation 'org.apache.tomcat.embed:tomcat-embed-jasper' // jsp
45-
implementation("org.apache.tomcat.embed:tomcat-embed-el")
42+
implementation "org.apache.tomcat.embed:tomcat-embed-el"
4643
}

sample-apps/gsp/gsp-example/src/main/java/hello/Person.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package hello;
22

3-
import javax.validation.constraints.Min;
4-
import javax.validation.constraints.NotNull;
5-
import javax.validation.constraints.Size;
3+
import jakarta.validation.constraints.Min;
4+
import jakarta.validation.constraints.NotNull;
5+
import jakarta.validation.constraints.Size;
66

77
public class Person {
88

sample-apps/gsp/gsp-example/src/main/java/hello/WebController.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package hello;
22

3+
import jakarta.servlet.http.HttpSession;
4+
import jakarta.validation.Valid;
35
import org.springframework.stereotype.Controller;
46
import org.springframework.ui.Model;
57
import org.springframework.validation.BindingResult;
@@ -8,9 +10,6 @@
810
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
911
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
1012

11-
import javax.servlet.http.HttpSession;
12-
import javax.validation.Valid;
13-
1413
@Controller
1514
public class WebController implements WebMvcConfigurer {
1615

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
grails.gsp.tldScanPattern=classpath*:/META-INF/spring*.tld
22
spring.main.allow-circular-references=true
33
logging.level.web=trace
4-
grails.views.gsp.sitemesh.preprocess=false
54
sitemesh.decorator.default=main

sample-apps/gsp/script/.sdkmanrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
java=11.0.24-librca
2-
springboot=2.7.18
1+
java=17.0.12-librca
2+
springboot=3.3.5

sample-apps/gsp/script/app.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@GrabResolver(name='grails-repo', root='https://repo.grails.org/grails/core/')
2-
@Grab("org.grails:grails-gsp-spring-boot:6.2.2-SNAPSHOT")
2+
@Grab("org.grails:grails-gsp-spring-boot:7.0.0-SNAPSHOT")
33

44
import grails.gsp.TagLib
55
import org.springframework.web.servlet.ModelAndView

0 commit comments

Comments
 (0)