Creating a Grails 5/6 Application

Site Admin · 11 Sep 2026 · 10 views

Setting Up the Environment

To create a modern Grails application, install the latest Grails SDK and ensure you have JDK 11 or higher (JDK 17 recommended for Grails 6+).

# Install latest Grails via SDKMAN
sdk install grails
sdk use grails 6.0.0

# Verify
grails --version

Creating the Application

grails create-app myapp

The generated project uses Gradle with the application plugin. The structure follows the modern Grails conventions.

Profile Structure

Modern Grails uses profiles to define project templates. The default profile includes:

  • web-profile - Full-stack with GSP views
  • rest-api - REST-only without views
  • base - Minimal profile

Gradle Configuration

// build.gradle
plugins {
    id "org.grails.grails-web"
    id "com.github.node-gradle.node"
}

dependencies {
    implementation "org.grails:grails-plugin-rest"
    runtimeOnly "org.grails:grails-plugin-url-mappings"    runtimeOnly "org.grails.plugins:views-json"
}

Running the Application

grails run-app
# Or using Gradle
./gradlew bootRun

Key Points

  • Install Grails via SDKMAN for easy version management.
  • Use grails create-app to generate a modern project.
  • Profiles define project templates (web, REST, base).
  • Modern Grails uses Gradle with dedicated plugins.
  • JDK 11+ is required; JDK 17 recommended for Grails 6+.
Share this post:

Comments (0)

Please login or register to comment.