Show Navigation

How to Use a Specific Version of GORM in Grails 3

By Graeme Rocher

April 27, 2016

Tags: #gorm

In order to ensure compatibility Grails 3 ships with a BOM that applies dependency management and enforces a particular version of GORM when using Grails.

Sometimes however, you want to use a different version or there is a more recent version of GORM out there that you would prefer to use.

Luckily Gradle makes this fairly easy to control. Using the following snippet you can enforce a particular GORM version within your build.gradle:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        if (details.requested.group == 'org.grails' 
        && details.requested.name.startsWith('grails-datastore')) {
            details.useVersion("5.0.5.RELEASE")
        }
    }        
}

In this example I’m forcing Gradle to resolve the 5.0.5.RELEASE version of GORM using the Gradle resolutionStrategy.

You might also like ...