Converting application.yml to application.groovy

423 views
Skip to first unread message

Sami Mäkelä

unread,
Jan 15, 2016, 10:14:09 AM1/15/16
to Grails Dev Discuss
Trying to convert application.yml to application.groovy (hate yml syntax for configuration) and there's little issue with the configuration with grails. 

With grails 3.0.11 you get the default configuration, but there's an issue with naming of the parameters. 

spring: 
    groovy: 
        template: 
            check-template-location: false 

converts to: 

spring { 
    groovy { 
        template { 
            check-template-location = false 
        } 
    } 


ConfigSlurper cannot handle the hyphen in the name. 

https://issues.apache.org/jira/browse/GROOVY-3338

So whose idea was it yo use hyphen in the config parameter if you cannot convert that to groovy? 

Or is there a work around to this or am I stuck to the yml config forever?

zyro

unread,
Jan 15, 2016, 10:23:06 AM1/15/16
to grails-de...@googlegroups.com
try this one:

spring {
groovy {
template {
setProperty "check-template-location", false
> --
> You received this message because you are subscribed to the Google
> Groups "Grails Dev Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to grails-dev-disc...@googlegroups.com
> <mailto:grails-dev-disc...@googlegroups.com>.
> To post to this group, send email to grails-de...@googlegroups.com
> <mailto:grails-de...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grails-dev-discuss/8b0459dc-d87a-4df7-87cc-865fc3441996%40googlegroups.com
> <https://groups.google.com/d/msgid/grails-dev-discuss/8b0459dc-d87a-4df7-87cc-865fc3441996%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Sami Mäkelä

unread,
Jan 15, 2016, 10:30:36 AM1/15/16
to Grails Dev Discuss
Thanks man! Tested it with groovyConsole and that worked like a charm!

Reply all
Reply to author
Forward
0 new messages