1

Here is the problem:

For the sake of multiple developers and development environments (developer dependent, developer VM, dev, qa, stage, prod), I want to be able to use application.properties file to inject app confiugration into Config.groovy. Reason why it works for us is that we are using same file for injecting settings in Spring's applicationContext.xml file. I've been trying to accomplish this by follwing in Config.groovy, but still not geting value for neo4j.url from application properties.

grails.config.locations = [
    "classpath:application.properties",
    "file:${baseDir}/application.properties",
    "file:${basedir}/application.properties"
]


println "neo4j url : ${grailsApplication.config.neo4j.url}"
println "neo4j url : ${neo4j.url}"

There must be something I'm doing wrong..

2
  • 4
    where do you check value? I mean this println, inside Config.groovy? May 28, 2013 at 15:11
  • good point, figured out once I print it from within controller, everything seems to be working fine.
    – toske
    May 29, 2013 at 16:29

1 Answer 1

0

Problem was that I was printing values in Config.groovy, once application loaded everything worked fine, as expected, case closed tnx to Igor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.