How to reference a file inside a Grails plugin

Angel Ruiz grails, plugins, how-to


Grails logo

Recently I had to creat a Groovy script that copies some files from my plugin to the host application. The problem is I did not know how to reference those files inside my plugin.

String yourPluginDir = GrailsPluginUtils.pluginInfos.find { it.name == 'your-plugin-name' }.pluginDir
Share this post: