Enable SiteMesh 3 on the 8.x (Spring Boot 4) line#15710
Conversation
SiteMesh 3.2.x targets Spring Boot 3, while the 8.x line runs on Spring Boot 4. Bump starter-sitemesh and spring-webmvc-sitemesh from the 3.2.2 release to 3.3.0-SNAPSHOT, the Boot 4-compatible line. The org.sitemesh snapshot resolution exemptions are already present in GrailsRepoSettingsPlugin (pluginManagement and dependencyResolution management), so the snapshot resolves without further repo changes.
jdaugherty
left a comment
There was a problem hiding this comment.
I don't see a removal of boot4-disabled-integration-test-config.gradle - which I expected with this PR. I believe the only remaining use of this was sitemesh related.
|
Separating the SiteMesh 3 update and the change to make it the default feature is a reasonable approach to improve PR clarity and reduce risk. This would allow for independent verification of the library upgrade and the logic changes in |
2f8a70a to
6c5ee99
Compare
6c5ee99 to
a76e943
Compare
jdaugherty
left a comment
There was a problem hiding this comment.
@codeconsole I think the changes to GrailsGsp need reverted until we do the other PR promoting sitemesh 3 as the default.
The grails-sitemesh3 and grails-gsp-spring-boot modules were disabled while SiteMesh 3.2.x lacked Spring Boot 4 support. With org.sitemesh 3.3.0-SNAPSHOT both modules compile and pass their tests against Boot 4, so re-enable them and make SiteMesh 3 the default GSP layout decorator for generated applications. - settings.gradle: include grails-sitemesh3 and grails-gsp-spring-boot (project + projectDir) - grails-sitemesh3: re-enable the publish plugin and restore it to the published projects list so its version is managed by grails-bom - grails-forge (GrailsGsp) and grails-profiles web profile: generate apps against grails-sitemesh3 instead of grails-layout
Generated apps now depend on grails-sitemesh3, which transitively pulls org.sitemesh:*:3.3.0-SNAPSHOT. SNAPSHOT builds of Grails already add the Apache snapshot repository for org.apache.grails/groovy; mirror that for org.sitemesh by adding the Sonatype maven-snapshots repository (filtered to org.sitemesh, snapshotsOnly) when the Grails version is a SNAPSHOT. Applied to both generators: - grails-forge: GradleRepository.getDefaultRepositories - grails-shell-cli: CreateAppCommand.createRepositoryList The repository is only added for SNAPSHOT builds, so released apps are unaffected; a released org.sitemesh:3.3.0 must be pinned before 8.x GA.
The only documented blocker for this integration-test opt-out was SiteMesh3's incompatibility with Spring Framework 7, which this PR resolves by enabling SiteMesh 3 (3.3.0-SNAPSHOT) on the 8.0.x line. All modules that applied this file already had their 'apply from' references removed upstream, leaving the config file orphaned. Removing the dead file.
a76e943 to
fd5a874
Compare
This comment has been minimized.
This comment has been minimized.
| null, | ||
| List.of( | ||
| new VersionRegexRepoFilter( | ||
| "org[.]sitemesh.*", ".*", ".*-SNAPSHOT" |
There was a problem hiding this comment.
We don't need to include -SNAPSHOT in the regex here as that is explicitly set by the VersionType.SNAPSHOT below. (I know you probably followed suit here)
There was a problem hiding this comment.
FYI: We have the filter on all of the other examples in this file.
| configuredRepositories.add(repository) | ||
|
|
||
| GrailsGradleRepository sitemeshSnapshots = new GrailsGradleRepository(url: 'https://central.sonatype.com/repository/maven-snapshots', snapshotsOnly: true) | ||
| sitemeshSnapshots.includeOnly('org[.]sitemesh.*', '.*', '.*-SNAPSHOT') |
There was a problem hiding this comment.
The regex does not have to include -SNAPSHOT as snapshotsOnly: true is set above. (I know you probably followed suit here).
There was a problem hiding this comment.
FYI: We have the filter on all of the other examples in this file.
|
@matrei I'm going to go ahead and merge this - we can take a second pass at fixing the snapshot regex (this matches our existing pattern) |
Forward-merge the 8.0.x base into the Groovy 5 / Spring Boot 4 branch: code-analysis + jacoco convention plugins, SiteMesh 3 enablement, GORM TCK domain registration, bindData id/version dirty-check fix, and the release-drafter overhaul. Conflict: dependencies.gradle - spock.version kept at 2.4-groovy-5.0; this branch targets Groovy 5 and needs the Groovy-5 Spock variant (2.3-groovy-4.0 would break Spock test compilation). - starter-sitemesh.version / spring-webmvc-sitemesh.version adopted from 8.0.x at 3.3.0-SNAPSHOT, the Spring Boot 4 SiteMesh upgrade from #15710, superseding the branch's pre-merge 3.2.3. Assisted-by: claude-code:claude-4.8-opus
What
Re-enables SiteMesh 3 on the 8.x (Spring Boot 4) line and makes it the default GSP layout decorator for generated applications, while keeping the legacy SiteMesh 2
grails-layoutavailable as a mutually exclusive alternative.dependencies.gradlestarter-sitemesh/spring-webmvc-sitemesh3.2.2→3.3.0-SNAPSHOT(Boot 4 line)settings.gradlegrails-sitemesh3andgrails-gsp-spring-bootgrails-gsp/grails-sitemesh3/build.gradlegradle/publish-root-config.gradlegrails-sitemesh3to the published projects so it is BOM-managedgrails-forgeGspLayoutone-of group:Sitemesh3(default) +GrailsLayout(opt-in), mutually exclusive;GrailsGspno longer hardcodes the layout depgrails-profiles/web/profile.ymlgrails-sitemesh3instead ofgrails-layoutgrails-forge+grails-shell-cliorg.sitemeshsnapshot repo so3.3.0-SNAPSHOTresolvesWhy
SiteMesh
3.2.xtargets Spring Boot 3; the 8.x line runs on Spring Boot 4, which is why these modules were commented out ("does not support boot 4 at this time"). SiteMesh3.3.0is the Boot 4 line (published as3.3.0-SNAPSHOT). The twoorg.sitemesh.*:*-SNAPSHOTexemptions already exist inGrailsRepoSettingsPlugin, so grails-core itself resolves it; the only missing piece for generated apps was a snapshot repo, added here (SNAPSHOT-gated, filtered toorg.sitemesh).Layout choice (both available, never both)
Sitemesh3andGrailsLayoutshare aGspLayoutone-of feature class, soOneOfFeatureValidatorrejects selecting both.Sitemesh3is aDefaultFeature(auto-applied to web apps unlessgrails-layoutis explicitly chosen). In the profiles generator the web profile simply defaults tograils-sitemesh3(one decorator, never both).Verification (JDK 21 / Boot 4)
:grails-sitemesh3:test,:grails-sitemesh3:classes/:jar,:grails-gsp-spring-boot:classes— ✅:grails-shell-cli:compileGroovy— ✅GspLayoutSpec(sitemesh3 default for WEB/WEB_PLUGIN; grails-layout replaces it; both → throws; generated SNAPSHOT app exposes the org.sitemesh snapshot repo) — ✅GrailsGspSpec— ✅ no regressionNotes / follow-ups
org.sitemesh:3.3.0must be pinned before 8.x GA, otherwise released apps cannot resolve it.grails-gsp-spring-bootis re-enabled as a buildable module but remains unpublished (only consumer is the still-disabledgsp-spring-boottest example).grails-layout— a docs note ingrails-docis a likely follow-up.3.2.3release (Boot 3); when 7.2.x merges into 8.0.x it will conflict with3.3.0-SNAPSHOT— the 8.x Boot 4 value should win.