How do you reference a Resource Bundle that comes from a Grails Plugin

164 Views Asked by At

In my GSP I want to reference a Resource Bundle that is being defined in a plugin so I can be path-agnostic in my grails application.

In the Resources.groovy file I have:

modules = {
    widgeta {
        resource url: 'directives/widgeta/widgeta.js'
        resource url: 'directives/widgeta/restapi.js'
    }
}

In the HEAD of a GSP within my Grails App (which is correctly pulling everything in from the Plugin including Controllers and domain objects) I have this:

<r:require modules="widgeta"/>

When I try to run i get this:

Caused by IllegalArgumentException: No module found with name [widgeta]

Which makes sense because I don't see the Resources.groovy file anywhere in the plugins that are being included.

How do I either

  1. automatically include the Resources file from the plugin.
  2. reference the files within the plugin from my application's Resource.groovy file(s)?
1

There are 1 best solutions below

0
On BEST ANSWER

For me, the issue was that my 'installed plugin' was out of date. the version of the plugin which was installed into my app did not have the Resources.groovy file with the correct bundle specified. Blowing away that plugin and re-installing it (really just building again) seems to have solved my issue.