Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
arjangch opened this issue Sep 29, 2024 · 0 comments

Comments

@arjangch
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant