Receiver class grails.util.Environment does not define or inherit an implementation of the resolved method 'abstract java.lang.Object getProperty(java.lang.String)' of interface groovy.lang.GroovyObject
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 975
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 92
Description
### Expected Behavior
```
grails create-app g525vue --profile vue
cd g525vue/server
grails prod war
> Task :compileJava NO-SOURCE
> Task :compileGroovy
> Task :buildProperties
> Task :processResources
> Task :classes
> Task :bootWarMainClassName
> Task :compileGsonViews
> Task :findMainClass
> Task :bootWar
> Task :war
> Task :assemble
BUILD SUCCESSFUL in 22s
8 actionable tasks: 8 executed
|Built application to build/libs using environment: production
```
### Actual Behaviour
```
grails create-app g525vue --profile vue
cd g525vue/server
grails prod war
$ grails prod war
|Resolving Dependencies. Please wait...
FAILURE: Build failed with an exception.
* Where:
Build file '/home/user/g525vue/server/build.gradle' line: 20
* What went wrong:
A problem occurred evaluating root project 'g525vue'.
> Receiver class grails.util.Environment does not define or inherit an implementation of the resolved method 'abstract java.lang.Object getProperty(java.lang.String)' of interface groovy.lang.GroovyObject.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
CONFIGURE FAILED in 8s
Error |
Error initializing classpath: Receiver class grails.util.Environment does not define or inherit an implementation of the resolved method 'abstract java.lang.Object getProperty(java.lang.String)' of interface groovy.lang.GroovyObject. (Use --stacktrace to see the full trace)
```
the content of the default generated build.gradle is:
```
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "com.github.node-gradle:gradle-node-plugin:2.2.0"
classpath "org.grails.plugins:hibernate5:7.3.0"
classpath "org.grails.plugins:views-gradle:2.3.2"
}
}
version "0.1"
group "g525vue"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web" // <-- line#20
apply plugin:"com.github.node-gradle.node"
apply plugin:"org.grails.plugins.views-json"
repositories {
mavenCentral()
maven { url "https://repo.grails.org/grails/core" }
}
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
dependencies {
developmentOnly("org.springframework.boot:spring-boot-devtools")
compileOnly "io.micronaut:micronaut-inject-groovy"
console "org.grails:grails-console"
implementation "org.springframework.boot:spring-boot-starter-logging"
implementation "org.springframework.boot:spring-boot-starter-validation"
implementation "org.springframework.boot:spring-boot-autoconfigure"
implementation "org.grails:grails-core"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-tomcat"
implementation "org.grails:grails-plugin-url-mappings"
implementation "org.grails:grails-plugin-rest"
implementation "org.grails:grails-plugin-codecs"
implementation "org.grails:grails-plugin-interceptors"
implementation "org.grails:grails-plugin-services"
implementation "org.grails:grails-plugin-datasource"
implementation "org.grails:grails-plugin-databinding"
implementation "org.grails:grails-web-boot"
implementation "org.grails:grails-logging"
implementation "org.grails.plugins:cache"
implementation "org.grails.plugins:async"
implementation "org.grails.plugins:hibernate5"
implementation "org.hibernate:hibernate-core:5.6.11.Final"
implementation "org.grails.plugins:views-json"
implementation "org.grails.plugins:views-json-templates"
profile "org.grails.profiles:vue"
runtimeOnly "org.glassfish.web:el-impl:2.2.1-b05"
runtimeOnly "com.h2database:h2"
runtimeOnly "org.apache.tomcat:tomcat-jdbc"
runtimeOnly "javax.xml.bind:jaxb-api:2.3.1"
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.mockito:mockito-core"
testImplementation "io.micronaut:micronaut-http-client"
testImplementation "org.grails:grails-web-testing-support"
testImplementation "org.grails:views-json-testing-support"
testImplementation "org.hibernate.validator:hibernate-validator:6.1.7.Final"
}
bootRun {
ignoreExitValue true
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx1024m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
tasks.withType(GroovyCompile) {
configure(groovyOptions) {
forkOptions.jvmArgs = ['-Xmx1024m']
}
}
tasks.withType(Test) {
useJUnitPlatform()
}
```
### Steps To Reproduce
```
grails create-app g525vue --profile vue
cd g525vue/server
grails prod war
```
### Environment Information
- OS: Ubuntu 20.04 LTS 64bit
- JDK Version: OpenJDK 11.0.16
### Example Application
_No response_
### Version
5.2.5
Contributor guide
Research direction
Reproduce the failure with the listed `grails create-app`, `cd`, and `grails prod war` commands on OpenJDK 11, then inspect line 20 of the generated `build.gradle` and its buildscript dependencies. Done means the generated Grails 5.2.5 Vue application completes the production WAR build instead of failing during project evaluation.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100