The Grails asset-pipeline is a plugin used for managing/processing static assets. These include processing, and minification of both css, and javascript files. It is also capable of being extended to compile custom static assets, such as coffeescript.

Asset Pipeline is intended to replace the defacto Grails equivalent (resources-plugin) with a more efficient, developer friendly architecture (similar to rails asset-pipeline). The asset-pipeline levereges the latest in minification (UglifyJS) to reduce your asset sizes as much as possible.

— From the bertramdev/asset-pipeline README.
Tags: Grails

a Grails question: why would this service be null?

Given this grossly simplified rendition of the setup:

Why would the service appear to be null when the method on the app’s taglib calls its superclass (the taglib on the plugin), which in turn calls the method on the service?

The best theory I could come up with is that the service is not actually being instantiated in the app’s taglib class because there are no explicit references to it aside from the def. I presume that this is the case because if I move all the logic from service class’s method into the taglib’s method, it works as expected.

(For the sake of painting a complete picture: MyExampleService.doMunge is called in other places, whereas the subsequent filtering (in MyTagLib.doMungeAndFilter) is only needed for the taglib.)

Alternatively: if I move doMungeAndFilter into another service class, creating the base version in the plugin and extending it in the app, that works fine. Which I suppose is an acceptable conclusion, though it feels like bloat to create another service class just to support the taglib like that.

Thoughts? Tips? Glaring errors or omissions?

Updated: You can comment on the Gist or else on the Stack Overflow thread.

Tags: Grails Groovy