This is an automated email from the ASF dual-hosted git repository. sbglasius pushed a commit to branch chore/gsp_and_gson_dependencies_and_apply in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 768fb04767430990788600f4b5689a14bdff739b Author: Søren Berg Glasius <[email protected]> AuthorDate: Tue Nov 11 16:41:54 2025 +0100 [chore] Correct docs with apply and dependencies for gsp and gson --- .../src/en/guide/theWebLayer/gson/jsonInstallation.adoc | 17 +++++++++++------ grails-doc/src/en/guide/theWebLayer/gsp.adoc | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/grails-doc/src/en/guide/theWebLayer/gson/jsonInstallation.adoc b/grails-doc/src/en/guide/theWebLayer/gson/jsonInstallation.adoc index 2cdca365a0..95b17914bb 100644 --- a/grails-doc/src/en/guide/theWebLayer/gson/jsonInstallation.adoc +++ b/grails-doc/src/en/guide/theWebLayer/gson/jsonInstallation.adoc @@ -17,10 +17,15 @@ specific language governing permissions and limitations under the License. //// -To activate JSON views, add the following dependency to the `dependencies` block of your `build.gradle`: +To activate JSON views, add the following dependency to the `dependencies` block of your `build.gradle`, if you use the Grails BOM: + +[source,groovy] +implementation "org.apache.grails:grails-views-gson" + +otherwise add version information [source,groovy,subs="attributes"] -compile "org.apache.grails:grails-views-gson:{version}" +implementation "org.apache.grails:grails-views-gson:{version}" To enable Gradle compilation of JSON views for production environment add the following to the `buildscript` `dependencies` block: @@ -29,16 +34,16 @@ buildscript { ... dependencies { ... - classpath "org.apache.grails:grails-gradle-bom:{version}" + classpath platform("org.apache.grails:grails-gradle-bom:{version}") classpath "org.apache.grails:grails-gradle-plugins" } } -Then apply the `org.apache.grails.grails-views-gson` Gradle plugin after any Grails core gradle plugins: +Then apply the `org.apache.grails.gradle.grails-gson` Gradle plugin after any Grails core gradle plugins: [source,groovy] ... -apply plugin: "org.apache.grails:grails-web" -apply plugin: "org.apache.grails.grails-views-gson" +apply plugin: "org.apache.grails.gradle.grails-web" +apply plugin: "org.apache.grails.gradle.grails-gson" This will add a `compileGsonViews` task to Gradle that is executed when producing a JAR or WAR file. diff --git a/grails-doc/src/en/guide/theWebLayer/gsp.adoc b/grails-doc/src/en/guide/theWebLayer/gsp.adoc index ac84112fd6..d7fc1e7820 100644 --- a/grails-doc/src/en/guide/theWebLayer/gsp.adoc +++ b/grails-doc/src/en/guide/theWebLayer/gsp.adoc @@ -37,7 +37,7 @@ In addition, for production compilation you should apply the `grails-gsp` Gradle [source,groovy] .build.gradle ---- -apply plugin: "org.apache.grails:grails-gsp" +apply plugin: "org.apache.grails.gradle.grails-gsp" ---- GSPs live in the `grails-app/views` directory and are typically rendered automatically (by convention) or with the link:{controllersRef}render.html[render] method such as:
