9

I am creating a Grails plugin and I would like for it to add its own UrlMappings. The UrlMappings.groovy file in the plugin source is ignored by the application using the plugin, so where should these be defined?

Ken Liu
  • 22,503
  • 19
  • 75
  • 98

1 Answers1

15

See http://grails.org/doc/latest/guide/single.html#plugins: Notes on excluded Artefacts

In addition, although UrlMappings.groovy is excluded 
you are allowed to include a UrlMappings definition with 
a different name, such as MyPluginUrlMappings.groovy.
Chris
  • 8,031
  • 10
  • 41
  • 67
  • It didn't worked for me. When I run the main project i get `ERROR commons.DefaultGrailsApplication - The class [MyPluginUrlMappings] was not found when attempting to load Grails application. Skipping.` – Cassio Landim Jan 24 '12 at 19:15
  • 4
    @CassioLandim The name of your class must be `MyPluginUrlMappings` and not `UrlMappings`. –  Sep 24 '13 at 17:41
  • 1
    @CassioLandim thank you for that comment. I forgot that it's a class and has a Class Definition... – sparkyspider Dec 20 '13 at 12:10