Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions grails-doc/src/en/guide/theWebLayer/gson/jsonInstallation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@ 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` file.

If you use the Grails BOM:

[source,groovy]
implementation "org.apache.grails:grails-views-gson"

otherwise, add the version explicitly:

[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:

Expand All @@ -29,16 +36,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.
2 changes: 1 addition & 1 deletion grails-doc/src/en/guide/theWebLayer/gsp.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading