Load spring beans from custom groovy files in grails app

前端 未结 4 2105
天命终不由人
天命终不由人 2021-01-17 23:46

Trying to load spring beans from custom groovy file in Grails 2.3.7. I know this question has been asked before, but after hours of searching, I\'m unable to fi

4条回答
  •  渐次进展
    2021-01-18 00:36

    I had a similar problem just a few days ago, with a groovy configuration file that I added into grails-app/conf. While this works with other resources (they are copied and available on the classpath), the problem with the groovy file was simply that it was compiled and the class file was included, i.e. not the groovy file itself.

    I didn't find any good documentation on how this should be done and finally just added it to web-app/WEB-INF/classes. Groovy files placed here will be copied (not compiled) and available on the classpath.

提交回复
热议问题