-
-
Notifications
You must be signed in to change notification settings - Fork 952
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 3.0.2 - Add ability to use system properties / command line arguments in application.yml #9086
Comments
This is already possible with:
|
Thanks for adding this to the docs! I already tried this solution as suggested:
Starting the app with param "-DJDBC_CONNECTION_STRING=jdbc:mysql://localhost" |
@mhuebner It's not merged yet. I added a comment to not merge if this is not working. |
How did you start the app? Grails doesn't automatically pass system properties on the command line. You will need to modify the bootRun target of your build.gradle to add system properties if you used |
Ok, now i see. I wasn't aware of that.
This gives me the same Result (Exception) |
Followup: it's working now as expected - with the following syntax:
@graemerocher @anshbansal thanks for your hint! Perhaps this could be documented anywhere?? |
@gramerocher Suggestions? I am not sure where to add this in the docs. |
At the head (d380bea) of 3.0.x, the place holder couldn't be resolved. It's just ignored. Should I create new issue? |
@nobeans Using the latest 3.0.x I added:
And then I changed
And it worked fine for me |
@anshbansal Probably somewhere under the Configuration section http://grails.github.io/grails-doc/latest/guide/conf.html |
@graemerocher I tried your example. It actually worked well. But when I tried to get via |
@nobeans Please raise a separate issue and I will have a look. Thanks. |
Sure. |
This would simplify the deployment process for container based hosting environments (like aws Beanstalk).
Sample setup:
System property JDBC_CONNECTION_STRING ist set to " 'jdbc:mysql://localhost/my_db?useUnicode=true&characterEncoding=UTF-8&username=xxx&password=xyz'"
(This property is attached with "-DJDBC_CONNECTION_STRING=")
The text was updated successfully, but these errors were encountered: