Skip to content

Enable SiteMesh 3 on the 8.x (Spring Boot 4) line#15710

Merged
jdaugherty merged 7 commits into
apache:8.0.xfrom
codeconsole:deps/sitemesh3-3.3.0-snapshot
Jun 3, 2026
Merged

Enable SiteMesh 3 on the 8.x (Spring Boot 4) line#15710
jdaugherty merged 7 commits into
apache:8.0.xfrom
codeconsole:deps/sitemesh3-3.3.0-snapshot

Conversation

@codeconsole
Copy link
Copy Markdown
Contributor

@codeconsole codeconsole commented Jun 1, 2026

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-layout available as a mutually exclusive alternative.

Area Change
dependencies.gradle starter-sitemesh / spring-webmvc-sitemesh 3.2.23.3.0-SNAPSHOT (Boot 4 line)
settings.gradle Re-include grails-sitemesh3 and grails-gsp-spring-boot
grails-gsp/grails-sitemesh3/build.gradle Re-enable the publish plugin
gradle/publish-root-config.gradle Restore grails-sitemesh3 to the published projects so it is BOM-managed
grails-forge New GspLayout one-of group: Sitemesh3 (default) + GrailsLayout (opt-in), mutually exclusive; GrailsGsp no longer hardcodes the layout dep
grails-profiles/web/profile.yml Web profile uses grails-sitemesh3 instead of grails-layout
grails-forge + grails-shell-cli Generated SNAPSHOT apps add the Sonatype org.sitemesh snapshot repo so 3.3.0-SNAPSHOT resolves

Why

SiteMesh 3.2.x targets 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"). SiteMesh 3.3.0 is the Boot 4 line (published as 3.3.0-SNAPSHOT). The two org.sitemesh.*:*-SNAPSHOT exemptions already exist in GrailsRepoSettingsPlugin, so grails-core itself resolves it; the only missing piece for generated apps was a snapshot repo, added here (SNAPSHOT-gated, filtered to org.sitemesh).

Layout choice (both available, never both)

Sitemesh3 and GrailsLayout share a GspLayout one-of feature class, so OneOfFeatureValidator rejects selecting both. Sitemesh3 is a DefaultFeature (auto-applied to web apps unless grails-layout is explicitly chosen). In the profiles generator the web profile simply defaults to grails-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 — ✅
  • forge GspLayoutSpec (sitemesh3 default for WEB/WEB_PLUGIN; grails-layout replaces it; both → throws; generated SNAPSHOT app exposes the org.sitemesh snapshot repo) — ✅
  • forge GrailsGspSpec — ✅ no regression

Notes / follow-ups

  • The Sonatype snapshot repo is added to generated apps only for SNAPSHOT builds; a released org.sitemesh:3.3.0 must be pinned before 8.x GA, otherwise released apps cannot resolve it.
  • grails-gsp-spring-boot is re-enabled as a buildable module but remains unpublished (only consumer is the still-disabled gsp-spring-boot test example).
  • New user-facing forge feature grails-layout — a docs note in grails-doc is a likely follow-up.
  • ⚠️ Merge-up: Pin SiteMesh 3 to 3.2.3 release and drop snapshot repo resolution #15705 pinned 7.2.x to the 3.2.3 release (Boot 3); when 7.2.x merges into 8.0.x it will conflict with 3.3.0-SNAPSHOT — the 8.x Boot 4 value should win.

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.
@codeconsole codeconsole changed the title Update SiteMesh 3 to 3.3.0-SNAPSHOT for Spring Boot 4 Enable SiteMesh 3 on the 8.x (Spring Boot 4) line Jun 1, 2026
Copy link
Copy Markdown
Contributor

@jdaugherty jdaugherty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bito-code-review
Copy link
Copy Markdown

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 Sitemesh3.java that enable its automatic application.

@codeconsole codeconsole force-pushed the deps/sitemesh3-3.3.0-snapshot branch 2 times, most recently from 2f8a70a to 6c5ee99 Compare June 2, 2026 15:38
@codeconsole codeconsole force-pushed the deps/sitemesh3-3.3.0-snapshot branch from 6c5ee99 to a76e943 Compare June 2, 2026 17:25
Copy link
Copy Markdown
Contributor

@jdaugherty jdaugherty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.
@codeconsole codeconsole force-pushed the deps/sitemesh3-3.3.0-snapshot branch from a76e943 to fd5a874 Compare June 2, 2026 20:13
@testlens-app

This comment has been minimized.

null,
List.of(
new VersionRegexRepoFilter(
"org[.]sitemesh.*", ".*", ".*-SNAPSHOT"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: We have the filter on all of the other examples in this file.

Comment thread grails-profiles/web/profile.yml Outdated
configuredRepositories.add(repository)

GrailsGradleRepository sitemeshSnapshots = new GrailsGradleRepository(url: 'https://central.sonatype.com/repository/maven-snapshots', snapshotsOnly: true)
sitemeshSnapshots.includeOnly('org[.]sitemesh.*', '.*', '.*-SNAPSHOT')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex does not have to include -SNAPSHOT as snapshotsOnly: true is set above. (I know you probably followed suit here).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: We have the filter on all of the other examples in this file.

@jdaugherty
Copy link
Copy Markdown
Contributor

@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)

@jdaugherty jdaugherty merged commit ea1f681 into apache:8.0.x Jun 3, 2026
30 of 31 checks passed
jamesfredley added a commit that referenced this pull request Jun 4, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants