Grails: Register job from external library

65 Views Asked by At

I need to separate a grails service into a dedicated lilbrary in order to use this service across many applications. This works fine for the service itself as I am able to register the service bean in the resources.groovy (see https://docs.grails.org/latest/guide/spring.html).

This service happens to use a quartz job to get some functionality triggered regularly. So naturally I would move this job into the library and need to register it in the main application. How can that be achieved? Thanks for you time!

1

There are 1 best solutions below

0
On

Create grails plugin using this guide: https://docs.grails.org/latest/guide/plugins.html

Then in src/main/groovy/YOUR_PACKAGE/YourPluginGrailsPlugin.groovy you can add bean configuration in doWithSpring() method (in same as resources.groovy way).