Getting app version returns null when starting application with the main method
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 975
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 92
Description
While running a Grails app I see a difference between running as a java app and running from Gralde, when trying to get the version of the app, from the metadata.
### Steps to Reproduce
1. Run a Grails 3.x app as a Java app using Application.groovy's main method
2. Running Application.metadata.getApplicationVersion() returns null
While alternatively,
1. Run a Grails 3.x app using gradle bootRun
2. Running Application.metadata.getApplicationVersion() returns the version from build.gradle
### Environment Information
- **Operating System**: CentOS 6
- **Grails Version:** 3.2.x
- **JDK Version:** 1.8
If you need a sample app I can make one just not today, as I don't have time at the moment, but I wanted to log the issue while I remember it.
Contributor guide
Research direction
Start with Application.groovy's main method and the metadata access described in the report, then compare that startup path with Gradle bootRun and the version value from build.gradle. Reproduce the difference on a Grails 3.x application and trace where the application version is populated; done means both launch paths return the expected version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100