Skip to content

Add grails-multi-module v8 guide (rename of grails-multi-project-build)#498

Merged
jamesfredley merged 1 commit intomasterfrom
add-grails-multi-module-v8
May 3, 2026
Merged

Add grails-multi-module v8 guide (rename of grails-multi-project-build)#498
jamesfredley merged 1 commit intomasterfrom
add-grails-multi-module-v8

Conversation

@jamesfredley
Copy link
Copy Markdown
Contributor

Summary

Adds the Grails 8 Multi-Project Build guide as the sixth Grails 8 sample-app-flavour guide. Following PRs #479, #493, #494, #495, #496, #497.

A real-world layout: one shared-core Grails Plugin (Book domain + @Service(Book) BookService), two web apps (webapp-customer read-only catalog, webapp-admin full CRUD) that depend on the plugin via implementation project(':shared-core') and build to independent bootJars sharing the same data model.

Companion conf/guides.yml change (rename of upstream repo)

The upstream repo grails-guides/grails-multi-project-build was renamed to grails-guides/grails-multi-module. The v4 entry's sampleRef.repo (line 2923) is repointed at the new canonical name; the master and forensic branches are preserved on the renamed repo so the v4 guide still resolves.

Module layout

grails-multi-module/ |-- settings.gradle # include 'shared-core', 'webapp-customer', 'webapp-admin' |-- build.gradle # subprojects { repositories + useJUnitPlatform } |-- shared-core/ # Grails Plugin (web_plugin from forge) | -- grails-app/ | |-- domain/example/Book.groovy | -- services/example/BookService.groovy # @Service(Book) interface |-- webapp-customer/ # Grails web app | |-- build.gradle # implementation project(':shared-core') | -- grails-app/controllers/customer/CatalogController.groovy -- webapp-admin/ # Grails web app |-- build.gradle # implementation project(':shared-core') -- grails-app/controllers/admin/BookController.groovy

What's in the PR

  • conf/guides.yml - new grails-multi-module registry entry (alphabetical insertion before grails-multi-project-build) plus the v4-entry repo-name update.
  • guides/grails-multi-module/v8/guide/*.adoc - 12 chapters.
  • guides/grails-multi-module/v8/snippets/ - vendored settings.gradle, build.gradle, Book.groovy, BookService.groovy, BookController.groovy (admin), CatalogController.groovy (customer).

Upstream sample app

grails-guides/grails-multi-module on the new grails8 branch (default). initial/ is intentionally empty and points readers at the three forge URLs. complete/ is the assembled three-module workspace.

Verification

  • ./gradlew validateGuides -PvalidationMode=both returns 86 guides, 0 errors.
  • ./gradlew renderGuide_grails_multi_module_8 --rerun-tasks --no-configuration-cache renders all 12 chapter HTML pages, no Unresolved directive errors.

Notes for reviewers

  • This is the fifth Grails 8 PR that intentionally renames a grails-guides/* repo to a sharper name.
  • The chapter on extracting a plugin from a monolith is a six-step migration recipe rather than a working code example - intentionally so, since the migration always starts from a different monolith.
  • The chapter on failure modes documents three real production gotchas: circular plugin deps, GORM mapping conflicts when a domain class loads twice, and Liquibase coordination across two webapps.

Real-world Grails 8 multi-project layout: one shared-core Grails Plugin
(domain model + GORM data services), two web apps (customer + admin)
that depend on it via implementation project(':shared-core') and build
to independent bootJars sharing the same data model.

Companion conf/guides.yml change repoints the existing v4 entry from
grails-guides/grails-multi-project-build to the freshly-renamed
grails-guides/grails-multi-module. The original master branch (and
forensic/grails4 etc.) is preserved on the renamed repo.

The 12 chapters cover:

- Getting Started (whatYouWillBuild, requirements, howto)
- Generate the Three Module Starters (web_plugin + 2 web)
- Root settings.gradle and build.gradle (subprojects { repositories,
  useJUnitPlatform } pattern)
- The shared-core Plugin (Book domain + @service(Book) BookService data
  service)
- The Two Webapps Consume shared-core (single-line dependency, package
  separation customer.* / admin.* / example.*)
- Running and Packaging Each Webapp (independent bootRun + bootJar)
- Per-Module Testing (each module owns its own test suite)
- Extracting a Plugin From a Monolith (six-step migration recipe)
- Failure Modes (circular deps, GORM mapping conflicts, schema
  migration coordination)

Verified locally:

  ./gradlew validateGuides -PvalidationMode=both
    [validateGuides] mode=both: 86 guide(s) parsed, 0 SKIP-warned, 0 errors

  ./gradlew renderGuide_grails_multi_module_8 --rerun-tasks --no-configuration-cache
    Renders all 12 chapter HTML pages, no Unresolved directive errors.

The mode=both pass also confirms the renamed repo + branch resolve.

Assisted-by: claude-code:claude-opus-4-7
Copilot AI review requested due to automatic review settings May 3, 2026 20:10
@jamesfredley jamesfredley merged commit 71523d0 into master May 3, 2026
5 checks passed
@jamesfredley jamesfredley deleted the add-grails-multi-module-v8 branch May 3, 2026 20:11
@jamesfredley jamesfredley review requested due to automatic review settings May 3, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant