You can try using this in plugin descriptor.
import grails.util.Holders
....
def doWithSpring = {
//gives plugin name while using through app
def appName = manager.getGrailsPluginForClassName(this.class.simpleName).name
//gives plugin project name
def name = Holders.config.grails.plugin.myplugin.name
}
Changes in Config.groovy
grails.plugin.myplugin.name=appName
This config entry should not pollute when the plugin is used through the app. You would get an empty map for name
above when plugin is run through the app.