{"id":4093,"date":"2011-08-24T15:56:14","date_gmt":"2011-08-24T10:26:14","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=4093"},"modified":"2015-05-19T17:46:00","modified_gmt":"2015-05-19T12:16:00","slug":"setting-system-property-from-command-line-in-grails","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/setting-system-property-from-command-line-in-grails\/","title":{"rendered":"Setting System property from command line in grails"},"content":{"rendered":"<p>Hi,<\/p>\n<p>In one of my recent grails project, i needed to set System property from command line while running the grails application.<br \/>\nI looked for it and found a simple solution to do so and found it worth sharing.<\/p>\n<p>Suppose we want to set any property, say app.property=&#8221;propertyValue&#8221;, then the command to set the property in grails application would be:<\/p>\n<p>[java]<br \/>\n  grails  -Dapp.property=&quot;propertyValue&quot; run-app<\/p>\n<p>[\/java]<\/p>\n<p>Similarly to retrieve the value of System property, we use<\/p>\n<p>[java]<br \/>\nString myPropertyValue= System.getProperty(&quot;app.property&quot;)<br \/>\n[\/java]<\/p>\n<p>It helped me a lot..<br \/>\nHope it helps<\/p>\n<p>Vishal Sahu<br \/>\nvishal@intelligrape.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, In one of my recent grails project, i needed to set System property from command line while running the grails application. I looked for it and found a simple solution to do so and found it worth sharing. Suppose we want to set any property, say app.property=&#8221;propertyValue&#8221;, then the command to set the property [&hellip;]<\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":2},"categories":[7],"tags":[260,263],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/4093"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=4093"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/4093\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=4093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=4093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=4093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}