You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by ja...@apache.org on 2026/05/01 12:49:23 UTC

(grails-static-website) 01/01: Phase 10 deferred-fix batch 1: vendor 5 fixtures after upstream patches (refs #354)

This is an automated email from the ASF dual-hosted git repository.

jamesfredley pushed a commit to branch phase-10-deferred-fixes
in repository https://gitbox.apache.org/repos/asf/grails-static-website.git

commit f5d573f270effa7fbaa9c71e6ec380adcdd7919e
Author: James Fredley <ja...@users.noreply.github.com>
AuthorDate: Fri May 1 08:45:38 2026 -0400

    Phase 10 deferred-fix batch 1: vendor 5 fixtures after upstream patches (refs #354)
---
 conf/guides.yml                                    |  53 ++--
 .../v4/guide/gettingStarted.adoc                   |   5 +
 .../v4/guide/helpWithGrails.adoc                   |   1 +
 .../discriminator-per-tenant/v4/guide/howto.adoc   |   1 +
 .../v4/guide/integrationTest.adoc                  |  33 +++
 .../v4/guide/requirements.adoc                     |   1 +
 .../v4/guide/runningTheApp.adoc                    |  11 +
 .../v4/guide/setupMultitenancy.adoc                |   4 +
 .../v4/guide/testingTheApp.adoc                    |  74 ++++++
 .../v4/guide/training.adoc                         |   1 +
 .../v4/guide/writingTheApp.adoc                    |   0
 .../v4/guide/writingTheApp/domainClasses.adoc      |  38 +++
 .../v4/guide/writingTheApp/multiTenantLogic.adoc   |  20 ++
 .../multiTenantLogic/readingData.adoc              |  52 ++++
 .../multiTenantLogic/writingData.adoc              |  37 +++
 .../v4/guide/writingTheApp/seedData.adoc           |  14 ++
 .../setupMultitenancy/multiTenancyMode.adoc        |  11 +
 .../setupMultitenancy/multiTenancyResolver.adoc    |   3 +
 .../v4/guide/writingTheApp/tenantSelection.adoc    |  78 ++++++
 guides/discriminator-per-tenant/v4/manifest.yml    |  19 ++
 .../v4/snippets/MANIFEST.yml                       |  41 +++
 .../v4/snippets/grails-app/conf/application.yml    | 115 +++++++++
 .../example/ManufacturerController.groovy          |  41 +++
 .../controllers/example/UrlMappings.groovy         |  27 ++
 .../controllers/example/VehicleController.groovy   |  91 +++++++
 .../grails-app/domain/example/Engine.groovy        |  16 ++
 .../grails-app/domain/example/Manufacturer.groovy  |  12 +
 .../grails-app/domain/example/Vehicle.groovy       |  19 ++
 .../grails-app/init/example/Application.groovy     |  25 ++
 .../services/example/ManufacturerService.groovy    |  16 ++
 .../services/example/VehicleService.groovy         |  47 ++++
 .../v4/snippets/grails-app/views/index.gsp         |  80 ++++++
 .../groovy/example/ManufacturersPage.groovy        |  21 ++
 .../groovy/example/NewVehiclePage.groovy           |  20 ++
 .../groovy/example/ShowVehiclePage.groovy          |  16 ++
 .../groovy/example/TenantSelectionFuncSpec.groovy  | 118 +++++++++
 .../groovy/example/VehiclesPage.groovy             |  21 ++
 .../groovy/example/VehicleControllerSpec.groovy    | 138 ++++++++++
 guides/discriminator-per-tenant/v4/toc.yml         |  25 ++
 .../gorm-without-grails/v4/guide/application.adoc  |   7 +
 .../v4/guide/configuringTheApp.adoc                |  14 ++
 .../v4/guide/creatingAppConfig.adoc                |  38 +++
 .../v4/guide/creatingTestData.adoc                 |  15 ++
 .../v4/guide/creatingTheControllers.adoc           |  67 +++++
 .../v4/guide/creatingTheDomain.adoc                |  32 +++
 .../v4/guide/creatingTheServices.adoc              |  26 ++
 .../v4/guide/gettingStarted.adoc                   |   1 +
 .../v4/guide/helpWithGrails.adoc                   |   1 +
 guides/gorm-without-grails/v4/guide/howto.adoc     |  15 ++
 guides/gorm-without-grails/v4/guide/nextSteps.adoc |  11 +
 .../gorm-without-grails/v4/guide/requirements.adoc |   1 +
 .../v4/guide/runningTheApp.adoc                    |  27 ++
 guides/gorm-without-grails/v4/guide/training.adoc  |   1 +
 .../v4/guide/writingTheAppPartOne.adoc             |   7 +
 guides/gorm-without-grails/v4/manifest.yml         |  18 ++
 .../gorm-without-grails/v4/snippets/MANIFEST.yml   |  33 +++
 .../gorm-without-grails/v4/snippets/build.gradle   |  39 +++
 .../src/main/groovy/demo/Application.groovy        |  26 ++
 .../demo/controller/ManufacturerController.groovy  |  18 ++
 .../demo/controller/VehicleController.groovy       |  18 ++
 .../main/groovy/demo/domain/Manufacturer.groovy    |  18 ++
 .../src/main/groovy/demo/domain/Vehicle.groovy     |  17 ++
 .../src/main/groovy/demo/init/BootStrap.groovy     |  29 +++
 .../groovy/demo/service/ManufacturerService.groovy |  17 ++
 .../main/groovy/demo/service/VehicleService.groovy |  17 ++
 .../src/main/resources/application.properties      |   7 +
 .../v4/snippets/src/main/resources/application.yml |  10 +
 .../controller/ManufacturerControllerTest.groovy   |  19 ++
 .../demo/controller/VehicleControllerTest.groovy   |  19 ++
 guides/gorm-without-grails/v4/toc.yml              |  17 ++
 .../v3/guide/concurrentExecution.adoc              |  22 ++
 .../grails-scheduled/v3/guide/createSimpleJob.adoc |  66 +++++
 .../grails-scheduled/v3/guide/gettingStarted.adoc  |  11 +
 .../grails-scheduled/v3/guide/helpWithGrails.adoc  |   1 +
 guides/grails-scheduled/v3/guide/howto.adoc        |   1 +
 guides/grails-scheduled/v3/guide/install.adoc      |  15 ++
 guides/grails-scheduled/v3/guide/logchanges.adoc   |  11 +
 .../grails-scheduled/v3/guide/logicInService.adoc  |  26 ++
 .../v3/guide/logicInServiceTwo.adoc                |  21 ++
 .../grails-scheduled/v3/guide/runnableTasks.adoc   |  15 ++
 guides/grails-scheduled/v3/guide/summary.adoc      |   7 +
 .../grails-scheduled/v3/guide/taskScheduler.adoc   |  25 ++
 guides/grails-scheduled/v3/guide/training.adoc     |   1 +
 .../grails-scheduled/v3/guide/triggerManually.adoc |  52 ++++
 guides/grails-scheduled/v3/guide/writing.adoc      |   2 +
 guides/grails-scheduled/v3/manifest.yml            |  23 ++
 guides/grails-scheduled/v3/snippets/MANIFEST.yml   |  33 +++
 guides/grails-scheduled/v3/snippets/build.gradle   | 106 ++++++++
 .../v3/snippets/grails-app/conf/logback.groovy     |  39 +++
 .../grails-app/init/demo/Application.groovy        |  14 ++
 .../snippets/grails-app/init/demo/BootStrap.groovy |  21 ++
 .../services/demo/DailyEmailJobService.groovy      |  21 ++
 .../grails-app/services/demo/EmailService.groovy   |  16 ++
 .../services/demo/GenerateInvoiceJobService.groovy |  39 +++
 .../services/demo/GenerateInvoiceService.groovy    |  13 +
 .../services/demo/HelloWorldJobService.groovy      |  24 ++
 .../services/demo/RegisterService.groovy           |  34 +++
 .../demo/todayat/DailyMailJobService.groovy        |  39 +++
 .../grails-app/tasks/demo/EmailTask.groovy         |  22 ++
 .../groovy/demo/SchedulingConfiguration.groovy     |  19 ++
 guides/grails-scheduled/v3/toc.yml                 |  17 ++
 .../v4/guide/concurrentExecution.adoc              |  22 ++
 .../grails-scheduled/v4/guide/createSimpleJob.adoc |  66 +++++
 .../grails-scheduled/v4/guide/gettingStarted.adoc  |  11 +
 .../grails-scheduled/v4/guide/helpWithGrails.adoc  |   1 +
 guides/grails-scheduled/v4/guide/howto.adoc        |   1 +
 guides/grails-scheduled/v4/guide/install.adoc      |  15 ++
 guides/grails-scheduled/v4/guide/logchanges.adoc   |  11 +
 .../grails-scheduled/v4/guide/logicInService.adoc  |  26 ++
 .../v4/guide/logicInServiceTwo.adoc                |  21 ++
 .../grails-scheduled/v4/guide/runnableTasks.adoc   |  15 ++
 guides/grails-scheduled/v4/guide/summary.adoc      |   7 +
 .../grails-scheduled/v4/guide/taskScheduler.adoc   |  25 ++
 guides/grails-scheduled/v4/guide/training.adoc     |   1 +
 .../grails-scheduled/v4/guide/triggerManually.adoc |  52 ++++
 guides/grails-scheduled/v4/guide/writing.adoc      |   2 +
 guides/grails-scheduled/v4/manifest.yml            |  23 ++
 guides/grails-scheduled/v4/snippets/MANIFEST.yml   |  33 +++
 guides/grails-scheduled/v4/snippets/build.gradle   | 106 ++++++++
 .../v4/snippets/grails-app/conf/logback.groovy     |  39 +++
 .../grails-app/init/demo/Application.groovy        |  14 ++
 .../snippets/grails-app/init/demo/BootStrap.groovy |  21 ++
 .../services/demo/DailyEmailJobService.groovy      |  21 ++
 .../grails-app/services/demo/EmailService.groovy   |  16 ++
 .../services/demo/GenerateInvoiceJobService.groovy |  39 +++
 .../services/demo/GenerateInvoiceService.groovy    |  13 +
 .../services/demo/HelloWorldJobService.groovy      |  24 ++
 .../services/demo/RegisterService.groovy           |  34 +++
 .../demo/todayat/DailyMailJobService.groovy        |  39 +++
 .../grails-app/tasks/demo/EmailTask.groovy         |  22 ++
 .../groovy/demo/SchedulingConfiguration.groovy     |  19 ++
 guides/grails-scheduled/v4/toc.yml                 |  17 ++
 guides/vaadin-grails/v4/guide/aboutVaadin.adoc     |  21 ++
 guides/vaadin-grails/v4/guide/addingToVaadin.adoc  |  35 +++
 guides/vaadin-grails/v4/guide/addingView.adoc      |  68 +++++
 .../vaadin-grails/v4/guide/creatingTestData.adoc   |   7 +
 .../v4/guide/creatingTheControllers.adoc           |  41 +++
 .../vaadin-grails/v4/guide/creatingTheDomain.adoc  |  50 ++++
 .../v4/guide/creatingTheServices.adoc              |  41 +++
 guides/vaadin-grails/v4/guide/gettingStarted.adoc  |   1 +
 guides/vaadin-grails/v4/guide/helpWithGrails.adoc  |   1 +
 guides/vaadin-grails/v4/guide/howto.adoc           |   1 +
 guides/vaadin-grails/v4/guide/knownIssues.adoc     |   2 +
 guides/vaadin-grails/v4/guide/nextSteps.adoc       |   9 +
 guides/vaadin-grails/v4/guide/profile.adoc         |  10 +
 guides/vaadin-grails/v4/guide/requirements.adoc    |   1 +
 guides/vaadin-grails/v4/guide/runningTheApp.adoc   |  26 ++
 guides/vaadin-grails/v4/guide/themingTheApp.adoc   |  38 +++
 guides/vaadin-grails/v4/guide/training.adoc        |   1 +
 guides/vaadin-grails/v4/guide/writingTheApp.adoc   |   0
 guides/vaadin-grails/v4/manifest.yml               |  17 ++
 guides/vaadin-grails/v4/snippets/MANIFEST.yml      |  37 +++
 .../controllers/demo/GarageController.groovy       |  16 ++
 .../snippets/grails-app/domain/demo/Driver.groovy  |  19 ++
 .../v4/snippets/grails-app/domain/demo/Make.groovy |  17 ++
 .../snippets/grails-app/domain/demo/Model.groovy   |  17 ++
 .../v4/snippets/grails-app/domain/demo/User.groovy |  28 +++
 .../snippets/grails-app/domain/demo/Vehicle.groovy |  23 ++
 .../snippets/grails-app/init/demo/BootStrap.groovy |  26 ++
 .../grails-app/services/demo/DriverService.groovy  |  14 ++
 .../grails-app/services/demo/MakeService.groovy    |  13 +
 .../grails-app/services/demo/ModelService.groovy   |  13 +
 .../grails-app/services/demo/VehicleService.groovy |  25 ++
 .../src/main/groovy/demo/DemoGrailsUI.groovy       |  47 ++++
 .../src/main/groovy/demo/GarageView.groovy         | 278 +++++++++++++++++++++
 .../VAADIN/themes/vaadin-grails-theme/styles.scss  |  11 +
 .../vaadin-grails-theme/vaadin-grails-theme.scss   |  40 +++
 guides/vaadin-grails/v4/toc.yml                    |  23 ++
 168 files changed, 4426 insertions(+), 33 deletions(-)

diff --git a/conf/guides.yml b/conf/guides.yml
index edf1051a2b8..77144c4bf67 100644
--- a/conf/guides.yml
+++ b/conf/guides.yml
@@ -278,16 +278,10 @@ guides:
           - 'hibernate'
           - 'gorm'
           - 'grails4'
-        # sampleRef intentionally omitted in this PR.
-        # Upstream guide includes complete/grails-app/init/example/ManufacturerService.groovy which does not exist at the pinned SHA.
-        # Tracked for follow-up.
-        # sampleRef intentionally omitted in this PR.
-        # Upstream guide at master@1c0ea34a has an unresolvable include
-        # `complete/grails-app/init/example/ManufacturerService.groovy`
-        # which does not exist on disk at that SHA (the file lives in a
-        # different package). Vendoring will fail until either the
-        # upstream guide is patched or we pin to a SHA where the path is
-        # valid. Tracked for follow-up.
+        sampleRef:
+          repo: 'grails-guides/discriminator-per-tenant'
+          branch: 'master'
+          sha: 'bca6f1a42f1fc04e7a0d5f16304d2b77ff6c57cd'
 
   - name: 'gorm-event-listeners'
     title: 'GORM Event Listeners'
@@ -391,17 +385,10 @@ guides:
           - 'backend'
           - 'GORM'
           - 'hibernate'
-        # sampleRef intentionally omitted in this PR.
-        # Upstream guide includes complete/src/main/resources/application.properties but the upstream sample app uses application.yml.
-        # Tracked for follow-up.
-        # sampleRef intentionally omitted in this PR.
-        # Upstream guide at master@bafdfdc8 has an unresolvable include
-        # `include::{sourceDir}/src/main/resources/application.properties[]`,
-        # but the upstream sample app uses application.yml -- application.properties
-        # does not exist on disk at that SHA. Vendoring will fail until either:
-        #   - the upstream guide is patched to reference application.yml, OR
-        #   - we pin to an earlier SHA where application.properties existed.
-        # Tracked for follow-up.
+        sampleRef:
+          repo: 'grails-guides/gorm-without-grails'
+          branch: 'master'
+          sha: '14a7eea75d3292de56213d87ab34b14d6c87602e'
 
   - name: 'grails_i18n'
     title: 'How to change languages in a Grails app?'
@@ -1673,9 +1660,10 @@ guides:
           - 'job'
           - 'cron'
           - 'grails3'
-        # sampleRef intentionally omitted in this PR.
-        # Upstream guide has unresolvable include at the pinned SHA (same upstream issue as v4).
-        # Tracked for follow-up.
+        sampleRef:
+          repo: 'grails-guides/grails-scheduled'
+          branch: 'grails3'
+          sha: 'a77fe4cd8746c88c2865cdb15a85bb976f988e94'
       '4':
         sourcePath: guides/grails-scheduled/v4
         publicationDate: '2018-02-26'
@@ -1688,9 +1676,10 @@ guides:
           - 'job'
           - 'cron'
           - 'grails4'
-        # sampleRef intentionally omitted in this PR.
-        # Upstream guide has unresolvable include at the pinned SHA. Needs upstream patch or earlier-SHA pinning.
-        # Tracked for follow-up.
+        sampleRef:
+          repo: 'grails-guides/grails-scheduled'
+          branch: 'grails4'
+          sha: 'a0eb85a824bb304e47b92cf92a7359bd4576a89f'
 
   - name: 'grails-schwartz'
     title: 'Schedule periodic tasks inside your Grails applications'
@@ -2299,10 +2288,8 @@ guides:
           - 'vaadin'
           - 'frontend'
           - 'framework'
-        # sampleRef intentionally omitted in this PR.
-        # Upstream guide includes complete/src/main/webapp/VAADIN/themes/vaadin-grails-theme/styles.scss which does not exist at the pinned SHA.
-        # Tracked for follow-up.
-        # sampleRef intentionally omitted in this PR.
-        # Upstream guide at master@c69a3137 includes complete/src/main/webapp/VAADIN/themes/vaadin-grails-theme/styles.scss which does not exist on disk at the pinned SHA. Vendoring fails until upstream is patched or we pin to an earlier SHA.
-        # Tracked for follow-up.
+        sampleRef:
+          repo: 'grails-guides/vaadin-grails'
+          branch: 'master'
+          sha: 'a239a804e6b9811247a3a8290c7c779e096b5eb9'
 
diff --git a/guides/discriminator-per-tenant/v4/guide/gettingStarted.adoc b/guides/discriminator-per-tenant/v4/guide/gettingStarted.adoc
new file mode 100644
index 00000000000..52d8c1ceb70
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/gettingStarted.adoc
@@ -0,0 +1,5 @@
+In this guide you are going to build a Multi-Tenant application which partitions
+its data using a discriminator column with Grails and GORM.
+
+Using a discriminator column allows you handle different tenants (users)
+with a unique tenant identifier within the same database.
diff --git a/guides/discriminator-per-tenant/v4/guide/helpWithGrails.adoc b/guides/discriminator-per-tenant/v4/guide/helpWithGrails.adoc
new file mode 100644
index 00000000000..e062f614b1a
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/helpWithGrails.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-helpWithGrails.adoc[]
diff --git a/guides/discriminator-per-tenant/v4/guide/howto.adoc b/guides/discriminator-per-tenant/v4/guide/howto.adoc
new file mode 100644
index 00000000000..4499ccc603d
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/howto.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-howto.adoc[]
diff --git a/guides/discriminator-per-tenant/v4/guide/integrationTest.adoc b/guides/discriminator-per-tenant/v4/guide/integrationTest.adoc
new file mode 100644
index 00000000000..8b21eeff6ec
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/integrationTest.adoc
@@ -0,0 +1,33 @@
+We map the CRUD pages with the help of Geb Pages: 
+
+[source, groovy]
+.src/integration-test/groovy/example/ManufacturersPage.groovy
+----
+include::{sourcedir}/src/integration-test/groovy/example/ManufacturersPage.groovy[]	
+----
+
+[source, groovy]
+.src/integration-test/groovy/example/NewVehiclePage.groovy
+----
+include::{sourcedir}/src/integration-test/groovy/example/NewVehiclePage.groovy[]	
+----
+
+[source, groovy]
+.src/integration-test/groovy/example/ShowVehiclePage.groovy
+----
+include::{sourcedir}/src/integration-test/groovy/example/ShowVehiclePage.groovy[]	
+----
+
+[source, groovy]
+.src/integration-test/groovy/example/VehiclesPage.groovy
+----
+include::{sourcedir}/src/integration-test/groovy/example/VehiclesPage.groovy[]	
+----
+
+We test tenant selection with the help of a functional test: 
+
+[source, groovy]
+.src/integration-test/groovy/example/TenantSelectionFuncSpec.groovy
+----
+include::{sourcedir}/src/integration-test/groovy/example/TenantSelectionFuncSpec.groovy[]	
+----
\ No newline at end of file
diff --git a/guides/discriminator-per-tenant/v4/guide/requirements.adoc b/guides/discriminator-per-tenant/v4/guide/requirements.adoc
new file mode 100644
index 00000000000..0558fd749d7
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/requirements.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-requirements.adoc[]
diff --git a/guides/discriminator-per-tenant/v4/guide/runningTheApp.adoc b/guides/discriminator-per-tenant/v4/guide/runningTheApp.adoc
new file mode 100644
index 00000000000..c7d7059199f
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/runningTheApp.adoc
@@ -0,0 +1,11 @@
+include::{commondir}/common-runapp.adoc[]
+
+Now perform the following steps:
+
+1. Navigate to the home page and select "Audi"
+2. Enter data for a `Vehicle` to create a new `Vehicle`
+3. Note that the data will be created with `audi` as the value for the discriminator column `manufacturer` in the `vehicle` table.
+
+If you then navigate back to the homepage and select "Ford" the current tenant
+is switched. The webapp displays the data for the tenant `ford`. The discriminator column
+effectively isolates the data between the two tenants.
diff --git a/guides/discriminator-per-tenant/v4/guide/setupMultitenancy.adoc b/guides/discriminator-per-tenant/v4/guide/setupMultitenancy.adoc
new file mode 100644
index 00000000000..fd40910d9e7
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/setupMultitenancy.adoc
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/guides/discriminator-per-tenant/v4/guide/testingTheApp.adoc b/guides/discriminator-per-tenant/v4/guide/testingTheApp.adoc
new file mode 100644
index 00000000000..b2491dc98bd
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/testingTheApp.adoc
@@ -0,0 +1,74 @@
+Testing controller logic that uses Multi-Tenancy requires special considerations.
+
+Luckily GORM 6.1 makes it relatively simple to write unit tests.
+
+To write a unit test for the `VehicleController` class create a new +
+`src/test/groovy/example/VehicleControllerSpec.groovy` Spock specification:
+
+
+[source, groovy]
+.src/test/groovy/example/VehicleControllerSpec.groovy
+----
+include::{sourcedir}/src/test/groovy/example/VehicleControllerSpec.groovy[tags=class, indent=0]
+	...
+}
+----
+
+As you can see above the test extends `HibernateSpec`.
+
+To make testing simpler override the `tenantResolverClass` by overriding the `getConfiguration()` method of `HibernateSpec`:
+
+[source, groovy]
+.src/test/groovy/example/VehicleControllerSpec.groovy
+----
+include::{sourcedir}/src/test/groovy/example/VehicleControllerSpec.groovy[tags=config, indent=0]
+----
+
+This will allow you to use link:{gormapi}/org/grails/datastore/mapping/multitenancy/resolvers/SystemPropertyTenantResolver.html[SystemPropertyTenantResolver] for changing the tenant id within the test.
+
+Next step is to provide a `setup` method that configures the `VehicleService` for the controller:
+
+[source, groovy]
+.src/test/groovy/example/VehicleControllerSpec.groovy
+----
+include::{sourcedir}/src/test/groovy/example/VehicleControllerSpec.groovy[tags=setup, indent=0]
+----
+
+<1> Define a `vehicleService` as a property of the unit test
+<2> Set the tenant id to `audi` for the purposes of the test
+<3> Lookup the `VehicleService` implementation from GORM
+<4> Assign the `VehicleService` to the controller under test
+
+To ensure proper cleanup you should also clear the tenant id in a `cleanup` method:
+
+[source, groovy]
+.src/test/groovy/example/VehicleControllerSpec.groovy
+----
+include::{sourcedir}/src/test/groovy/example/VehicleControllerSpec.groovy[tags=cleanup, indent=0]
+----
+
+With that done it is trivial to test the controller logic, for example to test the `index` action with no data:
+
+[source, groovy]
+.src/test/groovy/example/VehicleControllerSpec.groovy
+----
+include::{sourcedir}/src/test/groovy/example/VehicleControllerSpec.groovy[tags=index, indent=0]
+----
+
+You can also write tests to test the case where no tenant id is present by clearing the tenant id:
+
+[source, groovy]
+.src/test/groovy/example/VehicleControllerSpec.groovy
+----
+include::{sourcedir}/src/test/groovy/example/VehicleControllerSpec.groovy[tags=noTenant, indent=0]
+----
+
+Testing more complex interactions like saving data is possible too:
+
+[source, groovy]
+.src/test/groovy/example/VehicleControllerSpec.groovy
+----
+include::{sourcedir}/src/test/groovy/example/VehicleControllerSpec.groovy[tags=save, indent=0]
+----
+
+Note that within the assertions of the above test we use the `vehicleService` which makes sure the correct tenant is used when making the assertion.
diff --git a/guides/discriminator-per-tenant/v4/guide/training.adoc b/guides/discriminator-per-tenant/v4/guide/training.adoc
new file mode 100644
index 00000000000..11b7772a2c8
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/training.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-training.adoc[]
diff --git a/guides/discriminator-per-tenant/v4/guide/writingTheApp.adoc b/guides/discriminator-per-tenant/v4/guide/writingTheApp.adoc
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/guides/discriminator-per-tenant/v4/guide/writingTheApp/domainClasses.adoc b/guides/discriminator-per-tenant/v4/guide/writingTheApp/domainClasses.adoc
new file mode 100644
index 00000000000..e75b10ab67d
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/writingTheApp/domainClasses.adoc
@@ -0,0 +1,38 @@
+When creating domain classes for your application you will typically have domain classes that
+are Multi-Tenant and others that are not.
+
+For domain classes which won't be using Multi-Tenancy simply define them as you
+would normally do.
+
+For this example, the `Manufacturer` will be the provider of tenant ids. The name
+of the `Manufacturer` will be used as the tenant identifier.
+
+[source, groovy]
+.grails-app/domain/example/Manufacturer.groovy
+----
+include::{sourcedir}/grails-app/domain/example/Manufacturer.groovy[]
+----
+
+Next step is to define domain classes that can only be accessed by a given tenant:
+
+[source, groovy]
+.grails-app/domain/example/Engine.groovy
+----
+include::{sourcedir}/grails-app/domain/example/Engine.groovy[]
+----
+
+[source, groovy]
+.grails-app/domain/example/Vehicle.groovy
+----
+include::{sourcedir}/grails-app/domain/example/Vehicle.groovy[]
+----
+
+<1> Both domain classes implement the link:{gormapi}/grails/gorm/MultiTenant.html[MultiTenant trait]
+<2> _manufacturer_ property is used as the tenant id discriminator column.
+
+The `Vehicle` and `Engine` domain classes both implement the
+link:{gormapi}/grails/gorm/MultiTenant.html[MultiTenant] trait. GORM resolves the
+entities to use from the resulting tenant id
+returned from the configured
+link:{gormapi}/org/grails/datastore/mapping/multitenancy/TenantResolver.html[TenantResolver] by
+using the tenant identifier discriminator column.
diff --git a/guides/discriminator-per-tenant/v4/guide/writingTheApp/multiTenantLogic.adoc b/guides/discriminator-per-tenant/v4/guide/writingTheApp/multiTenantLogic.adoc
new file mode 100644
index 00000000000..d4356481349
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/writingTheApp/multiTenantLogic.adoc
@@ -0,0 +1,20 @@
+include::{commondir}/common-multitenancytransforms.adoc[]
+
+To implement the logic to save and retrieve `Vehicle` instances create a new  +
+`grails-app/services/example/VehicleService.groovy`
+file and annotate it within the link:{gormapi}/grails/gorm/multitenancy/CurrentTenant.html[CurrentTenant]
+and link:{gormapi}/grails/gorm/services/Service.html[Service] annotations:
+
+[source, groovy]
+.grails-app/services/example/VehicleService.groovy
+----
+include::{sourcedir}/grails-app/services/example/VehicleService.groovy[tags=class, indent=0]
+}
+----
+<1> The link:{gormapi}/grails/gorm/services/Service.html[Service] transformation will ensure any abstract methods that can be implemented by GORM are implemented
+<2> The link:{gormapi}/grails/gorm/multitenancy/CurrentTenant.html[CurrentTenant] transformation will ensure any method that is executed on the service resolves the current tenant first and binds a Hibernate session.
+
+NOTE: The class is `abstract` because many of the methods will be implemented for you by GORM.
+
+
+Now lets take a look at how to implement querying logic for a Multi-Tenant application.
diff --git a/guides/discriminator-per-tenant/v4/guide/writingTheApp/multiTenantLogic/readingData.adoc b/guides/discriminator-per-tenant/v4/guide/writingTheApp/multiTenantLogic/readingData.adoc
new file mode 100644
index 00000000000..a2c4f4d3cee
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/writingTheApp/multiTenantLogic/readingData.adoc
@@ -0,0 +1,52 @@
+To implement Multi-Tenant queries in a GORM Data Service simply add abstract methods that correspond to link:{gormdocs}#_data_service_queries[one of the supported conventions in GORM]:
+
+[source, groovy]
+.grails-app/services/example/VehicleService.groovy
+----
+include::{sourcedir}/grails-app/services/example/VehicleService.groovy[tags=queries, indent=0]
+----
+
+<1> The `list` method returns a list of `Vehicle` instances and takes optional arguments as a map to perform pagination
+<2> The `count` method counts the number of `Vehicle` instances
+<3> The `find` method finds a single `Vehicle` by `id`
+
+Now it is time to write a controller that can use these newly defined methods. First, create a
+new `grails-app/controllers/example/VehicleController.groovy` class with either
+the `create-controller` command or your preferred IDE.
+
+The `VehicleController` should define a property referencing the previously created `VehicleService`:
+
+[source, groovy]
+.grails-app/controllers/example/VehicleController.groovy
+----
+include::{sourcedir}/grails-app/controllers/example/VehicleController.groovy[tags=class, indent=0]
+    ...
+}
+----
+
+Now run `grails generate-views` to generate some default GSP views that can render the `Vehicle` instances:
+
+[source,bash]
+----
+$ grails generate-views example.Vehicle
+----
+
+Next add an entry into the `UrlMappings.groovy` file to map the `/vehicles` URI:
+
+[source, groovy]
+.grails-app/controllers/example/UrlMappings.groovy
+----
+include::{sourcedir}/grails-app/controllers/example/UrlMappings.groovy[tag=vehicles, indent=0]
+----
+
+Now you are ready to add the query logic to read `Vehicle` instances for each tenant. Update `VehicleController` with the following read operations:
+
+[source, groovy]
+.grails-app/controllers/example/VehicleController.groovy
+----
+include::{sourcedir}/grails-app/controllers/example/VehicleController.groovy[tags=index, indent=0]
+
+include::{sourcedir}/grails-app/controllers/example/VehicleController.groovy[tags=show, indent=0]
+----
+
+Both the `find` and `show` actions use the `VehicleService` to locate `Vehicle` instances. The `VehicleService` will ensure the correct tenant is resolved and the correct data returned for each tenant.
diff --git a/guides/discriminator-per-tenant/v4/guide/writingTheApp/multiTenantLogic/writingData.adoc b/guides/discriminator-per-tenant/v4/guide/writingTheApp/multiTenantLogic/writingData.adoc
new file mode 100644
index 00000000000..cac9b0d6346
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/writingTheApp/multiTenantLogic/writingData.adoc
@@ -0,0 +1,37 @@
+To add logic to perform write operations you can simply modify the `VehicleService` and add new abstract methods for `save` and `delete`:
+
+
+[source, groovy]
+.grails-app/services/example/VehicleService.groovy
+----
+include::{sourcedir}/grails-app/services/example/VehicleService.groovy[tags=save, indent=0]
+
+include::{sourcedir}/grails-app/services/example/VehicleService.groovy[tags=delete, indent=0]
+----
+
+The above `save` and `delete` methods will be implemented automatically for you.
+
+TIP: GORM Data Services are smart about adding appropriate transaction semantics to each method (for example, `readOnly` for read operations). However you can override the transaction semantics by adding the `@Transactional` annotation yourself.
+
+To implement updates you can add a new method that calls the existing abstract `find` method:
+
+[source, groovy]
+.grails-app/services/example/VehicleService.groovy
+----
+include::{sourcedir}/grails-app/services/example/VehicleService.groovy[tags=update, indent=0]
+----
+
+This demonstrates an important concept of GORM Data Services: It is possible to easily mix methods you define with ones that are automatically implemented for you by GORM.
+
+The corresponding controller actions to call `VehicleService` and expose these write operations are also trivial:
+
+[source, groovy]
+.grails-app/controllers/example/VehicleController.groovy
+----
+include::{sourcedir}/grails-app/controllers/example/VehicleController.groovy[tags=save, indent=0]
+
+include::{sourcedir}/grails-app/controllers/example/VehicleController.groovy[tags=update, indent=0]
+
+include::{sourcedir}/grails-app/controllers/example/VehicleController.groovy[tags=delete, indent=0]
+----
+
diff --git a/guides/discriminator-per-tenant/v4/guide/writingTheApp/seedData.adoc b/guides/discriminator-per-tenant/v4/guide/writingTheApp/seedData.adoc
new file mode 100644
index 00000000000..9ee2ac9a8a8
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/writingTheApp/seedData.adoc
@@ -0,0 +1,14 @@
+To setup some test data you can modify the `Application` class to implement the `ApplicationRunner` interface to run transactional logic on startup:
+
+[source, groovy]
+.grails-app/controllers/example/Application.groovy
+----
+include::{sourcedir}/grails-app/init/example/Application.groovy[]
+----
+
+<1> Implement the `ApplicationRunner` interface
+<2> Mark the `run` method as transactional with `@Transactional`
+<3> Use `saveAll` to save two `Manufacturer` instances
+
+In the example about two `Manufacturer` instances are saved that will correspond
+to the two tenants supported by this application. 
diff --git a/guides/discriminator-per-tenant/v4/guide/writingTheApp/setupMultitenancy/multiTenancyMode.adoc b/guides/discriminator-per-tenant/v4/guide/writingTheApp/setupMultitenancy/multiTenancyMode.adoc
new file mode 100644
index 00000000000..7702bc97c0a
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/writingTheApp/setupMultitenancy/multiTenancyMode.adoc
@@ -0,0 +1,11 @@
+include::{commondir}/common-multitenancymode.adoc[]
+
+In this case the required Multi-Tenancy mode is `DISCRIMINATOR` and it can be configured using the `grails.gorm.multiTenancy.mode` setting:
+
+[source, groovy]
+.grails-app/conf/application.yml
+----
+include::{sourcedir}/grails-app/conf/application.yml[tag=grails]
+include::{sourcedir}/grails-app/conf/application.yml[tag=gorm]
+include::{sourcedir}/grails-app/conf/application.yml[tag=multiTenancy]
+----
diff --git a/guides/discriminator-per-tenant/v4/guide/writingTheApp/setupMultitenancy/multiTenancyResolver.adoc b/guides/discriminator-per-tenant/v4/guide/writingTheApp/setupMultitenancy/multiTenancyResolver.adoc
new file mode 100644
index 00000000000..225041d7eba
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/writingTheApp/setupMultitenancy/multiTenancyResolver.adoc
@@ -0,0 +1,3 @@
+include::{commondir}/common-tenantresolver.adoc[]
+
+For this example we are going to be using `SessionTenantResolver` and storing the tenant id within the current user session.
diff --git a/guides/discriminator-per-tenant/v4/guide/writingTheApp/tenantSelection.adoc b/guides/discriminator-per-tenant/v4/guide/writingTheApp/tenantSelection.adoc
new file mode 100644
index 00000000000..98fbc6e7d73
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/guide/writingTheApp/tenantSelection.adoc
@@ -0,0 +1,78 @@
+The first step to supporting Multi-Tenancy in your application is implementing some form of tenant selection. This could be to resolve the tenant via a DNS subdomain, or it could be part of your applications registration process if you are using authentication with Spring Security.
+
+To keep things simple for the example we are going to implement a simple mechanism that provides a UI to store the `tenantId` within the users HTTP session.
+
+
+First, create a GORM Data service to `Manufacturer`:
+
+[source, groovy]
+.grails-app/controllers/example/ManufacturerService.groovy
+----
+include::../../snippets/grails-app/services/example/ManufacturerService.groovy[]
+----
+
+Then, create a new `ManufacturerController` use `create-controller` or your preferred IDE:
+
+[source,bash]
+----
+$ grails create-controller Manufacturer
+----
+
+Next modify the `UrlMappings.groovy` file to map the root of the application to the `index` action:
+
+[source, groovy]
+.grails-app/controllers/example/UrlMappings.groovy
+----
+include::{sourcedir}/grails-app/controllers/example/UrlMappings.groovy[tag=home, indent=0]
+----
+
+Then define an `index` action that lists of all the Manufacturers and renders the `grails-app/views/index.gsp` view.
+
+[source, groovy]
+.grails-app/controllers/example/ManufacturerController.groovy
+----
+include::{sourcedir}/grails-app/controllers/example/ManufacturerController.groovy[tag=packageDeclaration]
+include::{sourcedir}/grails-app/controllers/example/ManufacturerController.groovy[tag=importStatements]
+include::{sourcedir}/grails-app/controllers/example/ManufacturerController.groovy[tag=classDeclaration]
+include::{sourcedir}/grails-app/controllers/example/ManufacturerController.groovy[tag=index]
+include::{sourcedir}/grails-app/controllers/example/ManufacturerController.groovy[tag=closeBracket]
+----
+
+Within the `grails-app/views/index.gsp` file, simply iterate through each result and create a link to the `select` action
+
+[source,xml]
+.grails-app/views/index.gsp
+----
+include::{sourcedir}/grails-app/views/index.gsp[tag=iterateManufacturers, indent=0]
+----
+
+The `select` action, selects the current tenant and stores the tenant within the current user's HTTP session:
+
+[source, groovy]
+.grails-app/controllers/example/ManufacturerController.groovy
+----
+include::{sourcedir}/grails-app/controllers/example/ManufacturerController.groovy[tag=select, indent=0]
+----
+
+<1> Fetches a Manufacturer identified by the supplied `id`
+<2> The selected tenant is stored within a session attribute.
+
+
+The `select` action will find a `Manufacturer` and store the name of the `Manufacturer`
+in lower case as the current tenant within the HTTP session.
+
+This causes link:{gormapi}/org/grails/datastore/mapping/multitenancy/web/SessionTenantResolver.html[SessionTenantResolver] to resolve the correct tenant id from the HTTP session.
+
+Finally, to improve error handling you can map every occurrence of `TenantNotFoundException` to redirect back to the list of manufacturers:
+
+[source, groovy]
+.grails-app/controllers/example/UrlMappings.groovy
+----
+include::{sourcedir}/grails-app/controllers/example/UrlMappings.groovy[tag=noTenant, indent=0]
+----
+
+With these changes in place you will able to select each tenant from the homepage:
+
+image::available-tenants.png[]
+
+Now that it is possible to select a tenant, lets create a logic that is able to use the currently active tenant.
diff --git a/guides/discriminator-per-tenant/v4/manifest.yml b/guides/discriminator-per-tenant/v4/manifest.yml
new file mode 100644
index 00000000000..6ab046f5f34
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/manifest.yml
@@ -0,0 +1,19 @@
+# Generated by :vendorGuide
+name: discriminator-per-tenant
+version: '4'
+title: Single Database Multi-Tenancy - Discriminator Column
+subtitle: Learn how to leverage Multi-Tenancy features of GORM to build an application
+  which uses a single database, but it partitions its data using a discriminator column.
+authors:
+- Sergio del Amo
+category: GORM
+tags:
+- multi-tenancy
+- hibernate
+- gorm
+- grails4
+publicationDate: '2017-06-26'
+githubSlug: grails-guides/discriminator-per-tenant
+githubBranch: master
+githubSha: bca6f1a42f1fc04e7a0d5f16304d2b77ff6c57cd
+sourceCommitDate: '2026-05-01T08:40:27-04:00'
diff --git a/guides/discriminator-per-tenant/v4/snippets/MANIFEST.yml b/guides/discriminator-per-tenant/v4/snippets/MANIFEST.yml
new file mode 100644
index 00000000000..196488ae33f
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/MANIFEST.yml
@@ -0,0 +1,41 @@
+# Generated by :vendorGuide
+source:
+  repo: grails-guides/discriminator-per-tenant
+  branch: master
+  sha: bca6f1a42f1fc04e7a0d5f16304d2b77ff6c57cd
+  capturedAt: '2026-05-01'
+entries:
+- vendoredPath: src/integration-test/groovy/example/ManufacturersPage.groovy
+  upstreamPath: complete/src/integration-test/groovy/example/ManufacturersPage.groovy
+- vendoredPath: src/integration-test/groovy/example/NewVehiclePage.groovy
+  upstreamPath: complete/src/integration-test/groovy/example/NewVehiclePage.groovy
+- vendoredPath: src/integration-test/groovy/example/ShowVehiclePage.groovy
+  upstreamPath: complete/src/integration-test/groovy/example/ShowVehiclePage.groovy
+- vendoredPath: src/integration-test/groovy/example/VehiclesPage.groovy
+  upstreamPath: complete/src/integration-test/groovy/example/VehiclesPage.groovy
+- vendoredPath: src/integration-test/groovy/example/TenantSelectionFuncSpec.groovy
+  upstreamPath: complete/src/integration-test/groovy/example/TenantSelectionFuncSpec.groovy
+- vendoredPath: src/test/groovy/example/VehicleControllerSpec.groovy
+  upstreamPath: complete/src/test/groovy/example/VehicleControllerSpec.groovy
+- vendoredPath: grails-app/domain/example/Manufacturer.groovy
+  upstreamPath: complete/grails-app/domain/example/Manufacturer.groovy
+- vendoredPath: grails-app/domain/example/Engine.groovy
+  upstreamPath: complete/grails-app/domain/example/Engine.groovy
+- vendoredPath: grails-app/domain/example/Vehicle.groovy
+  upstreamPath: complete/grails-app/domain/example/Vehicle.groovy
+- vendoredPath: grails-app/services/example/VehicleService.groovy
+  upstreamPath: complete/grails-app/services/example/VehicleService.groovy
+- vendoredPath: grails-app/init/example/Application.groovy
+  upstreamPath: complete/grails-app/init/example/Application.groovy
+- vendoredPath: grails-app/services/example/ManufacturerService.groovy
+  upstreamPath: complete/grails-app/services/example/ManufacturerService.groovy
+- vendoredPath: grails-app/controllers/example/UrlMappings.groovy
+  upstreamPath: complete/grails-app/controllers/example/UrlMappings.groovy
+- vendoredPath: grails-app/controllers/example/ManufacturerController.groovy
+  upstreamPath: complete/grails-app/controllers/example/ManufacturerController.groovy
+- vendoredPath: grails-app/views/index.gsp
+  upstreamPath: complete/grails-app/views/index.gsp
+- vendoredPath: grails-app/conf/application.yml
+  upstreamPath: complete/grails-app/conf/application.yml
+- vendoredPath: grails-app/controllers/example/VehicleController.groovy
+  upstreamPath: complete/grails-app/controllers/example/VehicleController.groovy
diff --git a/guides/discriminator-per-tenant/v4/snippets/grails-app/conf/application.yml b/guides/discriminator-per-tenant/v4/snippets/grails-app/conf/application.yml
new file mode 100644
index 00000000000..bf42d0ed3d1
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/grails-app/conf/application.yml
@@ -0,0 +1,115 @@
+---
+#tag::grails[]
+grails:
+#end::grails[]
+    profile: web
+    codegen:
+        defaultPackage: example
+    #tag::gorm[]
+    gorm:
+    #end::gorm[]
+        reactor:
+            # Whether to translate GORM events into Reactor events
+            # Disabled by default for performance reasons
+            events: false
+        #tag::multiTenancy[]
+        multiTenancy:
+            mode: DISCRIMINATOR
+            tenantResolverClass: org.grails.datastore.mapping.multitenancy.web.SessionTenantResolver
+        #end::multiTenancy[]
+info:
+    app:
+        name: '@info.app.name@'
+        version: '@info.app.version@'
+        grailsVersion: '@info.app.grailsVersion@'
+spring:
+    jmx:
+        unique-names: true
+    main:
+        banner-mode: "off"
+    groovy:
+        template:
+            check-template-location: false
+    devtools:
+        restart:
+            additional-exclude:
+                - '*.gsp'
+                - '**/*.gsp'
+                - '*.gson'
+                - '**/*.gson'
+                - 'logback.groovy'
+                - '*.properties'
+management:
+    endpoints:
+        enabled-by-default: false
+---
+grails:
+    mime:
+        disable:
+            accept:
+                header:
+                    userAgents:
+                        - Gecko
+                        - WebKit
+                        - Presto
+                        - Trident
+        types:
+            all: '*/*'
+            atom: application/atom+xml
+            css: text/css
+            csv: text/csv
+            form: application/x-www-form-urlencoded
+            html:
+              - text/html
+              - application/xhtml+xml
+            js: text/javascript
+            json:
+              - application/json
+              - text/json
+            multipartForm: multipart/form-data
+            pdf: application/pdf
+            rss: application/rss+xml
+            text: text/plain
+            hal:
+              - application/hal+json
+              - application/hal+xml
+            xml:
+              - text/xml
+              - application/xml
+    urlmapping:
+        cache:
+            maxsize: 1000
+    controllers:
+        defaultScope: singleton
+    converters:
+        encoding: UTF-8
+    views:
+        default:
+            codec: html
+        gsp:
+            encoding: UTF-8
+            htmlcodec: xml
+            codecs:
+                expression: html
+                scriptlets: html
+                taglib: none
+                staticparts: none
+endpoints:
+    jmx:
+        unique-names: true
+
+---
+hibernate:
+    cache:
+        queries: false
+        use_second_level_cache: false
+        use_query_cache: false
+
+dataSource:
+    pooled: true
+    jmxExport: true
+    driverClassName: org.h2.Driver
+    username: sa
+    password: ''
+    dbCreate: create-drop
+    url: jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
\ No newline at end of file
diff --git a/guides/discriminator-per-tenant/v4/snippets/grails-app/controllers/example/ManufacturerController.groovy b/guides/discriminator-per-tenant/v4/snippets/grails-app/controllers/example/ManufacturerController.groovy
new file mode 100644
index 00000000000..57d8ddc2c7a
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/grails-app/controllers/example/ManufacturerController.groovy
@@ -0,0 +1,41 @@
+// tag::packageDeclaration[]
+package example
+
+// end::packageDeclaration[]
+// tag::importStatements[]
+import org.grails.datastore.mapping.multitenancy.web.SessionTenantResolver
+import grails.gorm.transactions.ReadOnly
+import groovy.transform.CompileStatic
+
+// end::importStatements[]
+
+// tag::classDeclaration[]
+@CompileStatic
+class ManufacturerController {
+// end::classDeclaration[]
+    ManufacturerService manufacturerService
+
+    // tag::index[]
+    @ReadOnly
+    def index() {
+        render view: '/index', model: [manufacturers: manufacturerService.findAll()]
+    }
+    // end::index[]
+
+    // tag::select[]
+    @ReadOnly
+    def select(String id) {
+        Manufacturer m = manufacturerService.findByName(id) // <1>
+        if ( m ) {
+            session.setAttribute(SessionTenantResolver.ATTRIBUTE, m.name.toLowerCase()) // <2>
+            redirect controller: 'vehicle' // <3>
+        }
+        else {
+            render status: 404
+        }
+    }
+    // end::select[]
+
+// tag::closeBracket[]
+}
+// end::closeBracket[]
diff --git a/guides/discriminator-per-tenant/v4/snippets/grails-app/controllers/example/UrlMappings.groovy b/guides/discriminator-per-tenant/v4/snippets/grails-app/controllers/example/UrlMappings.groovy
new file mode 100644
index 00000000000..0bcf6ceacc1
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/grails-app/controllers/example/UrlMappings.groovy
@@ -0,0 +1,27 @@
+package example
+
+import org.grails.datastore.mapping.multitenancy.exceptions.TenantNotFoundException
+
+class UrlMappings {
+
+    static mappings = {
+        // tag::home[]
+        '/'(controller: 'manufacturer')
+        // end::home[]
+
+        // tag::noTenant[]
+        '500' (controller: 'manufacturer', exception: TenantNotFoundException)
+        // end::noTenant[]
+
+        // tag::manufacturerSelect[]
+        "/manufacturer/$id"(controller: 'manufacturer', action: 'select')
+        // end::manufacturerSelect[]
+
+        // tag::vehicles[]
+        '/vehicles'(resources: 'vehicle')
+        // end::vehicles[]
+
+        '500'(view: '/error')
+        '404'(view: '/notFound')
+    }
+}
diff --git a/guides/discriminator-per-tenant/v4/snippets/grails-app/controllers/example/VehicleController.groovy b/guides/discriminator-per-tenant/v4/snippets/grails-app/controllers/example/VehicleController.groovy
new file mode 100644
index 00000000000..e216d40e056
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/grails-app/controllers/example/VehicleController.groovy
@@ -0,0 +1,91 @@
+package example
+
+// tag::class[]
+import static org.springframework.http.HttpStatus.NOT_FOUND
+import grails.gorm.multitenancy.CurrentTenant
+import grails.validation.ValidationException
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class VehicleController  {
+
+    static allowedMethods = [save: 'POST', update: 'PUT', delete: 'DELETE']
+
+    VehicleService vehicleService
+// end::class[]
+
+    // tag::index[]
+    def index(Integer max) {
+        params.max = Math.min(max ?: 10, 100)
+        respond vehicleService.list(params), model: [vehicleCount: vehicleService.count()]
+    }
+    // end::index[]
+
+    // tag::show[]
+    def show(Long id) {
+        Vehicle vehicle = id ? vehicleService.find(id) : null
+        respond vehicle
+    }
+    // end::show[]
+
+    // tag::create[]
+    @CurrentTenant
+    def create() {
+        respond new Vehicle(params)
+    }
+
+    @CurrentTenant
+    def edit(Long id) {
+        show id
+    }
+    // end::create[]
+
+    // tag::save[]
+    def save(String model, Integer year) {
+        try {
+            Vehicle vehicle = vehicleService.save(model, year)
+            flash.message = 'Vehicle created'
+            redirect vehicle
+        } catch (ValidationException e) {
+            respond e.errors, view: 'create'
+        }
+    }
+    // end::save[]
+
+    // tag::update[]
+    def update(Long id, String model, Integer year) {
+        try {
+            Vehicle vehicle = vehicleService.update(id, model, year)
+            if (vehicle == null) {
+                notFound()
+            } else if ( vehicle.hasErrors() ) {
+                redirect action: 'edit', params: [id: id]
+            }
+            else {
+                flash.message = 'Vehicle updated'
+                redirect vehicle
+            }
+        } catch (ValidationException e) {
+            respond e.errors, view: 'edit'
+        }
+    }
+
+    protected void notFound() {
+        flash.message = 'Vehicle not found'
+        redirect uri: '/vehicles', status: NOT_FOUND
+    }
+    // end::update[]
+
+    // tag::delete[]
+    def delete(Long id) {
+        Vehicle vehicle = vehicleService.delete(id)
+        if (vehicle == null) {
+            notFound()
+        }
+        else {
+            flash.message = 'Vehicle Deleted'
+            redirect action: 'index', method: 'GET'
+        }
+    }
+    // end::delete[]
+}
diff --git a/guides/discriminator-per-tenant/v4/snippets/grails-app/domain/example/Engine.groovy b/guides/discriminator-per-tenant/v4/snippets/grails-app/domain/example/Engine.groovy
new file mode 100644
index 00000000000..4ed81a0f0ec
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/grails-app/domain/example/Engine.groovy
@@ -0,0 +1,16 @@
+package example
+
+import grails.gorm.MultiTenant
+
+class Engine implements MultiTenant<Engine> { // <1>
+    Integer cylinders
+    String manufacturer  // <2>
+
+    static constraints = {
+        cylinders nullable: false
+    }
+
+    static mapping = {
+        tenantId name:'manufacturer'  // <2>
+    }
+}
diff --git a/guides/discriminator-per-tenant/v4/snippets/grails-app/domain/example/Manufacturer.groovy b/guides/discriminator-per-tenant/v4/snippets/grails-app/domain/example/Manufacturer.groovy
new file mode 100644
index 00000000000..8207790fe29
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/grails-app/domain/example/Manufacturer.groovy
@@ -0,0 +1,12 @@
+package example
+
+import grails.compiler.GrailsCompileStatic
+
+@GrailsCompileStatic
+class Manufacturer {
+    String name
+
+    static constraints = {
+        name blank: false
+    }
+}
diff --git a/guides/discriminator-per-tenant/v4/snippets/grails-app/domain/example/Vehicle.groovy b/guides/discriminator-per-tenant/v4/snippets/grails-app/domain/example/Vehicle.groovy
new file mode 100644
index 00000000000..c7c9ae722da
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/grails-app/domain/example/Vehicle.groovy
@@ -0,0 +1,19 @@
+package example
+
+import grails.gorm.MultiTenant
+
+class Vehicle implements MultiTenant<Vehicle> { // <1>
+    String model
+    Integer year
+    String manufacturer // <2>
+
+    static hasMany = [engines: Engine]
+    static constraints = {
+        model blank:false
+        year min:1980
+    }
+
+    static mapping = {
+        tenantId name:'manufacturer'  // <2>
+    }
+}
diff --git a/guides/discriminator-per-tenant/v4/snippets/grails-app/init/example/Application.groovy b/guides/discriminator-per-tenant/v4/snippets/grails-app/init/example/Application.groovy
new file mode 100644
index 00000000000..5a4abdaab2b
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/grails-app/init/example/Application.groovy
@@ -0,0 +1,25 @@
+package example
+
+import grails.boot.GrailsApp
+import grails.boot.config.GrailsAutoConfiguration
+import org.springframework.boot.ApplicationArguments
+import org.springframework.boot.ApplicationRunner
+import grails.gorm.transactions.Transactional
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class Application extends GrailsAutoConfiguration implements ApplicationRunner { // <1>
+
+    static void main(String[] args) {
+        GrailsApp.run(Application, args)
+    }
+
+    @Override
+    @Transactional
+    void run(ApplicationArguments args) throws Exception { // <2>
+        Manufacturer.saveAll( // <3>
+            new Manufacturer(name: 'Audi'),
+            new Manufacturer(name: 'Ford')
+        )
+    }
+}
diff --git a/guides/discriminator-per-tenant/v4/snippets/grails-app/services/example/ManufacturerService.groovy b/guides/discriminator-per-tenant/v4/snippets/grails-app/services/example/ManufacturerService.groovy
new file mode 100644
index 00000000000..64b471c0cfd
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/grails-app/services/example/ManufacturerService.groovy
@@ -0,0 +1,16 @@
+package example
+
+import grails.gorm.services.Service
+
+@Service(Manufacturer)
+interface ManufacturerService {
+
+    int count()
+
+    Manufacturer save(String name)
+
+    List<Manufacturer> findAll()
+
+    Manufacturer findByName(String name)
+
+}
\ No newline at end of file
diff --git a/guides/discriminator-per-tenant/v4/snippets/grails-app/services/example/VehicleService.groovy b/guides/discriminator-per-tenant/v4/snippets/grails-app/services/example/VehicleService.groovy
new file mode 100644
index 00000000000..e4338e127f8
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/grails-app/services/example/VehicleService.groovy
@@ -0,0 +1,47 @@
+package example
+
+// tag::class[]
+import grails.gorm.multitenancy.CurrentTenant
+import grails.gorm.services.Service
+import grails.gorm.transactions.Transactional
+import groovy.transform.CompileStatic
+
+@Service(Vehicle) // <1>
+@CurrentTenant // <2>
+@CompileStatic
+abstract class VehicleService {
+// end::class[]
+
+    // tag::queries[]
+    abstract List<Vehicle> list(Map args ) // <1>
+
+    abstract Integer count() // <2>
+
+    abstract Vehicle find(Serializable id) // <3>
+
+    // end::queries[]
+
+    // tag::save[]
+    abstract Vehicle save(String model,
+                            Integer year)
+    // end::save[]
+
+    // tag::update[]
+    @Transactional
+    Vehicle update( Serializable id, // <5>
+                    String model,
+                    Integer year) {
+        Vehicle vehicle = find(id)
+        if (vehicle != null) {
+            vehicle.model = model
+            vehicle.year = year
+            vehicle.save(failOnError:true)
+        }
+        vehicle
+    }
+    // end::update[]
+
+    // tag::delete[]
+    abstract Vehicle delete(Serializable id)
+    // end::delete[]
+}
diff --git a/guides/discriminator-per-tenant/v4/snippets/grails-app/views/index.gsp b/guides/discriminator-per-tenant/v4/snippets/grails-app/views/index.gsp
new file mode 100644
index 00000000000..f31ff140395
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/grails-app/views/index.gsp
@@ -0,0 +1,80 @@
+<!doctype html>
+<html>
+<head>
+    <meta name="layout" content="main"/>
+    <title>Welcome to Grails</title>
+
+    <asset:link rel="icon" href="favicon.ico" type="image/x-ico" />
+</head>
+<body>
+    <content tag="nav">
+        <li class="dropdown">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Application Status <span class="caret"></span></a>
+            <ul class="dropdown-menu">
+                <li><a href="#">Environment: ${grails.util.Environment.current.name}</a></li>
+                <li><a href="#">App profile: ${grailsApplication.config.grails?.profile}</a></li>
+                <li><a href="#">App version:
+                    <g:meta name="info.app.version"/></a>
+                </li>
+                <li role="separator" class="divider"></li>
+                <li><a href="#">Grails version:
+                    <g:meta name="info.app.grailsVersion"/></a>
+                </li>
+                <li><a href="#">Groovy version: ${GroovySystem.getVersion()}</a></li>
+                <li><a href="#">JVM version: ${System.getProperty('java.version')}</a></li>
+                <li role="separator" class="divider"></li>
+                <li><a href="#">Reloading active: ${grails.util.Environment.reloadingAgentEnabled}</a></li>
+            </ul>
+        </li>
+        <li class="dropdown">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Artefacts <span class="caret"></span></a>
+            <ul class="dropdown-menu">
+                <li><a href="#">Controllers: ${grailsApplication.controllerClasses.size()}</a></li>
+                <li><a href="#">Domains: ${grailsApplication.domainClasses.size()}</a></li>
+                <li><a href="#">Services: ${grailsApplication.serviceClasses.size()}</a></li>
+                <li><a href="#">Tag Libraries: ${grailsApplication.tagLibClasses.size()}</a></li>
+            </ul>
+        </li>
+        <li class="dropdown">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Installed Plugins <span class="caret"></span></a>
+            <ul class="dropdown-menu">
+                <g:each var="plugin" in="${applicationContext.getBean('pluginManager').allPlugins}">
+                    <li><a href="#">${plugin.name} - ${plugin.version}</a></li>
+                </g:each>
+            </ul>
+        </li>
+    </content>
+
+    <div class="svg" role="presentation">
+        <div class="grails-logo-container">
+            <asset:image src="grails-cupsonly-logo-white.svg" class="grails-logo"/>
+        </div>
+    </div>
+
+    <div id="content" role="main">
+        <section class="row colset-2-its">
+            <h1>Welcome to Grails</h1>
+
+            <p>
+                Congratulations, you have successfully started your first Grails application! At the moment
+                this is the default page, feel free to modify it to either redirect to a controller or display
+                whatever content you may choose. Below is a list of controllers that are currently deployed in
+                this application, click on each to execute its default action:
+            </p>
+            <!-- tag::iterateManufacturers[] -->
+            <div id="controllers" role="navigation">
+                <h2>Available Manufacturers:</h2>
+                <ul>
+                    <g:each var="m" in="${manufacturers}">
+                        <li class="controller">
+                            <g:link controller="manufacturer" action="select" id="${m.name}">${m.name}</g:link>
+                        </li>
+                    </g:each>
+                </ul>
+            </div>
+            <!-- end::iterateManufacturers[] -->
+        </section>
+    </div>
+
+</body>
+</html>
diff --git a/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/ManufacturersPage.groovy b/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/ManufacturersPage.groovy
new file mode 100644
index 00000000000..5f17f8f4aa0
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/ManufacturersPage.groovy
@@ -0,0 +1,21 @@
+package example
+
+import geb.Page
+
+class ManufacturersPage extends Page {
+
+    static at = { $('h2').text().contains('Available Manufacturers') }
+
+    static content = {
+        audiLink { $('a', text: 'Audi') }
+        fordLink { $('a', text: 'Ford') }
+    }
+
+    void selectAudi() {
+        audiLink.click()
+    }
+
+    void selectFord() {
+        fordLink.click()
+    }
+}
diff --git a/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/NewVehiclePage.groovy b/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/NewVehiclePage.groovy
new file mode 100644
index 00000000000..b07ea4d00bd
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/NewVehiclePage.groovy
@@ -0,0 +1,20 @@
+package example
+
+import geb.Page
+
+class NewVehiclePage extends Page {
+
+    static at = { title.contains('Create Vehicle') }
+
+    static content = {
+        inputModel { $('input', name: 'model') }
+        inputYear { $('input', name: 'year') }
+        createButton { $('input', name: 'create') }
+    }
+
+    void newVehicle(String model, int year) {
+        inputModel << model
+        inputYear = year
+        createButton.click()
+    }
+}
diff --git a/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/ShowVehiclePage.groovy b/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/ShowVehiclePage.groovy
new file mode 100644
index 00000000000..86a0cf699d5
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/ShowVehiclePage.groovy
@@ -0,0 +1,16 @@
+package example
+
+import geb.Page
+
+class ShowVehiclePage extends Page {
+
+    static at = { title.contains('Show Vehicle') }
+
+    static content = {
+        listButton { $('a', text: 'Vehicle List') }
+    }
+
+    void vehicleList() {
+        listButton.click()
+    }
+}
diff --git a/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/TenantSelectionFuncSpec.groovy b/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/TenantSelectionFuncSpec.groovy
new file mode 100644
index 00000000000..30387f5878e
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/TenantSelectionFuncSpec.groovy
@@ -0,0 +1,118 @@
+package example
+
+import geb.spock.GebSpec
+import grails.testing.mixin.integration.Integration
+
+@Integration
+class TenantSelectionFuncSpec extends GebSpec {
+
+    def "it is possible to change tenants and get different lists of vehicles"() {
+
+        when:
+        go '/'
+
+        then:
+        at ManufacturersPage
+
+        when:
+        ManufacturersPage page = browser.page(ManufacturersPage)
+        page.selectAudi()
+
+        then:
+        at VehiclesPage
+
+        when:
+        VehiclesPage vehiclesPage = browser.page(VehiclesPage)
+        vehiclesPage.newVehicle()
+
+        then:
+        at NewVehiclePage
+
+        when:
+        NewVehiclePage newVehiclePage = browser.page(NewVehiclePage)
+        newVehiclePage.newVehicle('A5', 2000)
+
+        then:
+        at ShowVehiclePage
+
+        when:
+        ShowVehiclePage showVehiclePage = browser.page(ShowVehiclePage)
+        showVehiclePage.vehicleList()
+
+        then:
+        at VehiclesPage
+
+        when:
+        vehiclesPage = browser.page(VehiclesPage)
+
+        then:
+        vehiclesPage.numberOfVehicles() == 1
+
+        when:
+        vehiclesPage.newVehicle()
+
+        then:
+        at NewVehiclePage
+
+        when:
+        newVehiclePage = browser.page(NewVehiclePage)
+        newVehiclePage.newVehicle('A3', 2001)
+
+        then:
+        at ShowVehiclePage
+
+        when:
+        showVehiclePage = browser.page(ShowVehiclePage)
+        showVehiclePage.vehicleList()
+
+        then:
+        at VehiclesPage
+
+        when:
+        vehiclesPage = browser.page(VehiclesPage)
+
+        then:
+        vehiclesPage.numberOfVehicles() == 2
+
+        when:
+        go '/'
+
+        then:
+        at ManufacturersPage
+
+        when:
+        ManufacturersPage manufacturersPage = browser.page(ManufacturersPage)
+        manufacturersPage.selectFord()
+
+        then:
+        at VehiclesPage
+
+        when:
+        vehiclesPage = browser.page(VehiclesPage)
+        vehiclesPage.newVehicle()
+
+        then:
+        at NewVehiclePage
+
+        when:
+        newVehiclePage = browser.page(NewVehiclePage)
+        newVehiclePage.newVehicle('KA', 1996)
+
+        then:
+        at ShowVehiclePage
+
+        when:
+        showVehiclePage = browser.page(ShowVehiclePage)
+        showVehiclePage.vehicleList()
+
+        then:
+        at VehiclesPage
+
+        when:
+        vehiclesPage = browser.page(VehiclesPage)
+
+        then:
+        vehiclesPage.numberOfVehicles() == 1
+    }
+
+}
diff --git a/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/VehiclesPage.groovy b/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/VehiclesPage.groovy
new file mode 100644
index 00000000000..d2995b7e6b3
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/src/integration-test/groovy/example/VehiclesPage.groovy
@@ -0,0 +1,21 @@
+package example
+
+import geb.Page
+
+class VehiclesPage extends Page {
+
+    static at = { title.contains('Vehicle List') }
+
+    static content = {
+        newVehicleLink { $('a', text: 'New Vehicle') }
+        vehiclesRows { $('tbody tr') }
+    }
+
+    void newVehicle() {
+        newVehicleLink.click()
+    }
+
+    int numberOfVehicles() {
+        vehiclesRows.size()
+    }
+}
diff --git a/guides/discriminator-per-tenant/v4/snippets/src/test/groovy/example/VehicleControllerSpec.groovy b/guides/discriminator-per-tenant/v4/snippets/src/test/groovy/example/VehicleControllerSpec.groovy
new file mode 100644
index 00000000000..9faa77df5b5
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/snippets/src/test/groovy/example/VehicleControllerSpec.groovy
@@ -0,0 +1,138 @@
+package example
+
+import grails.testing.web.controllers.ControllerUnitTest
+import org.grails.datastore.mapping.config.Settings
+import org.grails.datastore.mapping.multitenancy.exceptions.TenantNotFoundException
+import org.grails.datastore.mapping.multitenancy.resolvers.SystemPropertyTenantResolver
+
+// tag::class[]
+class VehicleControllerSpec extends HibernateSpec implements ControllerUnitTest<VehicleController> {
+// end::class[]
+
+    // tag::config[]
+    @Override
+    Map getConfiguration() {
+        super.getConfiguration() + [(Settings.SETTING_MULTI_TENANT_RESOLVER_CLASS): SystemPropertyTenantResolver]
+    }
+    // end::config[]
+
+    // tag::setup[]
+    VehicleService vehicleService // <1>
+
+    def setup() {
+        System.setProperty(SystemPropertyTenantResolver.PROPERTY_NAME, 'audi') // <2>
+        vehicleService = hibernateDatastore.getService(VehicleService) // <3>
+        controller.vehicleService = vehicleService // <4>
+    }
+    // end::setup[]
+
+    // tag::cleanup[]
+    def cleanupSpec() {
+        System.setProperty(SystemPropertyTenantResolver.PROPERTY_NAME, '')
+    }
+    // end::cleanup[]
+
+    // tag::index[]
+    void 'Test the index action returns the correct model'() {
+
+        when: 'The index action is executed'
+        controller.index()
+
+        then: 'The model is correct'
+        !model.vehicleList
+        model.vehicleCount == 0
+    }
+    // end::index[]
+
+    // tag::noTenant[]
+    void 'Test the index action with no tenant id'() {
+        when: 'there is no tenant id'
+        System.setProperty(SystemPropertyTenantResolver.PROPERTY_NAME, '')
+        controller.index()
+
+        then:
+        thrown(TenantNotFoundException)
+    }
+    // end::noTenant[]
+
+    void 'Test the create action returns the correct model'() {
+        when: 'The create action is executed'
+        controller.create()
+
+        then: 'The model is correctly created'
+        model.vehicle != null
+    }
+
+    // tag::save[]
+    void 'Test the save action correctly persists an instance'() {
+
+        when: 'The save action is executed with an invalid instance'
+        request.contentType = FORM_CONTENT_TYPE
+        request.method = 'POST'
+        controller.save('', 1900)
+
+        then: 'The create view is rendered again with the correct model'
+        model.vehicle != null
+        view == 'create'
+
+        when: 'The save action is executed with a valid instance'
+        controller.save('A5', 2011)
+
+        then: 'A redirect is issued to the show action'
+        controller.flash.message != null
+        vehicleService.count() == 1
+        response.redirectedUrl == '/vehicles/1'
+
+        when: 'The show action is executed with a null domain'
+        controller.show(null)
+
+        then: 'A 404 error is returned'
+        response.status == 404
+
+        when: 'Update is called for a domain instance that doesn\'t exist'
+        response.reset()
+        request.contentType = FORM_CONTENT_TYPE
+        request.method = 'PUT'
+        controller.update(999, 'A5', 2011)
+
+        then: 'A 404 error is returned'
+        response.redirectedUrl == '/vehicles'
+        flash.message != null
+
+        when: 'An invalid domain instance is passed to the update action'
+        response.reset()
+        controller.update(1, 'A5', 1900)
+
+        then: 'The edit view is rendered again with the invalid instance'
+        view == 'edit'
+        model.vehicle instanceof Vehicle
+
+        when: 'A valid domain instance is passed to the update action'
+        response.reset()
+        controller.update(1, 'A5', 2012)
+
+        then: 'A redirect is issued to the show action'
+        response.redirectedUrl == '/vehicles/1'
+        flash.message != null
+
+        when: 'The delete action is called for a null instance'
+        response.reset()
+        request.contentType = FORM_CONTENT_TYPE
+        request.method = 'DELETE'
+        controller.delete(null)
+
+        then: 'A 404 is returned'
+        response.redirectedUrl == '/vehicles'
+        flash.message != null
+        vehicleService.count() == 1
+
+        when: 'A domain instance is created'
+        response.reset()
+        controller.delete(1)
+
+        then: 'The instance is deleted'
+        vehicleService.count() == 0
+        response.redirectedUrl == '/vehicles'
+        flash.message != null
+    }
+}
diff --git a/guides/discriminator-per-tenant/v4/toc.yml b/guides/discriminator-per-tenant/v4/toc.yml
new file mode 100644
index 00000000000..6dcb5a21cfc
--- /dev/null
+++ b/guides/discriminator-per-tenant/v4/toc.yml
@@ -0,0 +1,25 @@
+training:
+  title: Grails Training
+gettingStarted:
+  title: Getting Started
+  requirements: What you will need
+  howto: How to complete the guide
+writingTheApp:
+  title: Writing the Application
+  setupMultitenancy:
+    title: Setup Multi-Tenancy
+    multiTenancyMode: The Multi-Tenancy Mode
+    multiTenancyResolver: The TenantResolver
+  domainClasses: Creating the Domain Classes
+  seedData: Setup Test Data
+  tenantSelection: Implementing Tenant Selection
+  multiTenantLogic:
+    title: Writing Multi-Tenant Aware Data Logic
+    readingData: Executing Multi-Tenant Aware Queries
+    writingData: Executing Multi-Tenant Updates
+testingTheApp: Multi-Tenancy Unit Testing
+integrationTest: Functional Tests
+runningTheApp:
+  title: Running the Application
+helpWithGrails:
+  title: Do you need help with Grails?
diff --git a/guides/gorm-without-grails/v4/guide/application.adoc b/guides/gorm-without-grails/v4/guide/application.adoc
new file mode 100644
index 00000000000..41da9081d15
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/application.adoc
@@ -0,0 +1,7 @@
+GORM for Hibernate can be configured with `src/main/resources/application.yml` file when using Spring Boot.
+
+[source,groovy]
+.src/main/resources/application.yml
+----
+include::../snippets/src/main/resources/application.yml[]
+----
\ No newline at end of file
diff --git a/guides/gorm-without-grails/v4/guide/configuringTheApp.adoc b/guides/gorm-without-grails/v4/guide/configuringTheApp.adoc
new file mode 100644
index 00000000000..b290bad8601
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/configuringTheApp.adoc
@@ -0,0 +1,14 @@
+Edit _build.gradle_ files to include GORM dependencies.
+
+[source,groovy]
+./build.gradle
+----
+include::../snippets/build.gradle[]
+----
+
+<1> Repository to resolve GORM dependencies.
+<2> Add the required dependencies for GORM to our project.
+<3> For connection pooling
+<4> To use `WebClient` in the tests, include the `spring-webflux` module in your project.
+
+http://gorm.grails.org/latest/hibernate/manual/index.html#springBoot[Read the GORM documentation to learn more]
diff --git a/guides/gorm-without-grails/v4/guide/creatingAppConfig.adoc b/guides/gorm-without-grails/v4/guide/creatingAppConfig.adoc
new file mode 100644
index 00000000000..ae24d929600
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/creatingAppConfig.adoc
@@ -0,0 +1,38 @@
+Beyond our simple domain tests getting everything configured properly takes a few extra changes.
+If you started with our `initial` app or if you created your own, you will find that you have
+a `src/main/resources/application.properties`. Lets go ahead and add some options there.
+
+[source,groovy]
+./src/main/resources/application.properties
+----
+include::../snippets/src/main/resources/application.properties[]
+----
+
+The last line is required in order to make use of hibernates auto importing feature to
+bootstrap data. Without this line being set to `create` or `create-drop` it will not
+bootstrap our data (more on this next).
+
+The first 3 lines enable h2 console access in the browser so you can navigate to
+http://localhost:8080/console[] and view your database.
+
+image::consoleLogin.png[]
+image::loggedInConsole.png[]
+
+Next create an additional `application.yml` in `src/main/resources`. After creation go
+ahead and edit the file and add the following.
+
+NOTE: For more information on configuration look at the GORM documentation
+http://gorm.grails.org/latest/hibernate/manual/index.html#configuration[here].
+
+[source,groovy]
+./src/main/resources/application.yml
+----
+include::../snippets/src/main/resources/application.yml[]
+----
+
+The `dataSource` block is what ties your database and GORM together. Without this your
+domain tests will pass but if you run the application and go to view your database at
+http://localhost:8080/console[] it will always be empty and no tables will be generated.
+
+IMPORTANT: There is a lot going on in these two files so
+      pay close attention as these are the connecting glue.
\ No newline at end of file
diff --git a/guides/gorm-without-grails/v4/guide/creatingTestData.adoc b/guides/gorm-without-grails/v4/guide/creatingTestData.adoc
new file mode 100644
index 00000000000..e9303f5c4b3
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/creatingTestData.adoc
@@ -0,0 +1,15 @@
+When the application starts we save some data. 
+
+[source,groovy]
+./src/main/groovy/demo/Application.groovy
+----
+include::../snippets/src/main/groovy/demo/Application.groovy[]
+----
+
+<1> Disable Auto-configuration for Hibernate JPA.
+
+[source,groovy]
+./src/main/groovy/demo/init/BootStrap.groovy
+----
+include::../snippets/src/main/groovy/demo/init/BootStrap.groovy[]
+----
\ No newline at end of file
diff --git a/guides/gorm-without-grails/v4/guide/creatingTheControllers.adoc b/guides/gorm-without-grails/v4/guide/creatingTheControllers.adoc
new file mode 100644
index 00000000000..d3be99688d8
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/creatingTheControllers.adoc
@@ -0,0 +1,67 @@
+Finally lets create some controllers so we can have basic UI access to our data.
+
+[source,bash]
+----
+  $ cd src/main/groovy/demo/controller
+  $ touch ManufacturerController
+  $ touch VehicleController
+----
+
+Now let’s edit our controllers under `src/main/groovy/demo/controller`.
+
+The controllers will have
+the following annotations
+
+ - `@RestController` - Denotes the controller as restful and that it can return data via url
+ - `@Autowired` - Allows use to use dependency injection to access our services
+ - `@RequestMapping("/")` - Sets the url mapping for the method
+
+[source,groovy]
+./src/main/groovy/demo/controller/VehicleController.groovy
+----
+include::../snippets/src/main/groovy/demo/controller/VehicleController.groovy[]
+----
+
+Add a test:
+
+[source,groovy]
+./src/test/groovy/demo/controller/VehicleControllerTest.groovy
+----
+include::../snippets/src/test/groovy/demo/controller/VehicleControllerTest.groovy[]
+----
+
+[source,groovy]
+./src/main/groovy/demo/controller/ManufacturerController.groovy
+----
+include::../snippets/src/main/groovy/demo/controller/ManufacturerController.groovy[]
+----
+
+Add a test:
+
+[source,groovy]
+./src/test/groovy/demo/controller/ManufacturerControllerTest.groovy
+----
+include::../snippets/src/test/groovy/demo/controller/ManufacturerControllerTest.groovy[]
+----
+
+
+Run the app: 
+
+`./gradlew bootRun`
+
+
+You should be able to call the endpoints: 
+
+`curl "http://localhost:8080"`
+
+and get the response: 
+
+`["audi","ford"]`
+
+Or retrieve the vehicles of a manufacturer:
+
+`curl "http://localhost:8080/audi/vehicles"`
+
+and get the response: 
+
+`["A3","A4"]`
\ No newline at end of file
diff --git a/guides/gorm-without-grails/v4/guide/creatingTheDomain.adoc b/guides/gorm-without-grails/v4/guide/creatingTheDomain.adoc
new file mode 100644
index 00000000000..83c1b765589
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/creatingTheDomain.adoc
@@ -0,0 +1,32 @@
+Now with our packages in place lets go ahead and create our domain objects.
+
+ - Manufacturer.groovy
+ - Vehicle.groovy
+
+Feel free to use your favorite IDE to create these or execute the following
+
+[source,bash]
+----
+$ cd complete/src/main/groovy/demo/domain/
+$ touch Manufacturer.groovy
+$ touch Vehicle.groovy
+----
+
+Now that all our class stubs are in place lets go ahead and edit them.
+
+[source,groovy]
+./src/main/groovy/demo/domain/Manufacturer.groovy
+----
+include::../snippets/src/main/groovy/demo/domain/Manufacturer.groovy[]
+----
+
+[source,groovy]
+./src/main/groovy/demo/domain/Vehicle.groovy
+----
+include::../snippets/src/main/groovy/demo/domain/Vehicle.groovy[]
+----
+
+`Manufacturer` and `Vehicle` have a one-to-many relationship. 
+
+We are using GORM outside of Grails. Because of that, we need to annotate our domain classes with the `grails.gorm.annotation.Entity`. Additionally we implement the `GormEntity` trait. 
+ It is merely to aid IDE support of GORM outside of Grails. 
\ No newline at end of file
diff --git a/guides/gorm-without-grails/v4/guide/creatingTheServices.adoc b/guides/gorm-without-grails/v4/guide/creatingTheServices.adoc
new file mode 100644
index 00000000000..be9d7653ed7
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/creatingTheServices.adoc
@@ -0,0 +1,26 @@
+Next lets create our service layer for our application.
+
+[source,bash]
+----
+  $ cd src/main/groovy/demo/service
+  $ touch ManufacturerService
+  $ touch VehicleService
+----
+
+We are going to use GORM Data Services.
+
+____
+Data Services take the work out of implemented service layer logic by adding the ability to automatically implement abstract classes or interfaces using GORM logic.
+____
+
+[source,groovy]
+./src/main/groovy/demo/service/ManufacturerService.groovy
+----
+include::../snippets/src/main/groovy/demo/service/ManufacturerService.groovy[]
+----
+
+[source,groovy]
+./src/main/groovy/demo/service/VehicleService.groovy
+----
+include::../snippets/src/main/groovy/demo/service/VehicleService.groovy[]
+----
diff --git a/guides/gorm-without-grails/v4/guide/gettingStarted.adoc b/guides/gorm-without-grails/v4/guide/gettingStarted.adoc
new file mode 100644
index 00000000000..f7c6ecfe669
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/gettingStarted.adoc
@@ -0,0 +1 @@
+In this guide you are going to build a Spring Boot application using GORM.
\ No newline at end of file
diff --git a/guides/gorm-without-grails/v4/guide/helpWithGrails.adoc b/guides/gorm-without-grails/v4/guide/helpWithGrails.adoc
new file mode 100644
index 00000000000..e062f614b1a
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/helpWithGrails.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-helpWithGrails.adoc[]
diff --git a/guides/gorm-without-grails/v4/guide/howto.adoc b/guides/gorm-without-grails/v4/guide/howto.adoc
new file mode 100644
index 00000000000..23fb2a5e7ad
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/howto.adoc
@@ -0,0 +1,15 @@
+include::{commondir}/common-howto.adoc[]
+
+If you want to start from scratch, create a new Spring Boot application using
+https://start.spring.io/[Spring Initializr].
+
+Select a `Gradle Project` using `Groovy` with `Spring Boot 1.5.6`. Once you have selected
+your build and project type, set the Group to your organization ie. `com.example` in our case
+we will use `demo`. 
+
+Once that is done add the `Web` and `h2` dependencies to the project.
+
+image::buildAndMetadata.png[]
+
+
+Click `Generate Project`.
diff --git a/guides/gorm-without-grails/v4/guide/nextSteps.adoc b/guides/gorm-without-grails/v4/guide/nextSteps.adoc
new file mode 100644
index 00000000000..f53ca8fd021
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/nextSteps.adoc
@@ -0,0 +1,11 @@
+There’s plenty of opportunities to expand the scope of this application. Here are a few ideas for
+improvements you can make on your own:
+
+- Create a UI for better data visualization (feel free to look at the UI in the other guides mentioned
+at the start of this guide.
+
+- Add support to save new vehicles
+
+- Currently Makes & Models are independent. Add an appropriate GORM association between Make &
+Model, and create select lists to only display Models for the currently select Make. You will
+want to make use of the JavaScript Array.filter method.
\ No newline at end of file
diff --git a/guides/gorm-without-grails/v4/guide/requirements.adoc b/guides/gorm-without-grails/v4/guide/requirements.adoc
new file mode 100644
index 00000000000..d8bafe0fa05
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/requirements.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-requirements.adoc[]
\ No newline at end of file
diff --git a/guides/gorm-without-grails/v4/guide/runningTheApp.adoc b/guides/gorm-without-grails/v4/guide/runningTheApp.adoc
new file mode 100644
index 00000000000..bd5af59b96b
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/runningTheApp.adoc
@@ -0,0 +1,27 @@
+//include::{commondir}/common-runapp.adoc[]
+
+At this point a test run is suggested just to make sure everything is functioning properly.
+
+To run the application first
+
+[source,bash]
+----
+$ cd initial/
+----
+
+NOTE: To run the completed app `$ cd complete/` instead of `initial`.
+
+To launch the application, run the following command.
+
+[source,bash]
+----
+$ ./gradlew bootRun
+----
+
+At this point we have not configured any views so there is nothing to see in our browser
+yet but so long as your terminal looks similar to the following and you see that tomcat
+was started on 8080 everything should be good.
+
+image::initialStartup.png[]
+
+Now that we have checked the app starts, go ahead and shut it down for now `Ctrl-C`.
\ No newline at end of file
diff --git a/guides/gorm-without-grails/v4/guide/training.adoc b/guides/gorm-without-grails/v4/guide/training.adoc
new file mode 100644
index 00000000000..11b7772a2c8
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/training.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-training.adoc[]
diff --git a/guides/gorm-without-grails/v4/guide/writingTheAppPartOne.adoc b/guides/gorm-without-grails/v4/guide/writingTheAppPartOne.adoc
new file mode 100644
index 00000000000..cd9aa9697f3
--- /dev/null
+++ b/guides/gorm-without-grails/v4/guide/writingTheAppPartOne.adoc
@@ -0,0 +1,7 @@
+
+We are going to create a package structure similar to the one you find in Grails application:
+
+ - demo.controller
+ - demo.domain
+ - demo.service
+ - demo.init
diff --git a/guides/gorm-without-grails/v4/manifest.yml b/guides/gorm-without-grails/v4/manifest.yml
new file mode 100644
index 00000000000..06446437698
--- /dev/null
+++ b/guides/gorm-without-grails/v4/manifest.yml
@@ -0,0 +1,18 @@
+# Generated by :vendorGuide
+name: gorm-without-grails
+version: '4'
+title: Build a Spring Boot application with GORM
+subtitle: Learn how to build a Spring Boot application using GORM
+authors:
+- Ben Rhine, Sergio del Amo
+category: GORM
+tags:
+- spring boot
+- backend
+- GORM
+- hibernate
+publicationDate: '2017-07-31'
+githubSlug: grails-guides/gorm-without-grails
+githubBranch: master
+githubSha: 14a7eea75d3292de56213d87ab34b14d6c87602e
+sourceCommitDate: '2026-05-01T08:42:35-04:00'
diff --git a/guides/gorm-without-grails/v4/snippets/MANIFEST.yml b/guides/gorm-without-grails/v4/snippets/MANIFEST.yml
new file mode 100644
index 00000000000..e868aef46d4
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/MANIFEST.yml
@@ -0,0 +1,33 @@
+# Generated by :vendorGuide
+source:
+  repo: grails-guides/gorm-without-grails
+  branch: master
+  sha: 14a7eea75d3292de56213d87ab34b14d6c87602e
+  capturedAt: '2026-05-01'
+entries:
+- vendoredPath: src/main/resources/application.yml
+  upstreamPath: complete/src/main/resources/application.yml
+- vendoredPath: build.gradle
+  upstreamPath: complete/build.gradle
+- vendoredPath: src/main/resources/application.properties
+  upstreamPath: complete/src/main/resources/application.properties
+- vendoredPath: src/main/groovy/demo/Application.groovy
+  upstreamPath: complete/src/main/groovy/demo/Application.groovy
+- vendoredPath: src/main/groovy/demo/init/BootStrap.groovy
+  upstreamPath: complete/src/main/groovy/demo/init/BootStrap.groovy
+- vendoredPath: src/main/groovy/demo/controller/VehicleController.groovy
+  upstreamPath: complete/src/main/groovy/demo/controller/VehicleController.groovy
+- vendoredPath: src/test/groovy/demo/controller/VehicleControllerTest.groovy
+  upstreamPath: complete/src/test/groovy/demo/controller/VehicleControllerTest.groovy
+- vendoredPath: src/main/groovy/demo/controller/ManufacturerController.groovy
+  upstreamPath: complete/src/main/groovy/demo/controller/ManufacturerController.groovy
+- vendoredPath: src/test/groovy/demo/controller/ManufacturerControllerTest.groovy
+  upstreamPath: complete/src/test/groovy/demo/controller/ManufacturerControllerTest.groovy
+- vendoredPath: src/main/groovy/demo/domain/Manufacturer.groovy
+  upstreamPath: complete/src/main/groovy/demo/domain/Manufacturer.groovy
+- vendoredPath: src/main/groovy/demo/domain/Vehicle.groovy
+  upstreamPath: complete/src/main/groovy/demo/domain/Vehicle.groovy
+- vendoredPath: src/main/groovy/demo/service/ManufacturerService.groovy
+  upstreamPath: complete/src/main/groovy/demo/service/ManufacturerService.groovy
+- vendoredPath: src/main/groovy/demo/service/VehicleService.groovy
+  upstreamPath: complete/src/main/groovy/demo/service/VehicleService.groovy
diff --git a/guides/gorm-without-grails/v4/snippets/build.gradle b/guides/gorm-without-grails/v4/snippets/build.gradle
new file mode 100644
index 00000000000..250acbfbe47
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/build.gradle
@@ -0,0 +1,39 @@
+plugins {
+	id 'org.springframework.boot' version '2.2.2.RELEASE'
+	id 'io.spring.dependency-management' version '1.0.8.RELEASE'
+	id 'groovy'
+}
+
+group = 'com.example'
+version = '0.0.1-SNAPSHOT'
+sourceCompatibility = '1.8'
+
+repositories {
+	mavenCentral()
+	maven { url "https://repo.grails.org/grails/core" } // <1>
+}
+
+dependencies {
+	implementation 'org.springframework.boot:spring-boot-starter-web'
+	implementation 'org.codehaus.groovy:groovy'
+
+	// <2>
+	implementation("org.grails:gorm-hibernate5-spring-boot:7.0.1.RELEASE")
+	implementation "org.hibernate:hibernate-core"
+	implementation "org.hibernate:hibernate-ehcache"
+
+	// <3>
+	runtime "org.apache.tomcat:tomcat-jdbc:8.5.0"
+	runtime "org.apache.tomcat.embed:tomcat-embed-logging-log4j:8.5.0"
+
+	runtimeOnly 'com.h2database:h2'
+	testImplementation('org.springframework.boot:spring-boot-starter-test') {
+		exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
+	}
+
+	testImplementation "org.springframework.boot:spring-boot-starter-webflux" // <4>
+}
+
+test {
+	useJUnitPlatform()
+}
diff --git a/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/Application.groovy b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/Application.groovy
new file mode 100644
index 00000000000..aaf32f32a58
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/Application.groovy
@@ -0,0 +1,26 @@
+package demo
+
+import org.springframework.boot.ApplicationArguments
+import demo.init.BootStrap
+import groovy.transform.CompileStatic
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.boot.ApplicationRunner
+import org.springframework.boot.SpringApplication
+import org.springframework.boot.autoconfigure.SpringBootApplication
+import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+
+@CompileStatic
+@SpringBootApplication(exclude = HibernateJpaAutoConfiguration.class) // <1>
+class Application implements ApplicationRunner {
+
+    @Autowired
+    BootStrap bootStrap
+
+    static void main(String[] args) {
+        SpringApplication.run Application, args
+    }
+
+    void run(ApplicationArguments args) throws Exception {
+        bootStrap.init()
+    }
+}
diff --git a/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/controller/ManufacturerController.groovy b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/controller/ManufacturerController.groovy
new file mode 100644
index 00000000000..eac26b6ab66
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/controller/ManufacturerController.groovy
@@ -0,0 +1,18 @@
+package demo.controller
+
+import demo.service.ManufacturerService
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+
+@RestController
+class ManufacturerController {
+
+    @Autowired
+    ManufacturerService manufacturerService
+
+    @RequestMapping("/")
+    List<String> index(){
+        manufacturerService.findAll()*.name
+    }
+}
diff --git a/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/controller/VehicleController.groovy b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/controller/VehicleController.groovy
new file mode 100644
index 00000000000..78af0f4c7c9
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/controller/VehicleController.groovy
@@ -0,0 +1,18 @@
+package demo.controller
+
+import demo.service.VehicleService
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.web.bind.annotation.PathVariable
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+
+@RestController
+class VehicleController {
+
+    @Autowired VehicleService vehicleService
+
+    @RequestMapping("/{manufacturerName}/vehicles")
+    List<String> vehiclesByManufacturer(@PathVariable String manufacturerName) {
+        vehicleService.findAllByManufacturer(manufacturerName)*.name
+    }
+}
diff --git a/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/domain/Manufacturer.groovy b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/domain/Manufacturer.groovy
new file mode 100644
index 00000000000..279e84dfc58
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/domain/Manufacturer.groovy
@@ -0,0 +1,18 @@
+package demo.domain
+
+import grails.gorm.annotation.Entity
+import groovy.transform.ToString
+import org.grails.datastore.gorm.GormEntity
+
+@ToString
+@Entity
+class Manufacturer implements GormEntity<Manufacturer> {
+
+    String name
+
+    static hasMany = [vehicles: Vehicle]
+
+    static constraints = {
+        name blank: false
+    }
+}
diff --git a/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/domain/Vehicle.groovy b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/domain/Vehicle.groovy
new file mode 100644
index 00000000000..e5f21b81ad5
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/domain/Vehicle.groovy
@@ -0,0 +1,17 @@
+package demo.domain
+
+import grails.gorm.annotation.Entity
+import org.grails.datastore.gorm.GormEntity
+import groovy.transform.ToString
+
+@ToString
+@Entity
+class Vehicle implements GormEntity<Vehicle> {
+    String name
+    Integer year
+    static belongsTo = [manufacturer: Manufacturer]
+
+    static constraints = {
+        name nullable: false, blank: false
+    }
+}
diff --git a/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/init/BootStrap.groovy b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/init/BootStrap.groovy
new file mode 100644
index 00000000000..589773e9e91
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/init/BootStrap.groovy
@@ -0,0 +1,29 @@
+package demo.init
+
+import demo.domain.Manufacturer
+import demo.domain.Vehicle
+import demo.service.ManufacturerService
+import grails.gorm.transactions.Transactional
+import groovy.transform.CompileStatic
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.stereotype.Component
+
+@Component
+@CompileStatic
+class BootStrap {
+
+    @Autowired
+    ManufacturerService manufacturerService
+
+    @Transactional
+    void init() {
+        Manufacturer audi = new Manufacturer(name: 'audi')
+        audi.addToVehicles(new Vehicle(name: 'A3', year: 1996))
+        audi.addToVehicles(new Vehicle(name: 'A4', year: 1994))
+        manufacturerService.save(audi)
+
+        Manufacturer ford = new Manufacturer(name: 'ford')
+        ford.addToVehicles(new Vehicle(name: 'Ford KA', year: 1996))
+        manufacturerService.save(ford)
+    }
+}
diff --git a/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/service/ManufacturerService.groovy b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/service/ManufacturerService.groovy
new file mode 100644
index 00000000000..b9d0b71b443
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/service/ManufacturerService.groovy
@@ -0,0 +1,17 @@
+package demo.service
+
+import demo.domain.Manufacturer
+import grails.gorm.transactions.ReadOnly
+import grails.gorm.transactions.Transactional
+import groovy.transform.CompileStatic
+import org.springframework.stereotype.Service
+
+@CompileStatic
+@grails.gorm.services.Service(Manufacturer)
+@Service
+interface ManufacturerService {
+
+    List<Manufacturer> findAll()
+
+    Manufacturer save(Manufacturer manufacturer)
+}
diff --git a/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/service/VehicleService.groovy b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/service/VehicleService.groovy
new file mode 100644
index 00000000000..7a99d319c9a
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/src/main/groovy/demo/service/VehicleService.groovy
@@ -0,0 +1,17 @@
+package demo.service
+
+import demo.domain.Manufacturer
+import demo.domain.Vehicle
+import grails.gorm.services.Where
+import groovy.transform.CompileStatic
+import org.springframework.stereotype.Service
+
+@CompileStatic
+@grails.gorm.services.Service(Vehicle)
+@Service
+interface VehicleService {
+
+    @Where({ manufacturer.name == manufacturerName })
+    List<Vehicle> findAllByManufacturer(String manufacturerName)
+
+}
diff --git a/guides/gorm-without-grails/v4/snippets/src/main/resources/application.properties b/guides/gorm-without-grails/v4/snippets/src/main/resources/application.properties
new file mode 100644
index 00000000000..796b4d87a6f
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/src/main/resources/application.properties
@@ -0,0 +1,7 @@
+#Enable h2 console access via browser
+spring.h2.console.enabled=true
+spring.h2.console.path=/console
+spring.datasource.platform=h2
+
+# Turn on hibernate bootstrap data
+spring.jpa.properties.hibernate.hbm2ddl.auto=create-drop
diff --git a/guides/gorm-without-grails/v4/snippets/src/main/resources/application.yml b/guides/gorm-without-grails/v4/snippets/src/main/resources/application.yml
new file mode 100644
index 00000000000..62277138e00
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/src/main/resources/application.yml
@@ -0,0 +1,10 @@
+hibernate:
+    hbm2ddl:
+        auto: update
+    dialect:  org.hibernate.dialect.H2Dialect
+spring:
+    datasource:
+        driverClassName: org.h2.Driver
+        url: jdbc:h2:mem:devDb
+        username: sa
+        password: ""
\ No newline at end of file
diff --git a/guides/gorm-without-grails/v4/snippets/src/test/groovy/demo/controller/ManufacturerControllerTest.groovy b/guides/gorm-without-grails/v4/snippets/src/test/groovy/demo/controller/ManufacturerControllerTest.groovy
new file mode 100644
index 00000000000..66eb4ea55c2
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/src/test/groovy/demo/controller/ManufacturerControllerTest.groovy
@@ -0,0 +1,19 @@
+package demo.controller
+
+import org.junit.jupiter.api.Test
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.boot.test.context.SpringBootTest
+import org.springframework.test.web.reactive.server.WebTestClient
+
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+class ManufacturerControllerTest {
+
+    @Autowired
+    WebTestClient webClient
+
+    @Test
+    void fetchManufacturer() {
+        this.webClient.get().uri("/").exchange().expectBody(String).isEqualTo('["audi","ford"]')
+    }
+}
+
diff --git a/guides/gorm-without-grails/v4/snippets/src/test/groovy/demo/controller/VehicleControllerTest.groovy b/guides/gorm-without-grails/v4/snippets/src/test/groovy/demo/controller/VehicleControllerTest.groovy
new file mode 100644
index 00000000000..d085a35e7d2
--- /dev/null
+++ b/guides/gorm-without-grails/v4/snippets/src/test/groovy/demo/controller/VehicleControllerTest.groovy
@@ -0,0 +1,19 @@
+package demo.controller
+
+import org.junit.jupiter.api.Test
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.boot.test.context.SpringBootTest
+import org.springframework.test.web.reactive.server.WebTestClient
+
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+class VehicleControllerTest {
+
+    @Autowired
+    WebTestClient webClient
+
+    @Test
+    void fetchAudiVehicles() {
+        this.webClient.get().uri("/audi/vehicles").exchange().expectBody(String).isEqualTo('["A3","A4"]')
+    }
+}
+
diff --git a/guides/gorm-without-grails/v4/toc.yml b/guides/gorm-without-grails/v4/toc.yml
new file mode 100644
index 00000000000..4ea3e351596
--- /dev/null
+++ b/guides/gorm-without-grails/v4/toc.yml
@@ -0,0 +1,17 @@
+training:
+  title: Grails Training
+gettingStarted:
+  title: Getting Started
+  requirements: What you will need
+  howto: How to complete the guide
+configuringTheApp:
+  title: Configuring your Build
+  application: Configuration
+writingTheAppPartOne:
+  title: Writing the Application
+  creatingTheDomain: Creating the domain
+  creatingTestData: Seed Data
+  creatingTheServices: Creating the Service layer
+  creatingTheControllers: Creating a controller
+helpWithGrails:
+  title: Do you need help with GORM or Grails?
diff --git a/guides/grails-scheduled/v3/guide/concurrentExecution.adoc b/guides/grails-scheduled/v3/guide/concurrentExecution.adoc
new file mode 100644
index 00000000000..3dd99be4695
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/concurrentExecution.adoc
@@ -0,0 +1,22 @@
+Imagine you develop a Software as a Service application with Grails. Each 
+day at 7:00 AM you want to check if any user's subscription has expired. If it is finished you want to create an invoice for the new period, save the invoice and update the user's subscription expiration date in the database. 
+
+You want to disable the concurrent execution of such a Job. Using just Quartz you need to annotate the job with
+`@DisallowConcurrentExecution`. With _Schwartz_ you still can do it, or, if you prefer you can implement the trait `StatefulSchwartzJob` instead of `SchwartzJob`. `StatefulSchwartzJob` extends form `SchwartzJob` and adds two annotations `@DisallowConcurrentExecution`, `@PersistJobDataAfterExecution`. 
+
+A sample code could look like: 
+
+[source, groovy]
+.grails-app/services/demo/GenerateInvoiceJobService.groovy
+----
+include::../snippets/grails-app/services/demo/GenerateInvoiceJobService.groovy[]
+----
+
+<1> Wrap the job's execution in a transaction.
+
+[source, groovy]
+.grails-app/services/demo/GenerateInvoiceService.groovy
+----
+include::../snippets/grails-app/services/demo/GenerateInvoiceService.groovy[]
+----
+
diff --git a/guides/grails-scheduled/v3/guide/createSimpleJob.adoc b/guides/grails-scheduled/v3/guide/createSimpleJob.adoc
new file mode 100644
index 00000000000..297e8b1869b
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/createSimpleJob.adoc
@@ -0,0 +1,66 @@
+Since scheduling is native functionality. Just execute:
+
+[source, bash]
+----
+./grailsw create-service HelloWorldJob
+----
+
+This will create the file `grails-app/services/demo/HelloWorldJobService.groovy` with a empty template method.
+
+The very basic skeleton is:
+
+[source, groovy]
+.grails-app/services/demo/HelloWorldJobService.groovy
+----
+@Transactional // <1>
+class HelloWorldJobService {
+
+    def serviceMethod() {
+        // <2>
+    }
+}
+----
+<1> By default services are `Transactional`
+<2> The job logic goes here
+
+
+Let's modify the previous code and add the following:
+
+[source, groovy]
+.grails-app/services/demo/HelloWorldJobService.groovy
+----
+include::../snippets/grails-app/services/demo/HelloWorldJobService.groovy[]
+----
+<1> Although Grails artifacts ( services, controllers ) inject a logger automatically, we annotate the class with `@Slf4j` to get better IDE support. Depending on the Grails version you are using, `@Slf4j` annotation will have an impact on aspects such as static compilation, logger name, etc. as described in the https://www.youtube.com/watch?v=3TppFy3lq1A[Grails Logging Quickcast].
+<2> Remove `@Transactional` as this service does not require transactions. Add `@CompileStatic` for performance. 
+<3> By default Grails' services are lazily initialized. You can disable this and make initialization eager with the lazyInit property. Without forcing the service to be eagerly initialized the jobs will not execute.
+<4> Create trigger every 10 seconds
+<5> Create another trigger every 45 seconds with an initial delay of 5 seconds (5000 millis)
+
+Now start the application:
+
+[source, bash]
+----
+./gradlew bootRun
+----
+
+And after a few seconds you will see the following output:
+
+[source, bash]
+----
+Simple Job every 45 seconds :14/2/2018 02:06:50 # <1>
+Simple Job every 10 seconds :14/2/2018 02:06:55 # <2>
+Simple Job every 10 seconds :14/2/2018 02:07:05 # <3>
+Simple Job every 10 seconds :14/2/2018 02:07:15
+Simple Job every 10 seconds :14/2/2018 02:07:25
+Simple Job every 45 seconds :14/2/2018 02:07:35 # <4>
+Simple Job every 10 seconds :14/2/2018 02:07:35
+----
+<1> First execution of 10 seconds job just after the application starts
+<2> The 45 seconds job just starts 5 seconds after the app starts. See `startDelay` in the trigger configuration.
+<3> Second execution of 10 seconds job just 10 seconds after the first execution
+<4> Second execution of 45 seconds job just 45 seconds after the first execution
+
+WARNING: When using `@Scheduled`, `static lazyInit = false` is required or your schedule will not run.
+
+NOTE: `@Scheduled` requires the use of CONSTANT values. Meaning that attempting to generate / build values for `fixedDelay`, `initialDelay`, `cron`, ect. will not work and cause compile errors.
diff --git a/guides/grails-scheduled/v3/guide/gettingStarted.adoc b/guides/grails-scheduled/v3/guide/gettingStarted.adoc
new file mode 100644
index 00000000000..8f228a28e6a
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/gettingStarted.adoc
@@ -0,0 +1,11 @@
+Nowadays it is pretty usual to have some kind of _cron_ or scheduled task that needs to run every midnight, every hour,
+a few times a week,... In the Java world we have been using the _Quartz_ library for ages to do this.
+
+In this guide you will learn how to use the native
+https://docs.spring.io/spring/docs/current/spring-framework-reference/integration.html#scheduling[Spring Task Execution and Scheduling] to
+schedule periodic tasks inside a Grails application.
+
+For additional documentation see:
+https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/annotation/Scheduled.html[@Scheduled]
+https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/TaskScheduler.html[TaskScheduler]
+https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/scheduling/support/PeriodicTrigger.html[PeriodicTrigger]
diff --git a/guides/grails-scheduled/v3/guide/helpWithGrails.adoc b/guides/grails-scheduled/v3/guide/helpWithGrails.adoc
new file mode 100644
index 00000000000..e062f614b1a
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/helpWithGrails.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-helpWithGrails.adoc[]
diff --git a/guides/grails-scheduled/v3/guide/howto.adoc b/guides/grails-scheduled/v3/guide/howto.adoc
new file mode 100644
index 00000000000..4499ccc603d
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/howto.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-howto.adoc[]
diff --git a/guides/grails-scheduled/v3/guide/install.adoc b/guides/grails-scheduled/v3/guide/install.adoc
new file mode 100644
index 00000000000..f7868dcf633
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/install.adoc
@@ -0,0 +1,15 @@
+To install the plugin, modify `build.gradle`:
+
+[source, groovy]
+.build.gradle
+----
+include::../snippets/build.gradle[indent=0, tag=buildscript]
+----
+<1> Schwartz Plugin
+
+And also add the following to the `dependencies` block:
+[source, groovy]
+.build.gradle
+----
+include::../snippets/build.gradle[indent=0, tag=dependencies]
+----
diff --git a/guides/grails-scheduled/v3/guide/logchanges.adoc b/guides/grails-scheduled/v3/guide/logchanges.adoc
new file mode 100644
index 00000000000..52c1c8af762
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/logchanges.adoc
@@ -0,0 +1,11 @@
+During this guide, we are going to use several log statements to show Job execution. 
+
+Add at the end of `logback.groovy` the next statement:
+
+[source, groovy]
+.grails-app/conf/logback.groovy
+----
+include::../snippets/grails-app/conf/logback.groovy[indent=0, tag=logdemo]
+----
+
+The above line configures a logger for package `demo` with log level INFO which uses the STDOUT appender and with adaptivity set to false.
\ No newline at end of file
diff --git a/guides/grails-scheduled/v3/guide/logicInService.adoc b/guides/grails-scheduled/v3/guide/logicInService.adoc
new file mode 100644
index 00000000000..c2a1e7e92b5
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/logicInService.adoc
@@ -0,0 +1,26 @@
+Although the previous example is valid, usually you don't want to put your business logic in a Job. A better approach is to create an additional service which the `JobService` invokes. This approach decouples your business logic from the scheduling logic. Moreover, it facilities testing and maintenance. Let's see an example:
+
+Create the following service:
+
+[source, groovy]
+.grails-app/services/demo/EmailService.groovy
+----
+include::../snippets/grails-app/services/demo/EmailService.groovy[]
+----
+
+And then the job:
+
+[source, groovy]
+.grails-app/services/demo/DailyEmailJobService.groovy
+----
+include::../snippets/grails-app/services/demo/DailyEmailJobService.groovy[tag=dailyEmailJobService]
+----
+<1> Force service to initialize, without forcing the service to be initialized the jobs will not execute
+<2> Inject the service
+<3> Call it
+<4> Trigger the job once a day at 04:30 AM
+
+
+Cron notation is often confusing so to assist in having clear logic and to make more advanced scheduling easier next we will
+take a look at job execution using a TaskScheduler.
+
diff --git a/guides/grails-scheduled/v3/guide/logicInServiceTwo.adoc b/guides/grails-scheduled/v3/guide/logicInServiceTwo.adoc
new file mode 100644
index 00000000000..855071d9f14
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/logicInServiceTwo.adoc
@@ -0,0 +1,21 @@
+In our previous cron example we did mention that many times cron can be confusing and is not intuitive. To alleviate some
+of that confusion here is the previous cron configuration written using the TaskScheduler
+
+[source, groovy]
+.grails-app/services/demo/todayat/DailyMailJobService.groovy
+----
+include::../snippets/grails-app/services/demo/todayat/DailyMailJobService.groovy[tag=dailyEmailJobService]
+----
+<1> Dependency injection of our TaskScheduler bean
+<2> Dependency injection of emailService
+<3> Calculate start time
+<4> Calculate repeat interval
+<5> Schedule task with start time and repeat interval
+
+Once you have written your schedule using TaskScheduler, register the job in bootstrap.
+
+[source, groovy]
+.grails-app/init/demo/BootStrap.groovy
+----
+include::../snippets/grails-app/init/demo/BootStrap.groovy[]
+----
\ No newline at end of file
diff --git a/guides/grails-scheduled/v3/guide/runnableTasks.adoc b/guides/grails-scheduled/v3/guide/runnableTasks.adoc
new file mode 100644
index 00000000000..d72ea1f5b36
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/runnableTasks.adoc
@@ -0,0 +1,15 @@
+Once you have created and wired the TaskScheduler you will need to create runnable tasks for it to execute.
+
+Create the following task
+
+[source, groovy]
+.grails-app/tasks/demo/EmailTask.groovy
+----
+include::../snippets/grails-app/tasks/demo/EmailTask.groovy[]
+----
+<1> Implement `Runnable`
+<2> Store incoming email address for later use
+<3> Store incoming message
+<4> Store incoming service
+<5> Task constructor: set `email`, `message` and `emailService`
+<6> Run the task
\ No newline at end of file
diff --git a/guides/grails-scheduled/v3/guide/summary.adoc b/guides/grails-scheduled/v3/guide/summary.adoc
new file mode 100644
index 00000000000..169a9ccb1bb
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/summary.adoc
@@ -0,0 +1,7 @@
+During this guide, we learned how to configure Jobs using the `@Scheduled` annotation using fixedDelay, initialDelay,
+and cron as well as manually configuring jobs with a TaskScheduler and tasks. Moreover, we learned that
+default configuration for `@Scheduled` or the TaskScheduler prevents concurrent execution.
+
+For more information review the
+https://docs.spring.io/spring/docs/current/spring-framework-reference/integration.html#scheduling[Spring Task Execution and Scheduling documentation] to learn more.
+
diff --git a/guides/grails-scheduled/v3/guide/taskScheduler.adoc b/guides/grails-scheduled/v3/guide/taskScheduler.adoc
new file mode 100644
index 00000000000..3ece20b068c
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/taskScheduler.adoc
@@ -0,0 +1,25 @@
+To get started using more advance scheduling techniques first we need to create and register a TaskScheduler bean.
+
+Create the following configuration file containing a new task scheduler bean
+
+[source, groovy]
+.src/main/groovy/demo/SchedulingConfiguration.groovy
+----
+include::../snippets/src/main/groovy/demo/SchedulingConfiguration.groovy[]
+----
+<1> Make your config discoverable
+<2> All related threads will be prefixed with ThreadPoolTaskScheduler
+
+If you wish to allow for concurrent execution set the thread pools size ex. `threadPoolTaskScheduler.setPoolSize(5)`
+
+NOTE: By default ThreadPoolTaskScheduler only has a single thread available for execution, which means tasks will not execute concurrently
+
+Now configure your app to automatically discover the new configuration so your new bean will work with standard
+Grails dependency injection
+
+[source, groovy]
+.grails-app/init/demo/Application.groovy
+----
+include::../snippets/grails-app/init/demo/Application.groovy[]
+----
+<1> Enable discovery of additional configuration files. You may also use Spring `@EnableScheduling` here to trigger scheduling.
diff --git a/guides/grails-scheduled/v3/guide/training.adoc b/guides/grails-scheduled/v3/guide/training.adoc
new file mode 100644
index 00000000000..11b7772a2c8
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/training.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-training.adoc[]
diff --git a/guides/grails-scheduled/v3/guide/triggerManually.adoc b/guides/grails-scheduled/v3/guide/triggerManually.adoc
new file mode 100644
index 00000000000..85fe22eb9e5
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/triggerManually.adoc
@@ -0,0 +1,52 @@
+Imagine the following scenario. You want to send every user an email 2 hours after they registered into your app. You want to ask him about his experiences during this first interaction with your service.
+
+For this guide, we are going to schedule a Job to trigger after one minute. 
+
+Modify `BootStrap.groovy` to call twice a new service named `RegisterService`.
+
+[source, groovy]
+.grails-app/init/demo/BootStrap.groovy
+----
+package demo
+
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class BootStrap {
+
+	RegisterService registerService
+
+    def init = { servletContext ->
+    	registerService.register('harry@howards.com')
+    	sleep(20_000)
+    	registerService.register('ron@howards.com')
+    }
+    def destroy = {
+    }
+}
+----
+
+Create `RegisterService.groovy`
+
+
+[source, groovy]
+.grails-app/services/demo/RegisterService.groovy
+----
+include::../snippets/grails-app/services/demo/RegisterService.groovy[]
+----
+
+<1> Dependency injection of our TaskScheduler bean
+<2> Dependency injection of emailService
+<3> This method returns a date one minute into the future
+<4> Schedule the trigger
+
+If you execute the above code you will see the Job being executed one minute after we schedule it and with the supplied email address.
+
+[source, bash]
+----
+INFO demo.RegisterService         : saving harry@howards.com at 23/1/2018 07:55:21
+INFO demo.RegisterService         : saving ron@howards.com at 23/1/2018 07:55:41
+INFO demo.EmailService            : Sending email to harry@howards.com : Follow up - How was your experience at 23/1/2018 07:56:21
+INFO demo.EmailService            : Sending email to ron@howards.com : Follow up - How was your experience at 23/1/2018 07:56:41
+----
+ 
\ No newline at end of file
diff --git a/guides/grails-scheduled/v3/guide/writing.adoc b/guides/grails-scheduled/v3/guide/writing.adoc
new file mode 100644
index 00000000000..330a12f1f0f
--- /dev/null
+++ b/guides/grails-scheduled/v3/guide/writing.adoc
@@ -0,0 +1,2 @@
+Lucky for us using Spring Task Execution and Scheduling is an out of the box feature for Grails so
+there is no need to add any additional dependencies. Lets go ahead and get started.
\ No newline at end of file
diff --git a/guides/grails-scheduled/v3/manifest.yml b/guides/grails-scheduled/v3/manifest.yml
new file mode 100644
index 00000000000..49aa94ebc4c
--- /dev/null
+++ b/guides/grails-scheduled/v3/manifest.yml
@@ -0,0 +1,23 @@
+# Generated by :vendorGuide
+name: grails-scheduled
+version: '3'
+title: Grails + @Scheduled
+subtitle: Learn how to use Spring Task Execution and Scheduling to schedule periodic
+  tasks inside your Grails applications
+authors:
+- Ben Rhine
+category: Advanced Grails
+tags:
+- spring
+- spring-boot
+- task
+- execution
+- scheduling
+- job
+- cron
+- grails3
+publicationDate: '2018-02-26'
+githubSlug: grails-guides/grails-scheduled
+githubBranch: grails3
+githubSha: a77fe4cd8746c88c2865cdb15a85bb976f988e94
+sourceCommitDate: '2026-05-01T08:42:40-04:00'
diff --git a/guides/grails-scheduled/v3/snippets/MANIFEST.yml b/guides/grails-scheduled/v3/snippets/MANIFEST.yml
new file mode 100644
index 00000000000..bd7da69eaf3
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/MANIFEST.yml
@@ -0,0 +1,33 @@
+# Generated by :vendorGuide
+source:
+  repo: grails-guides/grails-scheduled
+  branch: grails3
+  sha: a77fe4cd8746c88c2865cdb15a85bb976f988e94
+  capturedAt: '2026-05-01'
+entries:
+- vendoredPath: grails-app/services/demo/GenerateInvoiceJobService.groovy
+  upstreamPath: complete/grails-app/services/demo/GenerateInvoiceJobService.groovy
+- vendoredPath: grails-app/services/demo/GenerateInvoiceService.groovy
+  upstreamPath: complete/grails-app/services/demo/GenerateInvoiceService.groovy
+- vendoredPath: grails-app/services/demo/HelloWorldJobService.groovy
+  upstreamPath: complete/grails-app/services/demo/HelloWorldJobService.groovy
+- vendoredPath: build.gradle
+  upstreamPath: complete/build.gradle
+- vendoredPath: grails-app/conf/logback.groovy
+  upstreamPath: complete/grails-app/conf/logback.groovy
+- vendoredPath: grails-app/services/demo/EmailService.groovy
+  upstreamPath: complete/grails-app/services/demo/EmailService.groovy
+- vendoredPath: grails-app/services/demo/DailyEmailJobService.groovy
+  upstreamPath: complete/grails-app/services/demo/DailyEmailJobService.groovy
+- vendoredPath: grails-app/services/demo/todayat/DailyMailJobService.groovy
+  upstreamPath: complete/grails-app/services/demo/todayat/DailyMailJobService.groovy
+- vendoredPath: grails-app/init/demo/BootStrap.groovy
+  upstreamPath: complete/grails-app/init/demo/BootStrap.groovy
+- vendoredPath: grails-app/tasks/demo/EmailTask.groovy
+  upstreamPath: complete/grails-app/tasks/demo/EmailTask.groovy
+- vendoredPath: src/main/groovy/demo/SchedulingConfiguration.groovy
+  upstreamPath: complete/src/main/groovy/demo/SchedulingConfiguration.groovy
+- vendoredPath: grails-app/init/demo/Application.groovy
+  upstreamPath: complete/grails-app/init/demo/Application.groovy
+- vendoredPath: grails-app/services/demo/RegisterService.groovy
+  upstreamPath: complete/grails-app/services/demo/RegisterService.groovy
diff --git a/guides/grails-scheduled/v3/snippets/build.gradle b/guides/grails-scheduled/v3/snippets/build.gradle
new file mode 100644
index 00000000000..0df2cf77c5c
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/build.gradle
@@ -0,0 +1,106 @@
+//tag::buildscript[]
+buildscript {
+    repositories {
+        mavenLocal()
+        maven { url "https://repo.grails.org/grails/core" }
+    }
+    dependencies {
+        classpath "org.grails:grails-gradle-plugin:$grailsVersion"
+        classpath "org.grails.plugins:hibernate5:7.0.0"
+        classpath "gradle.plugin.com.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:2.1"
+        classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.0.11"
+    }
+}
+//end::buildscript[]
+
+version "0.1"
+group "demo"
+
+apply plugin:"eclipse"
+apply plugin:"idea"
+apply plugin:"war"
+apply plugin:"org.grails.grails-web"
+apply plugin:"com.github.erdi.webdriver-binaries"
+apply plugin:"com.bertramlabs.asset-pipeline"
+apply plugin:"org.grails.grails-gsp"
+
+repositories {
+    maven { url "https://repo.grails.org/grails/core" }
+}
+
+configurations {
+    developmentOnly
+    runtimeClasspath {
+        extendsFrom developmentOnly
+    }
+}
+
+dependencies {
+    developmentOnly("org.springframework.boot:spring-boot-devtools")
+    compile "org.springframework.boot:spring-boot-starter-logging"
+    compile "org.springframework.boot:spring-boot-autoconfigure"
+    compile "org.grails:grails-core"
+    compile "org.springframework.boot:spring-boot-starter-actuator"
+    compile "org.springframework.boot:spring-boot-starter-tomcat"
+    compile "org.grails:grails-web-boot"
+    compile "org.grails:grails-logging"
+    compile "org.grails:grails-plugin-rest"
+    compile "org.grails:grails-plugin-databinding"
+    compile "org.grails:grails-plugin-i18n"
+    compile "org.grails:grails-plugin-services"
+    compile "org.grails:grails-plugin-url-mappings"
+    compile "org.grails:grails-plugin-interceptors"
+    compile "org.grails.plugins:cache"
+    compile "org.grails.plugins:async"
+    compile "org.grails.plugins:scaffolding"
+    compile "org.grails.plugins:events"
+    compile "org.grails.plugins:hibernate5"
+    compile "org.hibernate:hibernate-core:5.4.0.Final"
+    compile "org.grails.plugins:gsp"
+    console "org.grails:grails-console"
+    profile "org.grails.profiles:web"
+    runtime "org.glassfish.web:el-impl:2.1.2-b03"
+    runtime "com.h2database:h2"
+    runtime "org.apache.tomcat:tomcat-jdbc"
+    runtime "javax.xml.bind:jaxb-api:2.3.0"
+    runtime "com.bertramlabs.plugins:asset-pipeline-grails:3.0.11"
+    testCompile "org.grails:grails-gorm-testing-support"
+    testCompile "org.grails:grails-web-testing-support"
+    testCompile "org.grails.plugins:geb"
+    testCompile "org.mockito:mockito-core"
+    testCompile "org.seleniumhq.selenium:htmlunit-driver:2.35.1"
+    testRuntime 'net.sourceforge.htmlunit:htmlunit:2.35.0'
+    testCompile "org.seleniumhq.selenium:selenium-remote-driver:3.141.59"
+    testCompile "org.seleniumhq.selenium:selenium-api:3.141.59"
+    testCompile "org.seleniumhq.selenium:selenium-support:3.141.59"
+    testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:3.141.59"
+    testRuntime "org.seleniumhq.selenium:selenium-firefox-driver:3.141.59"
+}
+
+bootRun {
+    jvmArgs('-Dspring.output.ansi.enabled=always')
+    sourceResources sourceSets.main
+    String springProfilesActive = 'spring.profiles.active'
+    systemProperty springProfilesActive, System.getProperty(springProfilesActive)
+
+}
+
+webdriverBinaries {
+    chromedriver {
+        version = '77.0.3865.40'
+    }
+    geckodriver {
+        version = '0.24.0'
+    }
+}
+
+tasks.withType(Test) {
+    systemProperty "geb.env", System.getProperty('geb.env')
+    systemProperty "webdriver.chrome.driver", System.getProperty('webdriver.chrome.driver')
+    systemProperty "webdriver.gecko.driver", System.getProperty('webdriver.gecko.driver')
+}
+
+assets {
+    minifyJs = true
+    minifyCss = true
+}
diff --git a/guides/grails-scheduled/v3/snippets/grails-app/conf/logback.groovy b/guides/grails-scheduled/v3/snippets/grails-app/conf/logback.groovy
new file mode 100644
index 00000000000..45d1732f324
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/grails-app/conf/logback.groovy
@@ -0,0 +1,39 @@
+import grails.util.BuildSettings
+import grails.util.Environment
+import org.springframework.boot.logging.logback.ColorConverter
+import org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter
+
+import java.nio.charset.Charset
+
+conversionRule 'clr', ColorConverter
+conversionRule 'wex', WhitespaceThrowableProxyConverter
+
+// See http://logback.qos.ch/manual/groovy.html for details on configuration
+appender('STDOUT', ConsoleAppender) {
+    encoder(PatternLayoutEncoder) {
+        charset = Charset.forName('UTF-8')
+
+        pattern =
+                '%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} ' + // Date
+                        '%clr(%5p) ' + // Log level
+                        '%clr(---){faint} %clr([%15.15t]){faint} ' + // Thread
+                        '%clr(%-40.40logger{39}){cyan} %clr(:){faint} ' + // Logger
+                        '%m%n%wex' // Message
+    }
+}
+
+def targetDir = BuildSettings.TARGET_DIR
+if (Environment.isDevelopmentMode() && targetDir != null) {
+    appender("FULL_STACKTRACE", FileAppender) {
+        file = "${targetDir}/stacktrace.log"
+        append = true
+        encoder(PatternLayoutEncoder) {
+            pattern = "%level %logger - %msg%n"
+        }
+    }
+    logger("StackTrace", ERROR, ['FULL_STACKTRACE'], false)
+}
+root(ERROR, ['STDOUT'])
+//tag::logdemo[]
+logger('demo', INFO, ['STDOUT'], false)
+//end::logdemo[]
\ No newline at end of file
diff --git a/guides/grails-scheduled/v3/snippets/grails-app/init/demo/Application.groovy b/guides/grails-scheduled/v3/snippets/grails-app/init/demo/Application.groovy
new file mode 100644
index 00000000000..5ad59b0a0e9
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/grails-app/init/demo/Application.groovy
@@ -0,0 +1,14 @@
+package demo
+
+import grails.boot.GrailsApp
+import grails.boot.config.GrailsAutoConfiguration
+import groovy.transform.CompileStatic
+import org.springframework.context.annotation.ComponentScan
+
+@CompileStatic
+@ComponentScan('demo') //<1>
+class Application extends GrailsAutoConfiguration {
+    static void main(String[] args) {
+        GrailsApp.run(Application, args)
+    }
+}
\ No newline at end of file
diff --git a/guides/grails-scheduled/v3/snippets/grails-app/init/demo/BootStrap.groovy b/guides/grails-scheduled/v3/snippets/grails-app/init/demo/BootStrap.groovy
new file mode 100644
index 00000000000..18f4b17a671
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/grails-app/init/demo/BootStrap.groovy
@@ -0,0 +1,21 @@
+package demo
+
+import demo.todayat.DailyMailJobService
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class BootStrap {
+
+	RegisterService registerService
+    DailyMailJobService dailyMailJobService
+
+    def init = { servletContext ->
+        final String followUp = 'Follow up - How was your experience'
+    	registerService.register('harry@howards.com', followUp)
+    	sleep(20_000)
+    	registerService.register('ron@howards.com', followUp)
+        dailyMailJobService.register('john.daily@example.com', 'Daily Reminder')
+    }
+    def destroy = {
+    }
+}
diff --git a/guides/grails-scheduled/v3/snippets/grails-app/services/demo/DailyEmailJobService.groovy b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/DailyEmailJobService.groovy
new file mode 100644
index 00000000000..99c306e585b
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/DailyEmailJobService.groovy
@@ -0,0 +1,21 @@
+package demo
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.springframework.scheduling.annotation.Scheduled
+
+//tag::dailyEmailJobService[]
+@Slf4j
+@CompileStatic
+class DailyEmailJobService  {
+
+    static lazyInit = false // <1>
+
+    EmailService emailService // <2>
+
+    @Scheduled(cron = "0 30 4 1/1 * ?") //<4>
+    void execute() {
+        emailService.send('john.doe@example.com', 'Test Message') // <3>
+    }
+}
+//end::dailyEmailJobService[]
\ No newline at end of file
diff --git a/guides/grails-scheduled/v3/snippets/grails-app/services/demo/EmailService.groovy b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/EmailService.groovy
new file mode 100644
index 00000000000..796fe0bd7b7
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/EmailService.groovy
@@ -0,0 +1,16 @@
+package demo
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+
+import java.text.SimpleDateFormat
+
+@Slf4j
+@CompileStatic
+class EmailService {
+
+    void send(String user, String message) {
+        log.info "Sending email to {} : {} at {}",
+                user, message, new SimpleDateFormat("dd/M/yyyy hh:mm:ss").format(new Date())
+    }
+}
diff --git a/guides/grails-scheduled/v3/snippets/grails-app/services/demo/GenerateInvoiceJobService.groovy b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/GenerateInvoiceJobService.groovy
new file mode 100644
index 00000000000..3e4aa56a06e
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/GenerateInvoiceJobService.groovy
@@ -0,0 +1,39 @@
+package demo
+
+import grails.gorm.transactions.Transactional
+
+class GenerateInvoiceJobService {
+    final int HOUR = 7
+    final int MINUTE = 0
+    final int SECONDS = 0
+
+    GenerateInvoiceService generateInvoiceService
+
+    @Transactional // <1>
+    void execute() {
+        println "I AM THE POST CONSTRUCT 2"
+    }
+//    void execute(JobExecutionContext context) throws JobExecutionException {
+//        generateInvoiceService.generateInvoices()
+//    }
+//
+//    @Override
+//    void buildTriggers() {
+//        Date startAt = dailyDate()
+//        triggers << factory('Daily email job at 7:00 AM')
+//                .startAt(startAt)
+//                .intervalInDays(1)
+//                .build()
+//
+//    }
+
+
+    Date dailyDate() {
+        Date startAt = new Date(hours: HOUR, minutes: MINUTE, seconds: SECONDS)
+        if(startAt.before(new Date())) {
+            return startAt + 1
+        }
+        startAt
+    }
+
+}
diff --git a/guides/grails-scheduled/v3/snippets/grails-app/services/demo/GenerateInvoiceService.groovy b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/GenerateInvoiceService.groovy
new file mode 100644
index 00000000000..1fd8e6ba0a6
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/GenerateInvoiceService.groovy
@@ -0,0 +1,13 @@
+package demo
+
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class GenerateInvoiceService {
+
+    void generateInvoices() {
+        // Check if users subscription has finished.
+        // Generate an invoice for a new period and save it in the database
+		// update user's subscription expiration date
+    }
+}
diff --git a/guides/grails-scheduled/v3/snippets/grails-app/services/demo/HelloWorldJobService.groovy b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/HelloWorldJobService.groovy
new file mode 100644
index 00000000000..b377f19f379
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/HelloWorldJobService.groovy
@@ -0,0 +1,24 @@
+package demo
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.springframework.scheduling.annotation.Scheduled
+
+import java.text.SimpleDateFormat
+
+@Slf4j //<1>
+@CompileStatic //<2>
+class HelloWorldJobService {
+
+    static lazyInit = false //<3>
+
+    @Scheduled(fixedDelay = 10000L) //<4>
+    void executeEveryTen() {
+        log.info "Simple Job every 10 seconds :{}", new SimpleDateFormat("dd/M/yyyy hh:mm:ss").format(new Date())
+    }
+
+    @Scheduled(fixedDelay = 45000L, initialDelay = 5000L) //<5>
+    void executeEveryFourtyFive() {
+        log.info "Simple Job every 45 seconds :{}", new SimpleDateFormat("dd/M/yyyy hh:mm:ss").format(new Date())
+    }
+}
diff --git a/guides/grails-scheduled/v3/snippets/grails-app/services/demo/RegisterService.groovy b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/RegisterService.groovy
new file mode 100644
index 00000000000..9d8c34019d1
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/RegisterService.groovy
@@ -0,0 +1,34 @@
+package demo
+
+import groovy.time.TimeCategory
+import groovy.transform.CompileDynamic
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
+import java.text.SimpleDateFormat
+
+@Slf4j
+@CompileStatic
+class RegisterService {
+
+	ThreadPoolTaskScheduler threadPoolTaskScheduler // <1>
+	EmailService emailService // <2>
+
+	void register(String email, String message) {
+		log.info 'saving {} at {}', email, new SimpleDateFormat("dd/M/yyyy hh:mm:ss").format(new Date())
+		scheduleFollowupEmail(email, message)
+	}
+
+	@CompileDynamic
+	Date startAtDate() { // <3>
+		Date startAt = new Date()
+		use(TimeCategory) {
+			startAt = startAt + 1.minute
+		}
+		startAt
+	}
+
+	void scheduleFollowupEmail(String email, String message) {
+		threadPoolTaskScheduler.schedule(new EmailTask(emailService, email, message), startAtDate()) // <4>
+	}
+}
\ No newline at end of file
diff --git a/guides/grails-scheduled/v3/snippets/grails-app/services/demo/todayat/DailyMailJobService.groovy b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/todayat/DailyMailJobService.groovy
new file mode 100644
index 00000000000..ce4d1193f9e
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/grails-app/services/demo/todayat/DailyMailJobService.groovy
@@ -0,0 +1,39 @@
+package demo.todayat
+
+//tag::dailyEmailJobService[]
+import demo.EmailService
+import demo.EmailTask
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.commons.lang.time.DateUtils
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
+import java.time.Duration
+
+@Slf4j
+@CompileStatic
+class DailyMailJobService {
+    private final int HOUR = 4
+    private final int MINUTE = 30
+    private final int SECONDS = 0
+    private static final long MILLISECONDS_IN_DAY = Duration.ofDays(1).getSeconds() * 1000 //<4>
+
+    ThreadPoolTaskScheduler threadPoolTaskScheduler // <1>
+    EmailService emailService // <2>
+
+    void register(String email, String message) {
+        scheduleDailyEmail(email, message)
+    }
+
+    void scheduleDailyEmail(String email, String message) { //<5>
+        threadPoolTaskScheduler.scheduleAtFixedRate(new EmailTask(emailService, email, message), dailyDate(), MILLISECONDS_IN_DAY)
+    }
+
+    Date dailyDate() { //<3>
+        Date startAt = new Date(hours: HOUR, minutes: MINUTE, seconds: SECONDS)
+        if(startAt.before(new Date())) {
+            return (DateUtils.addDays(startAt, 1))
+        }
+        startAt
+    }
+}
+//end::dailyEmailJobService[]
\ No newline at end of file
diff --git a/guides/grails-scheduled/v3/snippets/grails-app/tasks/demo/EmailTask.groovy b/guides/grails-scheduled/v3/snippets/grails-app/tasks/demo/EmailTask.groovy
new file mode 100644
index 00000000000..360f9b9c803
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/grails-app/tasks/demo/EmailTask.groovy
@@ -0,0 +1,22 @@
+package demo
+
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class EmailTask implements Runnable { //<1>
+
+    String email //<2>
+    String message //<3>
+    EmailService emailService //<4>
+
+    EmailTask(EmailService emailService, String email, String message) { //<5>
+        this.emailService = emailService
+        this.email = email
+        this.message = message
+    }
+
+    @Override
+    void run() { //<6>
+        emailService.send(email, message)
+    }
+}
diff --git a/guides/grails-scheduled/v3/snippets/src/main/groovy/demo/SchedulingConfiguration.groovy b/guides/grails-scheduled/v3/snippets/src/main/groovy/demo/SchedulingConfiguration.groovy
new file mode 100644
index 00000000000..7416b6d89f1
--- /dev/null
+++ b/guides/grails-scheduled/v3/snippets/src/main/groovy/demo/SchedulingConfiguration.groovy
@@ -0,0 +1,19 @@
+package demo
+
+import groovy.transform.CompileStatic
+import org.springframework.context.annotation.Bean
+import org.springframework.context.annotation.Configuration
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
+
+@CompileStatic
+@Configuration //<1>
+class SchedulingConfiguration {
+
+    @Bean
+    ThreadPoolTaskScheduler threadPoolTaskScheduler() {
+        ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler()
+        threadPoolTaskScheduler.setThreadNamePrefix("ThreadPoolTaskScheduler") //<2>
+        threadPoolTaskScheduler.initialize()
+        threadPoolTaskScheduler
+    }
+}
diff --git a/guides/grails-scheduled/v3/toc.yml b/guides/grails-scheduled/v3/toc.yml
new file mode 100644
index 00000000000..ba0f8279673
--- /dev/null
+++ b/guides/grails-scheduled/v3/toc.yml
@@ -0,0 +1,17 @@
+training:
+  title: Training
+gettingStarted: 
+  title: Getting Started
+  howto: How to complete the guide
+writing:
+  title: Writing Schedules
+  logchanges: Set log level INFO for package demo
+  createSimpleJob: Creating a simple Job
+  logicInService: Business logic in Services
+  taskScheduler: Task Scheduler Bean
+  runnableTasks: Runnable Tasks
+  triggerManually: Scheduling a Job manually
+  logicInServiceTwo: Simplified Cron with TaskSchedule
+  summary: Summary
+helpWithGrails:
+  title: Help with Grails  
\ No newline at end of file
diff --git a/guides/grails-scheduled/v4/guide/concurrentExecution.adoc b/guides/grails-scheduled/v4/guide/concurrentExecution.adoc
new file mode 100644
index 00000000000..3dd99be4695
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/concurrentExecution.adoc
@@ -0,0 +1,22 @@
+Imagine you develop a Software as a Service application with Grails. Each 
+day at 7:00 AM you want to check if any user's subscription has expired. If it is finished you want to create an invoice for the new period, save the invoice and update the user's subscription expiration date in the database. 
+
+You want to disable the concurrent execution of such a Job. Using just Quartz you need to annotate the job with
+`@DisallowConcurrentExecution`. With _Schwartz_ you still can do it, or, if you prefer you can implement the trait `StatefulSchwartzJob` instead of `SchwartzJob`. `StatefulSchwartzJob` extends form `SchwartzJob` and adds two annotations `@DisallowConcurrentExecution`, `@PersistJobDataAfterExecution`. 
+
+A sample code could look like: 
+
+[source, groovy]
+.grails-app/services/demo/GenerateInvoiceJobService.groovy
+----
+include::../snippets/grails-app/services/demo/GenerateInvoiceJobService.groovy[]
+----
+
+<1> Wrap the job's execution in a transaction.
+
+[source, groovy]
+.grails-app/services/demo/GenerateInvoiceService.groovy
+----
+include::../snippets/grails-app/services/demo/GenerateInvoiceService.groovy[]
+----
+
diff --git a/guides/grails-scheduled/v4/guide/createSimpleJob.adoc b/guides/grails-scheduled/v4/guide/createSimpleJob.adoc
new file mode 100644
index 00000000000..297e8b1869b
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/createSimpleJob.adoc
@@ -0,0 +1,66 @@
+Since scheduling is native functionality. Just execute:
+
+[source, bash]
+----
+./grailsw create-service HelloWorldJob
+----
+
+This will create the file `grails-app/services/demo/HelloWorldJobService.groovy` with a empty template method.
+
+The very basic skeleton is:
+
+[source, groovy]
+.grails-app/services/demo/HelloWorldJobService.groovy
+----
+@Transactional // <1>
+class HelloWorldJobService {
+
+    def serviceMethod() {
+        // <2>
+    }
+}
+----
+<1> By default services are `Transactional`
+<2> The job logic goes here
+
+
+Let's modify the previous code and add the following:
+
+[source, groovy]
+.grails-app/services/demo/HelloWorldJobService.groovy
+----
+include::../snippets/grails-app/services/demo/HelloWorldJobService.groovy[]
+----
+<1> Although Grails artifacts ( services, controllers ) inject a logger automatically, we annotate the class with `@Slf4j` to get better IDE support. Depending on the Grails version you are using, `@Slf4j` annotation will have an impact on aspects such as static compilation, logger name, etc. as described in the https://www.youtube.com/watch?v=3TppFy3lq1A[Grails Logging Quickcast].
+<2> Remove `@Transactional` as this service does not require transactions. Add `@CompileStatic` for performance. 
+<3> By default Grails' services are lazily initialized. You can disable this and make initialization eager with the lazyInit property. Without forcing the service to be eagerly initialized the jobs will not execute.
+<4> Create trigger every 10 seconds
+<5> Create another trigger every 45 seconds with an initial delay of 5 seconds (5000 millis)
+
+Now start the application:
+
+[source, bash]
+----
+./gradlew bootRun
+----
+
+And after a few seconds you will see the following output:
+
+[source, bash]
+----
+Simple Job every 45 seconds :14/2/2018 02:06:50 # <1>
+Simple Job every 10 seconds :14/2/2018 02:06:55 # <2>
+Simple Job every 10 seconds :14/2/2018 02:07:05 # <3>
+Simple Job every 10 seconds :14/2/2018 02:07:15
+Simple Job every 10 seconds :14/2/2018 02:07:25
+Simple Job every 45 seconds :14/2/2018 02:07:35 # <4>
+Simple Job every 10 seconds :14/2/2018 02:07:35
+----
+<1> First execution of 10 seconds job just after the application starts
+<2> The 45 seconds job just starts 5 seconds after the app starts. See `startDelay` in the trigger configuration.
+<3> Second execution of 10 seconds job just 10 seconds after the first execution
+<4> Second execution of 45 seconds job just 45 seconds after the first execution
+
+WARNING: When using `@Scheduled`, `static lazyInit = false` is required or your schedule will not run.
+
+NOTE: `@Scheduled` requires the use of CONSTANT values. Meaning that attempting to generate / build values for `fixedDelay`, `initialDelay`, `cron`, ect. will not work and cause compile errors.
diff --git a/guides/grails-scheduled/v4/guide/gettingStarted.adoc b/guides/grails-scheduled/v4/guide/gettingStarted.adoc
new file mode 100644
index 00000000000..8f228a28e6a
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/gettingStarted.adoc
@@ -0,0 +1,11 @@
+Nowadays it is pretty usual to have some kind of _cron_ or scheduled task that needs to run every midnight, every hour,
+a few times a week,... In the Java world we have been using the _Quartz_ library for ages to do this.
+
+In this guide you will learn how to use the native
+https://docs.spring.io/spring/docs/current/spring-framework-reference/integration.html#scheduling[Spring Task Execution and Scheduling] to
+schedule periodic tasks inside a Grails application.
+
+For additional documentation see:
+https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/annotation/Scheduled.html[@Scheduled]
+https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/TaskScheduler.html[TaskScheduler]
+https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/scheduling/support/PeriodicTrigger.html[PeriodicTrigger]
diff --git a/guides/grails-scheduled/v4/guide/helpWithGrails.adoc b/guides/grails-scheduled/v4/guide/helpWithGrails.adoc
new file mode 100644
index 00000000000..e062f614b1a
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/helpWithGrails.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-helpWithGrails.adoc[]
diff --git a/guides/grails-scheduled/v4/guide/howto.adoc b/guides/grails-scheduled/v4/guide/howto.adoc
new file mode 100644
index 00000000000..4499ccc603d
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/howto.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-howto.adoc[]
diff --git a/guides/grails-scheduled/v4/guide/install.adoc b/guides/grails-scheduled/v4/guide/install.adoc
new file mode 100644
index 00000000000..f7868dcf633
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/install.adoc
@@ -0,0 +1,15 @@
+To install the plugin, modify `build.gradle`:
+
+[source, groovy]
+.build.gradle
+----
+include::../snippets/build.gradle[indent=0, tag=buildscript]
+----
+<1> Schwartz Plugin
+
+And also add the following to the `dependencies` block:
+[source, groovy]
+.build.gradle
+----
+include::../snippets/build.gradle[indent=0, tag=dependencies]
+----
diff --git a/guides/grails-scheduled/v4/guide/logchanges.adoc b/guides/grails-scheduled/v4/guide/logchanges.adoc
new file mode 100644
index 00000000000..52c1c8af762
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/logchanges.adoc
@@ -0,0 +1,11 @@
+During this guide, we are going to use several log statements to show Job execution. 
+
+Add at the end of `logback.groovy` the next statement:
+
+[source, groovy]
+.grails-app/conf/logback.groovy
+----
+include::../snippets/grails-app/conf/logback.groovy[indent=0, tag=logdemo]
+----
+
+The above line configures a logger for package `demo` with log level INFO which uses the STDOUT appender and with adaptivity set to false.
\ No newline at end of file
diff --git a/guides/grails-scheduled/v4/guide/logicInService.adoc b/guides/grails-scheduled/v4/guide/logicInService.adoc
new file mode 100644
index 00000000000..c2a1e7e92b5
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/logicInService.adoc
@@ -0,0 +1,26 @@
+Although the previous example is valid, usually you don't want to put your business logic in a Job. A better approach is to create an additional service which the `JobService` invokes. This approach decouples your business logic from the scheduling logic. Moreover, it facilities testing and maintenance. Let's see an example:
+
+Create the following service:
+
+[source, groovy]
+.grails-app/services/demo/EmailService.groovy
+----
+include::../snippets/grails-app/services/demo/EmailService.groovy[]
+----
+
+And then the job:
+
+[source, groovy]
+.grails-app/services/demo/DailyEmailJobService.groovy
+----
+include::../snippets/grails-app/services/demo/DailyEmailJobService.groovy[tag=dailyEmailJobService]
+----
+<1> Force service to initialize, without forcing the service to be initialized the jobs will not execute
+<2> Inject the service
+<3> Call it
+<4> Trigger the job once a day at 04:30 AM
+
+
+Cron notation is often confusing so to assist in having clear logic and to make more advanced scheduling easier next we will
+take a look at job execution using a TaskScheduler.
+
diff --git a/guides/grails-scheduled/v4/guide/logicInServiceTwo.adoc b/guides/grails-scheduled/v4/guide/logicInServiceTwo.adoc
new file mode 100644
index 00000000000..855071d9f14
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/logicInServiceTwo.adoc
@@ -0,0 +1,21 @@
+In our previous cron example we did mention that many times cron can be confusing and is not intuitive. To alleviate some
+of that confusion here is the previous cron configuration written using the TaskScheduler
+
+[source, groovy]
+.grails-app/services/demo/todayat/DailyMailJobService.groovy
+----
+include::../snippets/grails-app/services/demo/todayat/DailyMailJobService.groovy[tag=dailyEmailJobService]
+----
+<1> Dependency injection of our TaskScheduler bean
+<2> Dependency injection of emailService
+<3> Calculate start time
+<4> Calculate repeat interval
+<5> Schedule task with start time and repeat interval
+
+Once you have written your schedule using TaskScheduler, register the job in bootstrap.
+
+[source, groovy]
+.grails-app/init/demo/BootStrap.groovy
+----
+include::../snippets/grails-app/init/demo/BootStrap.groovy[]
+----
\ No newline at end of file
diff --git a/guides/grails-scheduled/v4/guide/runnableTasks.adoc b/guides/grails-scheduled/v4/guide/runnableTasks.adoc
new file mode 100644
index 00000000000..d72ea1f5b36
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/runnableTasks.adoc
@@ -0,0 +1,15 @@
+Once you have created and wired the TaskScheduler you will need to create runnable tasks for it to execute.
+
+Create the following task
+
+[source, groovy]
+.grails-app/tasks/demo/EmailTask.groovy
+----
+include::../snippets/grails-app/tasks/demo/EmailTask.groovy[]
+----
+<1> Implement `Runnable`
+<2> Store incoming email address for later use
+<3> Store incoming message
+<4> Store incoming service
+<5> Task constructor: set `email`, `message` and `emailService`
+<6> Run the task
\ No newline at end of file
diff --git a/guides/grails-scheduled/v4/guide/summary.adoc b/guides/grails-scheduled/v4/guide/summary.adoc
new file mode 100644
index 00000000000..169a9ccb1bb
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/summary.adoc
@@ -0,0 +1,7 @@
+During this guide, we learned how to configure Jobs using the `@Scheduled` annotation using fixedDelay, initialDelay,
+and cron as well as manually configuring jobs with a TaskScheduler and tasks. Moreover, we learned that
+default configuration for `@Scheduled` or the TaskScheduler prevents concurrent execution.
+
+For more information review the
+https://docs.spring.io/spring/docs/current/spring-framework-reference/integration.html#scheduling[Spring Task Execution and Scheduling documentation] to learn more.
+
diff --git a/guides/grails-scheduled/v4/guide/taskScheduler.adoc b/guides/grails-scheduled/v4/guide/taskScheduler.adoc
new file mode 100644
index 00000000000..3ece20b068c
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/taskScheduler.adoc
@@ -0,0 +1,25 @@
+To get started using more advance scheduling techniques first we need to create and register a TaskScheduler bean.
+
+Create the following configuration file containing a new task scheduler bean
+
+[source, groovy]
+.src/main/groovy/demo/SchedulingConfiguration.groovy
+----
+include::../snippets/src/main/groovy/demo/SchedulingConfiguration.groovy[]
+----
+<1> Make your config discoverable
+<2> All related threads will be prefixed with ThreadPoolTaskScheduler
+
+If you wish to allow for concurrent execution set the thread pools size ex. `threadPoolTaskScheduler.setPoolSize(5)`
+
+NOTE: By default ThreadPoolTaskScheduler only has a single thread available for execution, which means tasks will not execute concurrently
+
+Now configure your app to automatically discover the new configuration so your new bean will work with standard
+Grails dependency injection
+
+[source, groovy]
+.grails-app/init/demo/Application.groovy
+----
+include::../snippets/grails-app/init/demo/Application.groovy[]
+----
+<1> Enable discovery of additional configuration files. You may also use Spring `@EnableScheduling` here to trigger scheduling.
diff --git a/guides/grails-scheduled/v4/guide/training.adoc b/guides/grails-scheduled/v4/guide/training.adoc
new file mode 100644
index 00000000000..11b7772a2c8
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/training.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-training.adoc[]
diff --git a/guides/grails-scheduled/v4/guide/triggerManually.adoc b/guides/grails-scheduled/v4/guide/triggerManually.adoc
new file mode 100644
index 00000000000..85fe22eb9e5
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/triggerManually.adoc
@@ -0,0 +1,52 @@
+Imagine the following scenario. You want to send every user an email 2 hours after they registered into your app. You want to ask him about his experiences during this first interaction with your service.
+
+For this guide, we are going to schedule a Job to trigger after one minute. 
+
+Modify `BootStrap.groovy` to call twice a new service named `RegisterService`.
+
+[source, groovy]
+.grails-app/init/demo/BootStrap.groovy
+----
+package demo
+
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class BootStrap {
+
+	RegisterService registerService
+
+    def init = { servletContext ->
+    	registerService.register('harry@howards.com')
+    	sleep(20_000)
+    	registerService.register('ron@howards.com')
+    }
+    def destroy = {
+    }
+}
+----
+
+Create `RegisterService.groovy`
+
+
+[source, groovy]
+.grails-app/services/demo/RegisterService.groovy
+----
+include::../snippets/grails-app/services/demo/RegisterService.groovy[]
+----
+
+<1> Dependency injection of our TaskScheduler bean
+<2> Dependency injection of emailService
+<3> This method returns a date one minute into the future
+<4> Schedule the trigger
+
+If you execute the above code you will see the Job being executed one minute after we schedule it and with the supplied email address.
+
+[source, bash]
+----
+INFO demo.RegisterService         : saving harry@howards.com at 23/1/2018 07:55:21
+INFO demo.RegisterService         : saving ron@howards.com at 23/1/2018 07:55:41
+INFO demo.EmailService            : Sending email to harry@howards.com : Follow up - How was your experience at 23/1/2018 07:56:21
+INFO demo.EmailService            : Sending email to ron@howards.com : Follow up - How was your experience at 23/1/2018 07:56:41
+----
+ 
\ No newline at end of file
diff --git a/guides/grails-scheduled/v4/guide/writing.adoc b/guides/grails-scheduled/v4/guide/writing.adoc
new file mode 100644
index 00000000000..330a12f1f0f
--- /dev/null
+++ b/guides/grails-scheduled/v4/guide/writing.adoc
@@ -0,0 +1,2 @@
+Lucky for us using Spring Task Execution and Scheduling is an out of the box feature for Grails so
+there is no need to add any additional dependencies. Lets go ahead and get started.
\ No newline at end of file
diff --git a/guides/grails-scheduled/v4/manifest.yml b/guides/grails-scheduled/v4/manifest.yml
new file mode 100644
index 00000000000..0dc423d6a0e
--- /dev/null
+++ b/guides/grails-scheduled/v4/manifest.yml
@@ -0,0 +1,23 @@
+# Generated by :vendorGuide
+name: grails-scheduled
+version: '4'
+title: Grails + @Scheduled
+subtitle: Learn how to use Spring Task Execution and Scheduling to schedule periodic
+  tasks inside your Grails applications
+authors:
+- Ben Rhine
+category: Advanced Grails
+tags:
+- spring
+- spring-boot
+- task
+- execution
+- scheduling
+- job
+- cron
+- grails4
+publicationDate: '2018-02-26'
+githubSlug: grails-guides/grails-scheduled
+githubBranch: grails4
+githubSha: a0eb85a824bb304e47b92cf92a7359bd4576a89f
+sourceCommitDate: '2026-05-01T08:42:42-04:00'
diff --git a/guides/grails-scheduled/v4/snippets/MANIFEST.yml b/guides/grails-scheduled/v4/snippets/MANIFEST.yml
new file mode 100644
index 00000000000..f86ebeada14
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/MANIFEST.yml
@@ -0,0 +1,33 @@
+# Generated by :vendorGuide
+source:
+  repo: grails-guides/grails-scheduled
+  branch: grails4
+  sha: a0eb85a824bb304e47b92cf92a7359bd4576a89f
+  capturedAt: '2026-05-01'
+entries:
+- vendoredPath: grails-app/services/demo/GenerateInvoiceJobService.groovy
+  upstreamPath: complete/grails-app/services/demo/GenerateInvoiceJobService.groovy
+- vendoredPath: grails-app/services/demo/GenerateInvoiceService.groovy
+  upstreamPath: complete/grails-app/services/demo/GenerateInvoiceService.groovy
+- vendoredPath: grails-app/services/demo/HelloWorldJobService.groovy
+  upstreamPath: complete/grails-app/services/demo/HelloWorldJobService.groovy
+- vendoredPath: build.gradle
+  upstreamPath: complete/build.gradle
+- vendoredPath: grails-app/conf/logback.groovy
+  upstreamPath: complete/grails-app/conf/logback.groovy
+- vendoredPath: grails-app/services/demo/EmailService.groovy
+  upstreamPath: complete/grails-app/services/demo/EmailService.groovy
+- vendoredPath: grails-app/services/demo/DailyEmailJobService.groovy
+  upstreamPath: complete/grails-app/services/demo/DailyEmailJobService.groovy
+- vendoredPath: grails-app/services/demo/todayat/DailyMailJobService.groovy
+  upstreamPath: complete/grails-app/services/demo/todayat/DailyMailJobService.groovy
+- vendoredPath: grails-app/init/demo/BootStrap.groovy
+  upstreamPath: complete/grails-app/init/demo/BootStrap.groovy
+- vendoredPath: grails-app/tasks/demo/EmailTask.groovy
+  upstreamPath: complete/grails-app/tasks/demo/EmailTask.groovy
+- vendoredPath: src/main/groovy/demo/SchedulingConfiguration.groovy
+  upstreamPath: complete/src/main/groovy/demo/SchedulingConfiguration.groovy
+- vendoredPath: grails-app/init/demo/Application.groovy
+  upstreamPath: complete/grails-app/init/demo/Application.groovy
+- vendoredPath: grails-app/services/demo/RegisterService.groovy
+  upstreamPath: complete/grails-app/services/demo/RegisterService.groovy
diff --git a/guides/grails-scheduled/v4/snippets/build.gradle b/guides/grails-scheduled/v4/snippets/build.gradle
new file mode 100644
index 00000000000..0df2cf77c5c
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/build.gradle
@@ -0,0 +1,106 @@
+//tag::buildscript[]
+buildscript {
+    repositories {
+        mavenLocal()
+        maven { url "https://repo.grails.org/grails/core" }
+    }
+    dependencies {
+        classpath "org.grails:grails-gradle-plugin:$grailsVersion"
+        classpath "org.grails.plugins:hibernate5:7.0.0"
+        classpath "gradle.plugin.com.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:2.1"
+        classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.0.11"
+    }
+}
+//end::buildscript[]
+
+version "0.1"
+group "demo"
+
+apply plugin:"eclipse"
+apply plugin:"idea"
+apply plugin:"war"
+apply plugin:"org.grails.grails-web"
+apply plugin:"com.github.erdi.webdriver-binaries"
+apply plugin:"com.bertramlabs.asset-pipeline"
+apply plugin:"org.grails.grails-gsp"
+
+repositories {
+    maven { url "https://repo.grails.org/grails/core" }
+}
+
+configurations {
+    developmentOnly
+    runtimeClasspath {
+        extendsFrom developmentOnly
+    }
+}
+
+dependencies {
+    developmentOnly("org.springframework.boot:spring-boot-devtools")
+    compile "org.springframework.boot:spring-boot-starter-logging"
+    compile "org.springframework.boot:spring-boot-autoconfigure"
+    compile "org.grails:grails-core"
+    compile "org.springframework.boot:spring-boot-starter-actuator"
+    compile "org.springframework.boot:spring-boot-starter-tomcat"
+    compile "org.grails:grails-web-boot"
+    compile "org.grails:grails-logging"
+    compile "org.grails:grails-plugin-rest"
+    compile "org.grails:grails-plugin-databinding"
+    compile "org.grails:grails-plugin-i18n"
+    compile "org.grails:grails-plugin-services"
+    compile "org.grails:grails-plugin-url-mappings"
+    compile "org.grails:grails-plugin-interceptors"
+    compile "org.grails.plugins:cache"
+    compile "org.grails.plugins:async"
+    compile "org.grails.plugins:scaffolding"
+    compile "org.grails.plugins:events"
+    compile "org.grails.plugins:hibernate5"
+    compile "org.hibernate:hibernate-core:5.4.0.Final"
+    compile "org.grails.plugins:gsp"
+    console "org.grails:grails-console"
+    profile "org.grails.profiles:web"
+    runtime "org.glassfish.web:el-impl:2.1.2-b03"
+    runtime "com.h2database:h2"
+    runtime "org.apache.tomcat:tomcat-jdbc"
+    runtime "javax.xml.bind:jaxb-api:2.3.0"
+    runtime "com.bertramlabs.plugins:asset-pipeline-grails:3.0.11"
+    testCompile "org.grails:grails-gorm-testing-support"
+    testCompile "org.grails:grails-web-testing-support"
+    testCompile "org.grails.plugins:geb"
+    testCompile "org.mockito:mockito-core"
+    testCompile "org.seleniumhq.selenium:htmlunit-driver:2.35.1"
+    testRuntime 'net.sourceforge.htmlunit:htmlunit:2.35.0'
+    testCompile "org.seleniumhq.selenium:selenium-remote-driver:3.141.59"
+    testCompile "org.seleniumhq.selenium:selenium-api:3.141.59"
+    testCompile "org.seleniumhq.selenium:selenium-support:3.141.59"
+    testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:3.141.59"
+    testRuntime "org.seleniumhq.selenium:selenium-firefox-driver:3.141.59"
+}
+
+bootRun {
+    jvmArgs('-Dspring.output.ansi.enabled=always')
+    sourceResources sourceSets.main
+    String springProfilesActive = 'spring.profiles.active'
+    systemProperty springProfilesActive, System.getProperty(springProfilesActive)
+
+}
+
+webdriverBinaries {
+    chromedriver {
+        version = '77.0.3865.40'
+    }
+    geckodriver {
+        version = '0.24.0'
+    }
+}
+
+tasks.withType(Test) {
+    systemProperty "geb.env", System.getProperty('geb.env')
+    systemProperty "webdriver.chrome.driver", System.getProperty('webdriver.chrome.driver')
+    systemProperty "webdriver.gecko.driver", System.getProperty('webdriver.gecko.driver')
+}
+
+assets {
+    minifyJs = true
+    minifyCss = true
+}
diff --git a/guides/grails-scheduled/v4/snippets/grails-app/conf/logback.groovy b/guides/grails-scheduled/v4/snippets/grails-app/conf/logback.groovy
new file mode 100644
index 00000000000..45d1732f324
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/grails-app/conf/logback.groovy
@@ -0,0 +1,39 @@
+import grails.util.BuildSettings
+import grails.util.Environment
+import org.springframework.boot.logging.logback.ColorConverter
+import org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter
+
+import java.nio.charset.Charset
+
+conversionRule 'clr', ColorConverter
+conversionRule 'wex', WhitespaceThrowableProxyConverter
+
+// See http://logback.qos.ch/manual/groovy.html for details on configuration
+appender('STDOUT', ConsoleAppender) {
+    encoder(PatternLayoutEncoder) {
+        charset = Charset.forName('UTF-8')
+
+        pattern =
+                '%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} ' + // Date
+                        '%clr(%5p) ' + // Log level
+                        '%clr(---){faint} %clr([%15.15t]){faint} ' + // Thread
+                        '%clr(%-40.40logger{39}){cyan} %clr(:){faint} ' + // Logger
+                        '%m%n%wex' // Message
+    }
+}
+
+def targetDir = BuildSettings.TARGET_DIR
+if (Environment.isDevelopmentMode() && targetDir != null) {
+    appender("FULL_STACKTRACE", FileAppender) {
+        file = "${targetDir}/stacktrace.log"
+        append = true
+        encoder(PatternLayoutEncoder) {
+            pattern = "%level %logger - %msg%n"
+        }
+    }
+    logger("StackTrace", ERROR, ['FULL_STACKTRACE'], false)
+}
+root(ERROR, ['STDOUT'])
+//tag::logdemo[]
+logger('demo', INFO, ['STDOUT'], false)
+//end::logdemo[]
\ No newline at end of file
diff --git a/guides/grails-scheduled/v4/snippets/grails-app/init/demo/Application.groovy b/guides/grails-scheduled/v4/snippets/grails-app/init/demo/Application.groovy
new file mode 100644
index 00000000000..5ad59b0a0e9
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/grails-app/init/demo/Application.groovy
@@ -0,0 +1,14 @@
+package demo
+
+import grails.boot.GrailsApp
+import grails.boot.config.GrailsAutoConfiguration
+import groovy.transform.CompileStatic
+import org.springframework.context.annotation.ComponentScan
+
+@CompileStatic
+@ComponentScan('demo') //<1>
+class Application extends GrailsAutoConfiguration {
+    static void main(String[] args) {
+        GrailsApp.run(Application, args)
+    }
+}
\ No newline at end of file
diff --git a/guides/grails-scheduled/v4/snippets/grails-app/init/demo/BootStrap.groovy b/guides/grails-scheduled/v4/snippets/grails-app/init/demo/BootStrap.groovy
new file mode 100644
index 00000000000..18f4b17a671
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/grails-app/init/demo/BootStrap.groovy
@@ -0,0 +1,21 @@
+package demo
+
+import demo.todayat.DailyMailJobService
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class BootStrap {
+
+	RegisterService registerService
+    DailyMailJobService dailyMailJobService
+
+    def init = { servletContext ->
+        final String followUp = 'Follow up - How was your experience'
+    	registerService.register('harry@howards.com', followUp)
+    	sleep(20_000)
+    	registerService.register('ron@howards.com', followUp)
+        dailyMailJobService.register('john.daily@example.com', 'Daily Reminder')
+    }
+    def destroy = {
+    }
+}
diff --git a/guides/grails-scheduled/v4/snippets/grails-app/services/demo/DailyEmailJobService.groovy b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/DailyEmailJobService.groovy
new file mode 100644
index 00000000000..99c306e585b
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/DailyEmailJobService.groovy
@@ -0,0 +1,21 @@
+package demo
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.springframework.scheduling.annotation.Scheduled
+
+//tag::dailyEmailJobService[]
+@Slf4j
+@CompileStatic
+class DailyEmailJobService  {
+
+    static lazyInit = false // <1>
+
+    EmailService emailService // <2>
+
+    @Scheduled(cron = "0 30 4 1/1 * ?") //<4>
+    void execute() {
+        emailService.send('john.doe@example.com', 'Test Message') // <3>
+    }
+}
+//end::dailyEmailJobService[]
\ No newline at end of file
diff --git a/guides/grails-scheduled/v4/snippets/grails-app/services/demo/EmailService.groovy b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/EmailService.groovy
new file mode 100644
index 00000000000..796fe0bd7b7
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/EmailService.groovy
@@ -0,0 +1,16 @@
+package demo
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+
+import java.text.SimpleDateFormat
+
+@Slf4j
+@CompileStatic
+class EmailService {
+
+    void send(String user, String message) {
+        log.info "Sending email to {} : {} at {}",
+                user, message, new SimpleDateFormat("dd/M/yyyy hh:mm:ss").format(new Date())
+    }
+}
diff --git a/guides/grails-scheduled/v4/snippets/grails-app/services/demo/GenerateInvoiceJobService.groovy b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/GenerateInvoiceJobService.groovy
new file mode 100644
index 00000000000..3e4aa56a06e
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/GenerateInvoiceJobService.groovy
@@ -0,0 +1,39 @@
+package demo
+
+import grails.gorm.transactions.Transactional
+
+class GenerateInvoiceJobService {
+    final int HOUR = 7
+    final int MINUTE = 0
+    final int SECONDS = 0
+
+    GenerateInvoiceService generateInvoiceService
+
+    @Transactional // <1>
+    void execute() {
+        println "I AM THE POST CONSTRUCT 2"
+    }
+//    void execute(JobExecutionContext context) throws JobExecutionException {
+//        generateInvoiceService.generateInvoices()
+//    }
+//
+//    @Override
+//    void buildTriggers() {
+//        Date startAt = dailyDate()
+//        triggers << factory('Daily email job at 7:00 AM')
+//                .startAt(startAt)
+//                .intervalInDays(1)
+//                .build()
+//
+//    }
+
+
+    Date dailyDate() {
+        Date startAt = new Date(hours: HOUR, minutes: MINUTE, seconds: SECONDS)
+        if(startAt.before(new Date())) {
+            return startAt + 1
+        }
+        startAt
+    }
+
+}
diff --git a/guides/grails-scheduled/v4/snippets/grails-app/services/demo/GenerateInvoiceService.groovy b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/GenerateInvoiceService.groovy
new file mode 100644
index 00000000000..1fd8e6ba0a6
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/GenerateInvoiceService.groovy
@@ -0,0 +1,13 @@
+package demo
+
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class GenerateInvoiceService {
+
+    void generateInvoices() {
+        // Check if users subscription has finished.
+        // Generate an invoice for a new period and save it in the database
+		// update user's subscription expiration date
+    }
+}
diff --git a/guides/grails-scheduled/v4/snippets/grails-app/services/demo/HelloWorldJobService.groovy b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/HelloWorldJobService.groovy
new file mode 100644
index 00000000000..b377f19f379
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/HelloWorldJobService.groovy
@@ -0,0 +1,24 @@
+package demo
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.springframework.scheduling.annotation.Scheduled
+
+import java.text.SimpleDateFormat
+
+@Slf4j //<1>
+@CompileStatic //<2>
+class HelloWorldJobService {
+
+    static lazyInit = false //<3>
+
+    @Scheduled(fixedDelay = 10000L) //<4>
+    void executeEveryTen() {
+        log.info "Simple Job every 10 seconds :{}", new SimpleDateFormat("dd/M/yyyy hh:mm:ss").format(new Date())
+    }
+
+    @Scheduled(fixedDelay = 45000L, initialDelay = 5000L) //<5>
+    void executeEveryFourtyFive() {
+        log.info "Simple Job every 45 seconds :{}", new SimpleDateFormat("dd/M/yyyy hh:mm:ss").format(new Date())
+    }
+}
diff --git a/guides/grails-scheduled/v4/snippets/grails-app/services/demo/RegisterService.groovy b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/RegisterService.groovy
new file mode 100644
index 00000000000..9d8c34019d1
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/RegisterService.groovy
@@ -0,0 +1,34 @@
+package demo
+
+import groovy.time.TimeCategory
+import groovy.transform.CompileDynamic
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
+import java.text.SimpleDateFormat
+
+@Slf4j
+@CompileStatic
+class RegisterService {
+
+	ThreadPoolTaskScheduler threadPoolTaskScheduler // <1>
+	EmailService emailService // <2>
+
+	void register(String email, String message) {
+		log.info 'saving {} at {}', email, new SimpleDateFormat("dd/M/yyyy hh:mm:ss").format(new Date())
+		scheduleFollowupEmail(email, message)
+	}
+
+	@CompileDynamic
+	Date startAtDate() { // <3>
+		Date startAt = new Date()
+		use(TimeCategory) {
+			startAt = startAt + 1.minute
+		}
+		startAt
+	}
+
+	void scheduleFollowupEmail(String email, String message) {
+		threadPoolTaskScheduler.schedule(new EmailTask(emailService, email, message), startAtDate()) // <4>
+	}
+}
\ No newline at end of file
diff --git a/guides/grails-scheduled/v4/snippets/grails-app/services/demo/todayat/DailyMailJobService.groovy b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/todayat/DailyMailJobService.groovy
new file mode 100644
index 00000000000..ce4d1193f9e
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/grails-app/services/demo/todayat/DailyMailJobService.groovy
@@ -0,0 +1,39 @@
+package demo.todayat
+
+//tag::dailyEmailJobService[]
+import demo.EmailService
+import demo.EmailTask
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.commons.lang.time.DateUtils
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
+import java.time.Duration
+
+@Slf4j
+@CompileStatic
+class DailyMailJobService {
+    private final int HOUR = 4
+    private final int MINUTE = 30
+    private final int SECONDS = 0
+    private static final long MILLISECONDS_IN_DAY = Duration.ofDays(1).getSeconds() * 1000 //<4>
+
+    ThreadPoolTaskScheduler threadPoolTaskScheduler // <1>
+    EmailService emailService // <2>
+
+    void register(String email, String message) {
+        scheduleDailyEmail(email, message)
+    }
+
+    void scheduleDailyEmail(String email, String message) { //<5>
+        threadPoolTaskScheduler.scheduleAtFixedRate(new EmailTask(emailService, email, message), dailyDate(), MILLISECONDS_IN_DAY)
+    }
+
+    Date dailyDate() { //<3>
+        Date startAt = new Date(hours: HOUR, minutes: MINUTE, seconds: SECONDS)
+        if(startAt.before(new Date())) {
+            return (DateUtils.addDays(startAt, 1))
+        }
+        startAt
+    }
+}
+//end::dailyEmailJobService[]
\ No newline at end of file
diff --git a/guides/grails-scheduled/v4/snippets/grails-app/tasks/demo/EmailTask.groovy b/guides/grails-scheduled/v4/snippets/grails-app/tasks/demo/EmailTask.groovy
new file mode 100644
index 00000000000..360f9b9c803
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/grails-app/tasks/demo/EmailTask.groovy
@@ -0,0 +1,22 @@
+package demo
+
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class EmailTask implements Runnable { //<1>
+
+    String email //<2>
+    String message //<3>
+    EmailService emailService //<4>
+
+    EmailTask(EmailService emailService, String email, String message) { //<5>
+        this.emailService = emailService
+        this.email = email
+        this.message = message
+    }
+
+    @Override
+    void run() { //<6>
+        emailService.send(email, message)
+    }
+}
diff --git a/guides/grails-scheduled/v4/snippets/src/main/groovy/demo/SchedulingConfiguration.groovy b/guides/grails-scheduled/v4/snippets/src/main/groovy/demo/SchedulingConfiguration.groovy
new file mode 100644
index 00000000000..7416b6d89f1
--- /dev/null
+++ b/guides/grails-scheduled/v4/snippets/src/main/groovy/demo/SchedulingConfiguration.groovy
@@ -0,0 +1,19 @@
+package demo
+
+import groovy.transform.CompileStatic
+import org.springframework.context.annotation.Bean
+import org.springframework.context.annotation.Configuration
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
+
+@CompileStatic
+@Configuration //<1>
+class SchedulingConfiguration {
+
+    @Bean
+    ThreadPoolTaskScheduler threadPoolTaskScheduler() {
+        ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler()
+        threadPoolTaskScheduler.setThreadNamePrefix("ThreadPoolTaskScheduler") //<2>
+        threadPoolTaskScheduler.initialize()
+        threadPoolTaskScheduler
+    }
+}
diff --git a/guides/grails-scheduled/v4/toc.yml b/guides/grails-scheduled/v4/toc.yml
new file mode 100644
index 00000000000..ba0f8279673
--- /dev/null
+++ b/guides/grails-scheduled/v4/toc.yml
@@ -0,0 +1,17 @@
+training:
+  title: Training
+gettingStarted: 
+  title: Getting Started
+  howto: How to complete the guide
+writing:
+  title: Writing Schedules
+  logchanges: Set log level INFO for package demo
+  createSimpleJob: Creating a simple Job
+  logicInService: Business logic in Services
+  taskScheduler: Task Scheduler Bean
+  runnableTasks: Runnable Tasks
+  triggerManually: Scheduling a Job manually
+  logicInServiceTwo: Simplified Cron with TaskSchedule
+  summary: Summary
+helpWithGrails:
+  title: Help with Grails  
\ No newline at end of file
diff --git a/guides/vaadin-grails/v4/guide/aboutVaadin.adoc b/guides/vaadin-grails/v4/guide/aboutVaadin.adoc
new file mode 100644
index 00000000000..10191934602
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/aboutVaadin.adoc
@@ -0,0 +1,21 @@
+
+https://vaadin.com/framework[Vaadin] is Java Web UI Framework for Business Applications. 
+
+____
+With Vaadin Framework, you'll use a familiar component based approach to build awesome single page web apps faster than with any other UI framework. Forget complex web technologies and just use Java or any other JVM language. Only a browser is needed to access your application - no plugins required.
+____
+
+image::charts-on-mobile-and-desktop.png[]
+
+TIP: The Vaadin 8 Grails profile allows you mix Vaadin endpoints and traditional Grails endpoints. 
+
+On the one hand, we are going to have endpoints which will be handled by Grails Controllers. They will render HTML, JSON or XML using  
+http://gsp.grails.org[GSP] or http://views.grails.org[Grails Views]. 
+
+On the other hand, we are going to have Vaadin endpoints. We will develop the UI using Java or Groovy, and we will connect to the Grails service layer directly. 
+
+If you require additional information on Vaadin, please check out the official documentation
+https://vaadin.com/docs/-/part/framework/introduction/intro-overview.html[here]. Additionally,
+you may find a fair number of examples in an older version of Vaadin, and
+https://vaadin.com/framework/whatsnew[this] page gives a good explanation of how some of these
+features have been updated in Vaadin 8.
\ No newline at end of file
diff --git a/guides/vaadin-grails/v4/guide/addingToVaadin.adoc b/guides/vaadin-grails/v4/guide/addingToVaadin.adoc
new file mode 100644
index 00000000000..4f3d810da71
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/addingToVaadin.adoc
@@ -0,0 +1,35 @@
+Finally time to start adding Vaadin code to our application!
+
+Consider `src/main/groovy/demo/DemoGrailsUI.groovy` to be your Vaadin
+controller / dispatcher as it will help you understand the Vaadin flow. Our `init()`
+method is the applications entry point to Vaadin itself, this is your top level view
+essentially. From here you can setup navigation and other whole app view components.
+
+Our `DemoGrailsUI.groovy` as it currently is, is great for a
+single page web application but its not the most flexible if we want to add navigation
+components or other pages later on. With this in mind we are going to make it a bit more
+flexible using views. Using views is also beneficial in helping keep our Vaadin frontend
+well organized.
+
+NOTE: For more information on views and navigation with Vaadin look
+https://vaadin.github.io/spring-tutorial/#_views_and_navigation_with_vaadin_spring[here].
+
+[source,groovy]
+.src/main/groovy/demo/DemoGrailsUI.groovy
+----
+include::../snippets/src/main/groovy/demo/DemoGrailsUI.groovy[]
+----
+
+<1> We add the `@Title` annotation to give our window / tab a nice name
+<2> Add `@SpringViewDisplay` so we can use views
+<3> Along with and `implements ViewDisplay` to our class
+<4> Next create an additional panel for our UI
+<5> Initial entry point into our Vaadin View
+<6> Helper method for building our header
+<7> Additional function required for using views; dynamically controls setting our view components
+
+TIP: The order in which you add components to the layout, can determin their position within the layout. 
+
+TIP: `init()` can get quite large quite fast so it is best to break out UI components
+into their own methods like `buildHeader()` to keep your files clear and concise.
+
diff --git a/guides/vaadin-grails/v4/guide/addingView.adoc b/guides/vaadin-grails/v4/guide/addingView.adoc
new file mode 100644
index 00000000000..87315a9d2e5
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/addingView.adoc
@@ -0,0 +1,68 @@
+Now to add the view which is the bulk of our Vaadin code. Create a new file located in
+`src/main/groovy/demo` called `GarageView.groovy`.
+
+Next make the necessary updates.
+
+[source,groovy]
+.src/main/groovy/demo/GarageView.groovy
+----
+include::../snippets/src/main/groovy/demo/GarageView.groovy[]
+----
+
+<1> Add `@SpringView` annotation and set the name so that your view can be found.
+<2> The view should extend the layout style that is desired
+<3> Set the actual view name
+<4> Services will not be injected automatically into Vaadin Views. You need to use `@Autowired` annotation in order to get dependency injection to work properly.
+<5> Tells the view `init()` to execute after the main UI `init()`
+<6> Loads Vehicles and its associations eagerly.
+
+
+The usage of eager loading in the `vehicleService.listAll(false)` warrants further explanation. 
+
+When a Vaadin component calls a Grails service, once the service method completes, the Hibernate session is closed which means that any associations not loaded by the query could lead to a `LazyInitializationException` due to the closed session.
+
+It is therefore critical that your queries always return the data that is required to render the view. This typically leads to better performing queries anyway and will in fact help you design a better performing application.
+
+
+
+WARNING: Grails auto dependency injection is not able to detect services in Vaadin,
+thus we require using the more traditional Spring annotation @Autowired in order
+to get dependency injection to work properly.
+
+Our view is trying to mimic the layout of much of modern web design by making use of "Rows"
+in our case we have 3 rows, a header, data collection, and data display (grid). As we develop
+a pattern start to emerge in Vaadin for views.
+
+- Create layout
+- Create UI component
+- Add UI component to layout
+- Add layout to view
+
+When adding layout to the view you can just use `addComponent()` as it is aware that it is
+adding to itself, unlike the top level UI where `root.addComponent()` is required.
+
+To keep a clean file continue building each UI component as its own private method.
+
+Once we have built our UI components now we need to be able to interact with them. To do this
+we add listeners to our components making use of groovy closures to specify what would happen
+when an event occurs. In our case we are `updateVehicle()` which we then `submit()`
+
+[source,groovy]
+.src/main/groovy/demo/GarageView.groovy
+----
+include::../snippets/src/main/groovy/demo/GarageView.groovy[indent=0, tag=listeners]
+----
+
+Using the listeners we build the vehicle object which is then submitted when the button is clicked.
+The last line of our submit method reloads our view to refresh the newly updated data.
+
+[source,groovy]
+.src/main/groovy/demo/GarageView.groovy
+----
+include::../snippets/src/main/groovy/demo/GarageView.groovy[indent=0, tag=navigateTo]
+----
+
+Now that everything is in place return to <<runningTheApp>> to run your app. If everything is as
+it should be you will see the following.
+
+image::runningGarageApp.png[]
\ No newline at end of file
diff --git a/guides/vaadin-grails/v4/guide/creatingTestData.adoc b/guides/vaadin-grails/v4/guide/creatingTestData.adoc
new file mode 100644
index 00000000000..fd2c7f3d055
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/creatingTestData.adoc
@@ -0,0 +1,7 @@
+Now that our domain is in place, lets preload some data to work with.
+
+[source,groovy]
+.grails-app/init/demo/BootStrap.groovy
+----
+include::../snippets/grails-app/init/demo/BootStrap.groovy[]
+----
\ No newline at end of file
diff --git a/guides/vaadin-grails/v4/guide/creatingTheControllers.adoc b/guides/vaadin-grails/v4/guide/creatingTheControllers.adoc
new file mode 100644
index 00000000000..0d03fd65b24
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/creatingTheControllers.adoc
@@ -0,0 +1,41 @@
+While completely unnecessary for Vaadin we want to demonstrate that there is no conflict
+between Grails controllers and the Vaadin Framework.
+
+[source,bash]
+----
+  $ grails create-controller demo.GarageController
+----
+
+Now let’s edit our controller under grails-app/controllers/demo/.
+We will import one of our services, update our index method, and add the following annotation.
+
+- `@GrailsCompileStatic` - Code that is marked with `GrailsCompileStatic` will all be statically compiled except for Grails specific interactions that cannot be statically compiled but that GrailsCompileStatic can identify as permissible for dynamic dispatch. These include things like invoking dynamic finders and DSL code in configuration blocks like constraints and mapping closures in domain classes.
+
+
+[source,groovy]
+./grails-app/controllers/demo/GarageController.groovy
+----
+include::../snippets/grails-app/controllers/demo/GarageController.groovy[]
+----
+
+<1> Declaring our service
+<2> `index()` calls our service and renders the output as JSON
+
+At this point lets make sure everything is working properly and run <<runningTheApp>>
+the application.
+
+Now we can exercise the API using cURL or another API tool.
+
+Make a GET request to /garage to get a list of Vehicles:
+
+[source,bash]
+----
+  $ curl -X "GET" "http://localhost:8080/garage"
+
+    [{"id":1,"driver":{"id":1},"make":{"id":1},"model":{"id":1},"name":"Pickup"},
+     {"id":2,"driver":{"id":1},"make":{"id":1},"model":{"id":2},"name":"Economy"},
+     {"id":3,"driver":{"id":2},"make":{"id":2},"model":{"id":3},"name":"Minivan"}]
+----
+
+If data comes back everything is setup and connected properly at this point and we have
+verified that we have some test data. Now lets look at how to attach Vaadin to Grails
\ No newline at end of file
diff --git a/guides/vaadin-grails/v4/guide/creatingTheDomain.adoc b/guides/vaadin-grails/v4/guide/creatingTheDomain.adoc
new file mode 100644
index 00000000000..8f5a4fd07e8
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/creatingTheDomain.adoc
@@ -0,0 +1,50 @@
+Lets start by creating our domain model for the application.
+
+[source,bash]
+----
+  $ grails create-domain-class demo.Driver
+  $ grails create-domain-class demo.Make
+  $ grails create-domain-class demo.Model
+  $ grails create-domain-class demo.User
+  $ grails create-domain-class demo.Vehicle
+----
+
+Now let’s edit our domain classes under grails-app/domain/demo/.
+We’ll add some properties and the three following annotations.
+
+- `@GrailsCompileStatic` - Code that is marked with `GrailsCompileStatic` will all be statically compiled except for Grails specific interactions that cannot be statically compiled but that GrailsCompileStatic can identify as permissible for dynamic dispatch. These include things like invoking dynamic finders and DSL code in configuration blocks like constraints and mapping closures in domain classes.
+- `@EqualsAndHashCode` - Auto generates equals and hashCode methods
+- `@ToString` - Auto generates toString method
+
+[source,groovy]
+./grails-app/domain/demo/Make.groovy
+----
+include::../snippets/grails-app/domain/demo/Make.groovy[]
+----
+
+[source,groovy]
+./grails-app/domain/demo/Model.groovy
+----
+include::../snippets/grails-app/domain/demo/Model.groovy[]
+----
+
+[source,groovy]
+./grails-app/domain/demo/Vehicle.groovy
+----
+include::../snippets/grails-app/domain/demo/Vehicle.groovy[]
+----
+
+There is a bit more to our `Driver.groovy` than meets the eye versus the first 3 classes. That's
+because we are actually extending our `User.groovy` class with driver. This will grant us
+some extra flexibility in the future as we grow our application.
+[source,groovy]
+./grails-app/domain/demo/Driver.groovy
+----
+include::../snippets/grails-app/domain/demo/Driver.groovy[]
+----
+
+[source,groovy]
+./grails-app/domain/demo/User.groovy
+----
+include::../snippets/grails-app/domain/demo/User.groovy[]
+----
\ No newline at end of file
diff --git a/guides/vaadin-grails/v4/guide/creatingTheServices.adoc b/guides/vaadin-grails/v4/guide/creatingTheServices.adoc
new file mode 100644
index 00000000000..171c25f365e
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/creatingTheServices.adoc
@@ -0,0 +1,41 @@
+Next lets create our service layer for our application so Grails and Vaadin can share
+resources.
+
+[source,bash]
+----
+  $ grails create-service demo.DriverService
+  $ grails create-service demo.MakeService
+  $ grails create-service demo.ModelService
+  $ grails create-service demo.VehicleService
+----
+
+Now let’s edit our service classes under grails-app/services/demo/.
+We’ll add a `listAll()` method to all of the classes. This method will have the following additional annotation.
+
+- `@ReadOnly` - good practice to have on methods that only return data
+
+[source,groovy]
+./grails-app/services/demo/DriverService.groovy
+----
+include::../snippets/grails-app/services/demo/DriverService.groovy[]
+----
+
+[source,groovy]
+./grails-app/services/demo/MakeService.groovy
+----
+include::../snippets/grails-app/services/demo/MakeService.groovy[]
+----
+
+[source,groovy]
+./grails-app/services/demo/ModelService.groovy
+----
+include::../snippets/grails-app/services/demo/ModelService.groovy[]
+----
+
+Our `VehicleService.groovy` has an additional `save()` method so that we can add new data to our application.
+
+[source,groovy]
+./grails-app/services/demo/VehicleService.groovy
+----
+include::../snippets/grails-app/services/demo/VehicleService.groovy[]
+----
\ No newline at end of file
diff --git a/guides/vaadin-grails/v4/guide/gettingStarted.adoc b/guides/vaadin-grails/v4/guide/gettingStarted.adoc
new file mode 100644
index 00000000000..274b8d17bd2
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/gettingStarted.adoc
@@ -0,0 +1 @@
+In this guide you are going to build a Grails 3 application with the Vaadin 8 Framework.
diff --git a/guides/vaadin-grails/v4/guide/helpWithGrails.adoc b/guides/vaadin-grails/v4/guide/helpWithGrails.adoc
new file mode 100644
index 00000000000..e062f614b1a
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/helpWithGrails.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-helpWithGrails.adoc[]
diff --git a/guides/vaadin-grails/v4/guide/howto.adoc b/guides/vaadin-grails/v4/guide/howto.adoc
new file mode 100644
index 00000000000..4499ccc603d
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/howto.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-howto.adoc[]
diff --git a/guides/vaadin-grails/v4/guide/knownIssues.adoc b/guides/vaadin-grails/v4/guide/knownIssues.adoc
new file mode 100644
index 00000000000..0076a49da70
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/knownIssues.adoc
@@ -0,0 +1,2 @@
+- https://github.com/macprzepiora/web-vaadin8/issues/3[Bug with multi-word package names]
+- https://github.com/grails-guides/vaadin-grails/issues/1[Issue with Grails 3.3.0 and Spring Boot 1.5]
diff --git a/guides/vaadin-grails/v4/guide/nextSteps.adoc b/guides/vaadin-grails/v4/guide/nextSteps.adoc
new file mode 100644
index 00000000000..75e40e9a8da
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/nextSteps.adoc
@@ -0,0 +1,9 @@
+There’s plenty of opportunities to expand the scope of this application. Here are a few ideas for improvements you can make on your own:
+
+- Create a modal dialog form to add new `Driver`, `Makes` & `Models` instances. Use Vaadin's https://vaadin.com/docs/-/part/framework/layout/layout-sub-window.html[Sub-Windows] to give you a head start.
+
+- Add support for updates to existing `Vehicle` instances. A modal dialog might work well for this as well, or perhaps an editable table row
+
+- Currently `Make` & `Model` domain classes are not related to each other. Adding an association between them, will allow us to display Models for the currently selected `Make` in the dropdowns. You will want to make use of the JavaScript Array.filter method.
+
+- Currently, views contain direct references to services. Although it's completely fine for a demo or a small application, things will tend to get out of hand when our codebase grows. Patterns such as Model-View-Presenter (MVP) may help to keep an organized codebase. You can read more about patterns and Vaadin in https://vaadin.com/docs/-/part/framework/advanced/advanced-architecture.html[the Book of Vaadin]
diff --git a/guides/vaadin-grails/v4/guide/profile.adoc b/guides/vaadin-grails/v4/guide/profile.adoc
new file mode 100644
index 00000000000..f846d17ad7a
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/profile.adoc
@@ -0,0 +1,10 @@
+The `initial` directory of this project was created with the command
+
+[source,bash]
+----
+grails create-app demo --profile me.przepiora.vaadin-grails:web-vaadin8:0.3
+----
+
+We supply to the `create-app` command the https://github.com/macprzepiora/web-vaadin8[Vaadin 8 Grails 3 Profile]'s coordinates.
+
+With the use of http://docs.grails.org/latest/guide/single.html#profiles[application profiles], Grails allows you to build modern web applications. There are profiles to facilitate the construction of REST APIs or Web applications with a Javascript front-end (Angular, REACT) or Vaadin apps. 
\ No newline at end of file
diff --git a/guides/vaadin-grails/v4/guide/requirements.adoc b/guides/vaadin-grails/v4/guide/requirements.adoc
new file mode 100644
index 00000000000..d8bafe0fa05
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/requirements.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-requirements.adoc[]
\ No newline at end of file
diff --git a/guides/vaadin-grails/v4/guide/runningTheApp.adoc b/guides/vaadin-grails/v4/guide/runningTheApp.adoc
new file mode 100644
index 00000000000..53399a93131
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/runningTheApp.adoc
@@ -0,0 +1,26 @@
+//include::{commondir}/common-runapp.adoc[]
+
+At this point a test run is suggested just to make sure everything is functioning properly.
+
+To run the application first
+
+[source,bash]
+----
+$ cd initial/
+----
+
+To launch the application, run the following command.
+
+[source,bash]
+----
+$ ./gradlew bootRun
+----
+
+If everything is good to go this will start up the Grails application,
+which will be running on `http://localhost:8080`
+
+image::grailsDefault.png[]
+
+To see Vaadin in action navigate to `http://localhost:8080/vaadinUI` instead.
+
+image::vaadinDefault.png[]
\ No newline at end of file
diff --git a/guides/vaadin-grails/v4/guide/themingTheApp.adoc b/guides/vaadin-grails/v4/guide/themingTheApp.adoc
new file mode 100644
index 00000000000..b5426b7468f
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/themingTheApp.adoc
@@ -0,0 +1,38 @@
+Lastly a word on theming in Vaadin. Vaadin themes are located `src/main/webapp` directory and
+are placed inside the `VAADIN/themes` directory.
+
+WARNING: `VAADIN/themes` is a fixed location. If your theme files are not placed here they will not be
+available.
+
+If using our app or if you generated your own using the profile, the vaadin profile will create a new theme for you
+called vaadin-grails-theme. You can see that we are using this theme in our `DemoGrailsUI.groovy`
+
+[source,groovy]
+.src/main/groovy/demo/DemoGrailsUI.groovy
+----
+include::../snippets/src/main/groovy/demo/DemoGrailsUI.groovy[indent=0,lines="23..23"]
+----
+
+Vaadin themes are SASS based and have multiple ways in which they can be compiled. Since Vaadin themes
+have more flexibility than standard css,
+Vaadin themes require that a `styles.scss exist in the theme folder as it is the glue that pulls
+the different parts of the theme together.
+
+[source, css]
+./src/main/webapp/VAADIN/themes/vaadin-grails-theme/styles.scss
+----
+include::../snippets/src/main/webapp/VAADIN/themes/vaadin-grails-theme/styles.scss[]
+----
+
+To add custom styles then we look to add them in `vaadin-grails-theme.scss`
+
+[source,css]
+./src/main/webapp/VAADIN/themes/vaadin-grails-theme/vaadin-grails-theme.scss
+----
+include::../snippets/src/main/webapp/VAADIN/themes/vaadin-grails-theme/vaadin-grails-theme.scss[indent=0,lines="32..38"]
+----
+
+Add your rules under `Insert your own theme rules here`.
+For more details on how Vaadin handles theming look https://vaadin.com/docs/-/part/framework/themes/themes-overview.html[here].
+Vaadin gives a good overview of how they handle SASS compilation as well as how to build your
+own themes.
\ No newline at end of file
diff --git a/guides/vaadin-grails/v4/guide/training.adoc b/guides/vaadin-grails/v4/guide/training.adoc
new file mode 100644
index 00000000000..11b7772a2c8
--- /dev/null
+++ b/guides/vaadin-grails/v4/guide/training.adoc
@@ -0,0 +1 @@
+include::{commondir}/common-training.adoc[]
diff --git a/guides/vaadin-grails/v4/guide/writingTheApp.adoc b/guides/vaadin-grails/v4/guide/writingTheApp.adoc
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/guides/vaadin-grails/v4/manifest.yml b/guides/vaadin-grails/v4/manifest.yml
new file mode 100644
index 00000000000..7394e37d9bc
--- /dev/null
+++ b/guides/vaadin-grails/v4/manifest.yml
@@ -0,0 +1,17 @@
+# Generated by :vendorGuide
+name: vaadin-grails
+version: '4'
+title: Build a Grails 3 application with the Vaadin 8 Framework
+subtitle: Learn how to build a Grails 3 application with the Vaadin 8 Framework
+authors:
+- Ben Rhine
+category: Grails + RIA (Rich Internet Application)
+tags:
+- vaadin
+- frontend
+- framework
+publicationDate: '2017-07-24'
+githubSlug: grails-guides/vaadin-grails
+githubBranch: master
+githubSha: a239a804e6b9811247a3a8290c7c779e096b5eb9
+sourceCommitDate: '2026-05-01T08:44:13-04:00'
diff --git a/guides/vaadin-grails/v4/snippets/MANIFEST.yml b/guides/vaadin-grails/v4/snippets/MANIFEST.yml
new file mode 100644
index 00000000000..9df2c3885b1
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/MANIFEST.yml
@@ -0,0 +1,37 @@
+# Generated by :vendorGuide
+source:
+  repo: grails-guides/vaadin-grails
+  branch: master
+  sha: a239a804e6b9811247a3a8290c7c779e096b5eb9
+  capturedAt: '2026-05-01'
+entries:
+- vendoredPath: src/main/groovy/demo/DemoGrailsUI.groovy
+  upstreamPath: complete/src/main/groovy/demo/DemoGrailsUI.groovy
+- vendoredPath: src/main/groovy/demo/GarageView.groovy
+  upstreamPath: complete/src/main/groovy/demo/GarageView.groovy
+- vendoredPath: grails-app/init/demo/BootStrap.groovy
+  upstreamPath: complete/grails-app/init/demo/BootStrap.groovy
+- vendoredPath: grails-app/controllers/demo/GarageController.groovy
+  upstreamPath: complete/grails-app/controllers/demo/GarageController.groovy
+- vendoredPath: grails-app/domain/demo/Make.groovy
+  upstreamPath: complete/grails-app/domain/demo/Make.groovy
+- vendoredPath: grails-app/domain/demo/Model.groovy
+  upstreamPath: complete/grails-app/domain/demo/Model.groovy
+- vendoredPath: grails-app/domain/demo/Vehicle.groovy
+  upstreamPath: complete/grails-app/domain/demo/Vehicle.groovy
+- vendoredPath: grails-app/domain/demo/Driver.groovy
+  upstreamPath: complete/grails-app/domain/demo/Driver.groovy
+- vendoredPath: grails-app/domain/demo/User.groovy
+  upstreamPath: complete/grails-app/domain/demo/User.groovy
+- vendoredPath: grails-app/services/demo/DriverService.groovy
+  upstreamPath: complete/grails-app/services/demo/DriverService.groovy
+- vendoredPath: grails-app/services/demo/MakeService.groovy
+  upstreamPath: complete/grails-app/services/demo/MakeService.groovy
+- vendoredPath: grails-app/services/demo/ModelService.groovy
+  upstreamPath: complete/grails-app/services/demo/ModelService.groovy
+- vendoredPath: grails-app/services/demo/VehicleService.groovy
+  upstreamPath: complete/grails-app/services/demo/VehicleService.groovy
+- vendoredPath: src/main/webapp/VAADIN/themes/vaadin-grails-theme/styles.scss
+  upstreamPath: complete/src/main/webapp/VAADIN/themes/vaadin-grails-theme/styles.scss
+- vendoredPath: src/main/webapp/VAADIN/themes/vaadin-grails-theme/vaadin-grails-theme.scss
+  upstreamPath: complete/src/main/webapp/VAADIN/themes/vaadin-grails-theme/vaadin-grails-theme.scss
diff --git a/guides/vaadin-grails/v4/snippets/grails-app/controllers/demo/GarageController.groovy b/guides/vaadin-grails/v4/snippets/grails-app/controllers/demo/GarageController.groovy
new file mode 100644
index 00000000000..6d78d7e535d
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/grails-app/controllers/demo/GarageController.groovy
@@ -0,0 +1,16 @@
+package demo
+
+import grails.converters.JSON
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class GarageController {
+
+    VehicleService vehicleService //<1>
+
+    def index() { //<2>
+        final List<Vehicle> vehicleList = vehicleService.listAll()
+
+        render vehicleList as JSON
+    }
+}
diff --git a/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/Driver.groovy b/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/Driver.groovy
new file mode 100644
index 00000000000..370b7cdd55d
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/Driver.groovy
@@ -0,0 +1,19 @@
+package demo
+
+import grails.compiler.GrailsCompileStatic
+import groovy.transform.EqualsAndHashCode
+import groovy.transform.ToString
+
+@GrailsCompileStatic
+@EqualsAndHashCode(includes=['name'])
+@ToString(includes=['name'], includeNames=true, includePackage=false)
+class Driver extends User {
+
+    String name
+
+    static hasMany = [ vehicles: Vehicle ]
+
+    static constraints = {
+        vehicles nullable: true
+    }
+}
diff --git a/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/Make.groovy b/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/Make.groovy
new file mode 100644
index 00000000000..01f96b4c7c2
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/Make.groovy
@@ -0,0 +1,17 @@
+package demo
+
+import grails.compiler.GrailsCompileStatic
+import groovy.transform.EqualsAndHashCode
+import groovy.transform.ToString
+
+@GrailsCompileStatic
+@EqualsAndHashCode(includes=['name'])
+@ToString(includes=['name'], includeNames=true, includePackage=false)
+class Make {
+
+    String name
+
+    static constraints = {
+    	name nullable: false
+    }
+}
diff --git a/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/Model.groovy b/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/Model.groovy
new file mode 100644
index 00000000000..46dad653e84
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/Model.groovy
@@ -0,0 +1,17 @@
+package demo
+
+import grails.compiler.GrailsCompileStatic
+import groovy.transform.EqualsAndHashCode
+import groovy.transform.ToString
+
+@GrailsCompileStatic
+@EqualsAndHashCode(includes=['name'])
+@ToString(includes=['name'], includeNames=true, includePackage=false)
+class Model {
+
+    String name
+
+    static constraints = {
+    	name nullable: false
+    }
+}
diff --git a/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/User.groovy b/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/User.groovy
new file mode 100644
index 00000000000..8b3dbe86b59
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/User.groovy
@@ -0,0 +1,28 @@
+package demo
+
+import groovy.transform.EqualsAndHashCode
+import groovy.transform.ToString
+import grails.compiler.GrailsCompileStatic
+
+@GrailsCompileStatic
+@EqualsAndHashCode(includes='username')
+@ToString(includes='username', includeNames=true, includePackage=false)
+class User implements Serializable {
+    private static final long serialVersionUID = 1
+
+    String username
+    String password
+    boolean enabled = true
+    boolean accountExpired
+    boolean accountLocked
+    boolean passwordExpired
+
+    static constraints = {
+        password nullable: false, blank: false, password: true
+        username nullable: false, blank: false, unique: true
+    }
+
+    static mapping = {
+        password column: '`password`'
+    }
+}
diff --git a/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/Vehicle.groovy b/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/Vehicle.groovy
new file mode 100644
index 00000000000..011e8fa7842
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/grails-app/domain/demo/Vehicle.groovy
@@ -0,0 +1,23 @@
+package demo
+
+import grails.compiler.GrailsCompileStatic
+import groovy.transform.EqualsAndHashCode
+import groovy.transform.ToString
+
+@GrailsCompileStatic
+@EqualsAndHashCode(includes=['name', 'make', 'model'])
+@ToString(includes=['name', 'make', 'model'], includeNames=true, includePackage=false)
+class Vehicle {
+    String name
+    Make make
+    Model model
+
+    static belongsTo = [driver: Driver]
+
+    static mapping = {
+        name nullable: false
+    }
+
+    static constraints = {
+    }
+}
diff --git a/guides/vaadin-grails/v4/snippets/grails-app/init/demo/BootStrap.groovy b/guides/vaadin-grails/v4/snippets/grails-app/init/demo/BootStrap.groovy
new file mode 100644
index 00000000000..fae97628668
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/grails-app/init/demo/BootStrap.groovy
@@ -0,0 +1,26 @@
+package demo
+
+import groovy.util.logging.Slf4j
+
+@Slf4j
+class BootStrap {
+
+    def init = { servletContext ->
+        log.info "Loading database..."
+        final driver1 = new Driver(name: "Susan", username: "susan", password: "password1").save()
+        final driver2 = new Driver(name: "Pedro", username:  "pedro", password: "password2").save()
+
+        final nissan = new Make(name: "Nissan").save()
+        final ford = new Make(name: "Ford").save()
+
+        final titan = new Model(name: "Titan").save()
+        final leaf = new Model(name: "Leaf").save()
+        final windstar = new Model(name: "Windstar").save()
+
+        new Vehicle(name: "Pickup", driver: driver1, make: nissan, model: titan).save()
+        new Vehicle(name: "Economy", driver: driver1, make: nissan, model: leaf).save()
+        new Vehicle(name: "Minivan", driver: driver2, make: ford, model: windstar).save()
+    }
+    def destroy = {
+    }
+}
diff --git a/guides/vaadin-grails/v4/snippets/grails-app/services/demo/DriverService.groovy b/guides/vaadin-grails/v4/snippets/grails-app/services/demo/DriverService.groovy
new file mode 100644
index 00000000000..49b7d99a3f6
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/grails-app/services/demo/DriverService.groovy
@@ -0,0 +1,14 @@
+package demo
+
+import grails.gorm.transactions.ReadOnly
+import groovy.transform.CompileStatic
+
+@CompileStatic
+@ReadOnly
+class DriverService {
+
+    @ReadOnly
+    List<Driver> listAll() {
+        Driver.where { }.list()
+    }
+}
diff --git a/guides/vaadin-grails/v4/snippets/grails-app/services/demo/MakeService.groovy b/guides/vaadin-grails/v4/snippets/grails-app/services/demo/MakeService.groovy
new file mode 100644
index 00000000000..37ec7eb461d
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/grails-app/services/demo/MakeService.groovy
@@ -0,0 +1,13 @@
+package demo
+
+import grails.gorm.transactions.ReadOnly
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class MakeService {
+
+    @ReadOnly
+    List<Make> listAll() {
+        Make.where { }.list()
+    }
+}
diff --git a/guides/vaadin-grails/v4/snippets/grails-app/services/demo/ModelService.groovy b/guides/vaadin-grails/v4/snippets/grails-app/services/demo/ModelService.groovy
new file mode 100644
index 00000000000..14739c54ea5
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/grails-app/services/demo/ModelService.groovy
@@ -0,0 +1,13 @@
+package demo
+
+import grails.gorm.transactions.ReadOnly
+import groovy.transform.CompileStatic
+
+@CompileStatic
+class ModelService {
+
+    @ReadOnly
+    List<Model> listAll() {
+        Model.where { }.list()
+    }
+}
diff --git a/guides/vaadin-grails/v4/snippets/grails-app/services/demo/VehicleService.groovy b/guides/vaadin-grails/v4/snippets/grails-app/services/demo/VehicleService.groovy
new file mode 100644
index 00000000000..a8d5634b8e8
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/grails-app/services/demo/VehicleService.groovy
@@ -0,0 +1,25 @@
+package demo
+
+import grails.gorm.transactions.ReadOnly
+import groovy.transform.CompileStatic
+
+@CompileStatic
+@ReadOnly
+class VehicleService {
+
+    def save(final Vehicle vehicle) {
+        vehicle.save(failOnError: true)
+    }
+
+    @ReadOnly
+    List<Vehicle> listAll(boolean lazyFetch = true) {
+        if ( !lazyFetch ) {
+            return Vehicle.where {}
+                    .join('make')
+                    .join('model')
+                    .join('driver')
+                    .list()
+        }
+        Vehicle.where { }.list()
+    }
+}
diff --git a/guides/vaadin-grails/v4/snippets/src/main/groovy/demo/DemoGrailsUI.groovy b/guides/vaadin-grails/v4/snippets/src/main/groovy/demo/DemoGrailsUI.groovy
new file mode 100644
index 00000000000..bac34209626
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/src/main/groovy/demo/DemoGrailsUI.groovy
@@ -0,0 +1,47 @@
+package demo
+
+import com.vaadin.annotations.Title
+import com.vaadin.navigator.View
+import com.vaadin.navigator.ViewDisplay
+import com.vaadin.server.VaadinRequest
+import com.vaadin.annotations.Theme
+import com.vaadin.spring.annotation.SpringUI
+import com.vaadin.spring.annotation.SpringViewDisplay
+import com.vaadin.ui.Component
+import com.vaadin.ui.Label
+import com.vaadin.ui.Panel
+import com.vaadin.ui.UI
+import com.vaadin.ui.VerticalLayout
+import groovy.transform.CompileStatic
+
+@CompileStatic
+@SpringUI(path="/vaadinUI")
+@Title("Vaadin Grails") //<1>
+@SpringViewDisplay //<2>
+class DemoGrailsUI extends UI implements ViewDisplay { //<3>
+    private Panel springViewDisplay //<4>
+
+    /** Where a line is matters, it can change the position of an element. */
+    @Override
+    protected void init(VaadinRequest request) { //<5>
+        final VerticalLayout root = new VerticalLayout()
+        root.setSizeFull()
+        setContent(root)
+        springViewDisplay = new Panel()
+        springViewDisplay.setSizeFull()
+
+        root.addComponent(buildHeader())
+        root.addComponent(springViewDisplay)
+        root.setExpandRatio(springViewDisplay, 1.0f)
+    }
+
+    static private Label buildHeader() { //<6>
+        final Label mainTitle = new Label("Welcome to the Garage")
+        mainTitle
+    }
+
+    @Override
+    void showView(final View view) { //<7>
+        springViewDisplay.setContent((Component) view)
+    }
+}
diff --git a/guides/vaadin-grails/v4/snippets/src/main/groovy/demo/GarageView.groovy b/guides/vaadin-grails/v4/snippets/src/main/groovy/demo/GarageView.groovy
new file mode 100644
index 00000000000..2a7190509b2
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/src/main/groovy/demo/GarageView.groovy
@@ -0,0 +1,278 @@
+package demo
+
+import com.vaadin.data.HasValue
+import com.vaadin.data.ValueProvider
+import com.vaadin.event.selection.SelectionEvent
+import com.vaadin.event.selection.SelectionListener
+import com.vaadin.event.selection.SingleSelectionEvent
+import com.vaadin.event.selection.SingleSelectionListener
+import com.vaadin.navigator.View
+import com.vaadin.navigator.ViewChangeListener
+import com.vaadin.spring.annotation.SpringView
+import com.vaadin.ui.Button
+import com.vaadin.ui.ComboBox
+import com.vaadin.ui.Grid
+import com.vaadin.ui.HorizontalLayout
+import com.vaadin.ui.ItemCaptionGenerator
+import com.vaadin.ui.Label
+import com.vaadin.ui.TextField
+import com.vaadin.ui.VerticalLayout
+import groovy.util.logging.Slf4j
+import org.springframework.beans.factory.annotation.Autowired
+import javax.annotation.PostConstruct
+import groovy.transform.CompileStatic
+
+@Slf4j
+@CompileStatic
+@SpringView(name = GarageView.VIEW_NAME) //<1>
+class GarageView extends VerticalLayout implements View { //<2>
+    public static final String VIEW_NAME = "" //<3>
+    
+    @Autowired  // <4>
+    private DriverService driverService
+    
+    @Autowired 
+    private MakeService makeService
+    
+    @Autowired 
+
+    private ModelService modelService
+    
+    @Autowired 
+    private VehicleService vehicleService
+
+    private Vehicle vehicle = new Vehicle()
+
+    @PostConstruct //<5>
+    void init() {
+        /** Display Row One: (Add panel title) */
+        final HorizontalLayout titleRow = new HorizontalLayout()
+        titleRow.setWidth("100%")
+        addComponent(titleRow)
+
+        final Label title = new Label("Add a Vehicle:")
+        titleRow.addComponent(title)
+        titleRow.setExpandRatio(title, 1.0f) // Expand
+
+        /** Display Row Two: (Build data input) */
+        final HorizontalLayout inputRow = new HorizontalLayout()
+        inputRow.setWidth("100%")
+        addComponent(inputRow)
+
+        // Build data input constructs
+        final TextField vehicleName = this.buildNewVehicleName()
+        final ComboBox<Make> vehicleMake = this.buildMakeComponent()
+        final ComboBox<Model> vehicleModel = this.buildModelComponent()
+        final ComboBox<Driver> vehicleDriver = this.buildDriverComponent()
+        final Button submitBtn = this.buildSubmitButton()
+
+        // Add listeners to capture data change
+        //tag::listeners[]
+        vehicleName.addValueChangeListener(new UpdateVehicleValueChangeListener('NAME'))
+        vehicleMake.addSelectionListener(new UpdateVehicleComboBoxSelectionLister('MAKE'))
+        vehicleModel.addSelectionListener(new UpdateVehicleComboBoxSelectionLister('MODEL'))
+        vehicleDriver.addSelectionListener(new UpdateVehicleComboBoxSelectionLister('DRIVER'))
+        submitBtn.addClickListener { event -> 
+            this.submit()
+        }
+        //end::listeners[]
+
+        // Add data constructs to row
+        [vehicleName, vehicleMake, vehicleModel, vehicleDriver, submitBtn].each {
+            inputRow.addComponent(it)
+        }
+
+        /** Display Row Three: (Display all vehicles in database) */
+        final HorizontalLayout dataDisplayRow = new HorizontalLayout()
+        dataDisplayRow.setWidth("100%")
+        addComponent(dataDisplayRow)
+        dataDisplayRow.addComponent(this.buildVehicleComponent())
+    }
+
+    class UpdateVehicleValueChangeListener implements HasValue.ValueChangeListener {
+        String eventType
+
+        UpdateVehicleValueChangeListener(String eventType) {
+            this.eventType = eventType
+        }
+
+        @Override
+        void valueChange(HasValue.ValueChangeEvent event) {
+            updateVehicle(eventType, event.value)
+        }
+    }
+    class UpdateVehicleComboBoxSelectionLister implements SingleSelectionListener {
+        String eventType
+
+        UpdateVehicleComboBoxSelectionLister(String eventType) {
+            this.eventType = eventType
+        }
+
+        @Override
+        void selectionChange(SingleSelectionEvent event) {
+            updateVehicle(eventType, event.firstSelectedItem)
+        }
+    }
+
+    @Override
+    void enter(ViewChangeListener.ViewChangeEvent event) {
+        // This view is constructed in the init() method()
+    }
+
+    /** Private UI component builders ------------------------------------------------------------------------------- */
+    static private TextField buildNewVehicleName() {
+        final TextField vehicleName = new TextField()
+        vehicleName.setPlaceholder("Enter a name...")
+
+        vehicleName
+    }
+
+    private ComboBox<Make> buildMakeComponent() {
+        final List<Make> makes = makeService.listAll()
+
+        final ComboBox<Make> select = new ComboBox<>()
+        select.setEmptySelectionAllowed(false)
+        select.setPlaceholder("Select a Make")
+        select.setItemCaptionGenerator(new CustomItemCaptionGenerator())
+        select.setItems(makes)
+
+        select
+    }
+
+    class CustomItemCaptionGenerator implements ItemCaptionGenerator {
+
+        @Override
+        String apply(Object item) {
+            if (item instanceof Make ) {
+                return (item as Make).name
+            }
+            if ( item instanceof Driver ) {
+                return (item as Driver).name
+            }
+            if ( item instanceof Model ) {
+                return (item as Model).name
+            }
+            null
+        }
+    }
+
+    private ComboBox<Model> buildModelComponent() {
+        final List<Model> models = modelService.listAll()
+
+        final ComboBox<Model> select = new ComboBox<>()
+        select.setEmptySelectionAllowed(false)
+        select.setPlaceholder("Select a Model")
+        select.setItemCaptionGenerator(new CustomItemCaptionGenerator())
+        select.setItems(models)
+
+        select
+    }
+
+    private ComboBox<Driver> buildDriverComponent() {
+        final List<Driver> drivers = driverService.listAll()
+
+        final ComboBox<Driver> select = new ComboBox<>()
+        select.setEmptySelectionAllowed(false)
+        select.setPlaceholder("Select a Driver")
+        select.setItemCaptionGenerator(new CustomItemCaptionGenerator())
+        select.setItems(drivers)
+
+        select
+    }
+
+    private Grid buildVehicleComponent() {
+        final List<Vehicle> vehicles = vehicleService.listAll(false) // <6>
+        final Grid grid = new Grid<>()
+        grid.setSizeFull()  // ensures grid fills width
+        grid.setItems(vehicles)
+        grid.addColumn(new VehicleValueProvider('id')).setCaption("ID")
+        grid.addColumn(new VehicleValueProvider('name')).setCaption("Name")
+        grid.addColumn(new VehicleValueProvider('make.name')).setCaption("Make")
+        grid.addColumn(new VehicleValueProvider('model.name')).setCaption("Model")
+        grid.addColumn(new VehicleValueProvider('driver.name')).setCaption("Name")
+
+        grid
+    }
+
+    class VehicleValueProvider implements ValueProvider {
+        String propertyName
+
+        VehicleValueProvider(String propertyName) {
+            this.propertyName = propertyName
+        }
+
+        @Override
+        Object apply(Object o) {
+            switch (propertyName) {
+                case 'id':
+                    if ( o instanceof Vehicle) {
+                        return (o as Vehicle).id
+                    }
+                    break
+                case 'name':
+                    if ( o instanceof Vehicle) {
+                        return (o as Vehicle).name
+                    }
+                    break
+                case 'model.name':
+                    if ( o instanceof Vehicle) {
+                        return (o as Vehicle).model.name
+                    }
+                    break
+                case 'make.name':
+                    if ( o instanceof Vehicle) {
+                        return (o as Vehicle).make.name
+                    }
+                    break
+                case 'driver.name':
+                    if ( o instanceof Vehicle) {
+                        return (o as Vehicle).driver.name
+                    }
+                    break
+
+            }
+            null
+        }
+    }
+
+    static private Button buildSubmitButton() {
+        final Button submitBtn = new Button("Add to Garage")
+        submitBtn.setStyleName("friendly")
+
+        submitBtn
+    }
+
+    private updateVehicle(final String eventType, final eventValue) {
+        switch (eventType) {
+            case 'NAME':
+                if ( eventValue instanceof String ) {
+                    this.vehicle.name = eventValue as String
+                }
+                break
+            case 'MAKE':
+                if ( eventValue instanceof Optional<Make> ) {
+                    this.vehicle.make = (eventValue as Optional<Make>).get()
+                }
+                break
+            case 'MODEL':
+                if ( eventValue instanceof Optional<Model> ) {
+                    this.vehicle.model = (eventValue as Optional<Model>).get()
+                }
+                break
+            case 'DRIVER':
+                if ( eventValue instanceof Optional<Driver> ) {
+                    this.vehicle.driver = (eventValue as Optional<Driver>).get()
+                }
+                break
+            default:
+                log.error 'updateVehicle invoked with wrong eventType: {}', eventType
+        }
+    }
+
+    private submit() {
+        vehicleService.save(this.vehicle)
+        // tag::navigateTo[]
+        getUI().getNavigator().navigateTo(VIEW_NAME)
+        // end::navigateTo[]
+    }
+}
\ No newline at end of file
diff --git a/guides/vaadin-grails/v4/snippets/src/main/webapp/VAADIN/themes/vaadin-grails-theme/styles.scss b/guides/vaadin-grails/v4/snippets/src/main/webapp/VAADIN/themes/vaadin-grails-theme/styles.scss
new file mode 100644
index 00000000000..c7f508bc5e9
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/src/main/webapp/VAADIN/themes/vaadin-grails-theme/styles.scss
@@ -0,0 +1,11 @@
+@import "vaadin-grails-theme.scss";
+@import "addons.scss";
+
+// This file prefixes all rules with the theme name to avoid causing conflicts with other themes.
+// The actual styles should be defined in vaadin-grails-theme.scss
+
+.vaadin-grails-theme {
+  @include addons;
+  @include vaadin-grails-theme;
+
+}
diff --git a/guides/vaadin-grails/v4/snippets/src/main/webapp/VAADIN/themes/vaadin-grails-theme/vaadin-grails-theme.scss b/guides/vaadin-grails/v4/snippets/src/main/webapp/VAADIN/themes/vaadin-grails-theme/vaadin-grails-theme.scss
new file mode 100644
index 00000000000..9835aa0e370
--- /dev/null
+++ b/guides/vaadin-grails/v4/snippets/src/main/webapp/VAADIN/themes/vaadin-grails-theme/vaadin-grails-theme.scss
@@ -0,0 +1,40 @@
+// If you edit this file you need to compile the theme. See README.md for details.
+
+// Global variable overrides. Must be declared before importing Valo.
+
+// Defines the plaintext font size, weight and family. Font size affects general component sizing.
+//$v-font-size: 16px;
+//$v-font-weight: 300;
+//$v-font-family: "Open Sans", sans-serif;
+
+// Defines the border used by all components.
+//$v-border: 1px solid (v-shade 0.7);
+//$v-border-radius: 4px;
+
+// Affects the color of some component elements, e.g Button, Panel title, etc
+//$v-background-color: hsl(210, 0%, 98%);
+// Affects the color of content areas, e.g  Panel and Window content, TextField input etc
+//$v-app-background-color: $v-background-color;
+
+// Affects the visual appearance of all components
+//$v-gradient: v-linear 8%;
+//$v-bevel-depth: 30%;
+//$v-shadow-opacity: 5%;
+
+// Defines colors for indicating status (focus, success, failure)
+//$v-focus-color: valo-focus-color(); // Calculates a suitable color automatically
+//$v-friendly-color: #2c9720;
+//$v-error-indicator-color: #ed473b;
+
+// For more information, see: https://vaadin.com/book/-/page/themes.valo.html
+// Example variants can be copy/pasted from https://vaadin.com/wiki/-/wiki/Main/Valo+Examples
+
+//tag::customCss[]
+@import "../valo/valo.scss";
+
+@mixin vaadin-grails-theme {
+  @include valo;
+
+  // Insert your own theme rules here
+}
+//end::customCss[]
diff --git a/guides/vaadin-grails/v4/toc.yml b/guides/vaadin-grails/v4/toc.yml
new file mode 100644
index 00000000000..a4b7268d4bf
--- /dev/null
+++ b/guides/vaadin-grails/v4/toc.yml
@@ -0,0 +1,23 @@
+training:
+  title: Grails Training
+gettingStarted:
+  title: Getting Started
+  requirements: What you will need
+  howto: How to complete the guide
+  profile: Vaadin 8 Grails 3 Profile 
+aboutVaadin:
+  title: About Vaadin
+runningTheApp:
+  title: Running the Application
+writingTheApp:
+  title: Writing the Application
+  creatingTheDomain: Creating the domain
+  creatingTestData: Bootstrap Data
+  creatingTheServices: Creating the service layer
+  creatingTheControllers: Creating a controller
+  addingToVaadin: Vaadin
+  addingView: Adding your view
+nextSteps:
+  title: Next Steps
+helpWithGrails:
+  title: Do you need help with Grails?