Reputation: 35864
I read this question but it didn't answer the way I was hoping so I'm posting a similar question with a few more details.
I have a grails application that I need to turn into a plugin, but I'd like to know if this can be done without creating a new plugin and copying files. Assuming the application name is 'admin' I created a AdminGrailsPlugin.groovy file in the root and copied the contents of another plugin's file and changed names accordingly. I ran a package-plugin which generated the plugin.xml and the zip file. So I assumed things were going to work. However, when I tried to use this plugin in an application using the inline plugin mechanism, I'm not able to access any of the plugin's controllers. They all have their own URL Mappings in the plugin's URLMappings.groovy file.
Is there a piece to this puzzle that I am missing?
UPDATE: I added one of the admin plugin's URL Mappings to the applications URLMappings.groovy and things seem to work from there. At least for that controller. So not sure why the plugin's URLMappings.groovy is being ignored?
Upvotes: 4
Views: 779
Reputation: 35864
Ok, after some more searching I discovered that in a plugin, UrlMappings.groovy is ignored. I renamed it to AdminUrlMappings.groovy and now it works like a champ. I'm going to go check JIRA for a bug because my other plugin's mapping class is called UrlMappings when, in my opinion, if I run 'grails run-app common' I should get CommonUrlMappings.groovy. But that doesn't happen.
Upvotes: 4