I would like to know, if it is possible and if there is a generic way to extend the functionality of a grails plugin.
I recently installed the commentable plugin, but need to do some modifications to it. Since the code is not stored together with the project (but in the user directory) if I modify it, after the plugin is updated (or the project at some other machine installed) these changes are lost.
Does someone have any idea?
Thanks, Nicolas
If you want to override an artifact (e.g. a domain class) create one with the same name in your project. Plugins are compiled separately from the application classes and their artifacts are registered first, so if there's an artifact in the main app it will replace the plugin's. Just be sure to use the same package for domain classes, although this isn't required for controllers or services.
If you want to modify the plugin completely, you may try to change and then recompile the plugin, and build it into a zip-file with different name.
Then you can install the customized-plugin from source code. You may refer to the question here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With