Skip to content

Grails 7: Cannot get environment name with grails.util.Metadata.current.getEnvironment() #13705

@arjangch

Description

@arjangch

Expected Behavior

In Grails 5, i can get app environment name in GSP with ${grails.util.Metadata.current.getEnvironment()}

Actual Behaviour

${grails.util.Metadata.current.getEnvironment()} returns nothing. I can however, get environment name with ${grails.util.Environment.current.name}.
Using ${grails.util.Metadata.current.getProperties()} i see environment name is null
developmentEnvironmentAvailable=true, environment=null,

Steps To Reproduce

1- add ${grails.util.Metadata.current.getEnvironment()} to a GSP. It won't return anything.
2- add ${grails.util.Environment.current.name} this shows environment name.

Environment Information

  • MacOS
  • java=22.0.2-zulu
  • gradle=8.10
  • groovy=4.0.22
  • grails=7.0.0-SNAPSHOT

Example Application

https://github.com/jamesfredley/grails-website-test/tree/7.0.0-SNAPSHOT

Version

grails=7.0.0-SNAPSHOT

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions