grailsgrails-plugingrails-2.0grails-2.4gant

How to copy Grails 2 plugin resources to the Grails app?


I'm writing a custom Grails 2 plugin to modularize my Grails applications. In the plugin I'm planning to define basic GSPs that can be overridden by the application that will utilize the plugin. I'm thinking of writing a Grails command script that copies those GSPs into the grails-app directory of the app the plugin is installed in. If in the plugin, I put those GSPs in grails-app/views, how do I refer to the actual Grails app directory in the Grails command script, which is also grails-app/views?


Solution

  • The solution to this is almost the same as this answer. The built-in properties basedir and <plugin_name>PluginBaseDir differentiate the target app and the plugin directories.