Grails 3.1.0.M3 is unable to refresh gradle to fetch dependencies on create-app

Steps to reproduce:

  1. Install Grails 3.1.0.M3
  2. Create a new Grails app

Following are the contents in file:

gradle.properties

grailsVersion=3.1.0.M3
gradleWrapperVersion=2.9

build.gradle

buildscript {
ext {
grailsVersion = project.grailsVersion
}
repositories {
mavenLocal()
maven { url “JFrog” }
}
dependencies {
classpath “org.grails:grails-gradle-plugin:$grailsVersion”
classpath “org.grails.plugins:hibernate4:5.0.0.RC2”
classpath “com.bertramlabs.plugins:asset-pipeline-gradle:2.5.0”
}
}

Workaround:
Change the following in build.gradle:

buildscript {
ext {
grailsVersion = “3.1.0.M3” // <<=== Changed here
}
repositories {
mavenLocal()
maven { url “JFrog” }
}
dependencies {
classpath “org.grails:grails-gradle-plugin:$grailsVersion”
classpath “org.grails.plugins:hibernate4:5.0.0.RC2”
classpath “com.bertramlabs.plugins:asset-pipeline-gradle:2.5.0”
}
}

I think project.grailsVersion is not readable in buildscript closure. Can someone from gradle team confirm if this is a bug in gradle?

FYI, bug ref on grails: Grails 3.1.0.M3 is unable to refresh gradle to fetch dependencies on create-app · Issue #9488 · grails/grails-core · GitHub