Sunday, 15 September 2013

How do I access a configuration variable passed into grails from the commandline -


I am trying to send a variable like the command line to my Geral app:

 < Code> grails -Dmy.build.number = 33 prod war root.war   

I tried to access it as a grailsApplication.config.my.build.number But I get an empty map. It seems weird that the variable is defined, but what I send is not set.

How do I get a command-line property?

I plan to install some of my assets (CSS, JS, image etc.) to work as a CDN in CloudFront. So in my construction phase I want to use the build number as the cash buster and want to set my property to point to mycloudfronturl / assets / $ {buildnumber} /script.js . If there is a better attitude, then I am also open for this.

  system getProperty ("my.build.number");    

No comments:

Post a Comment