When trying to create a plugin for Hibernate Envers, I had issues finding the correct way to plug the hibernate event listeners in the SessionFactory.
The solution usually found on the web involves mucking with the SessionFactory after it is built to add more event listeners.
This works quite often but not with envers because its event listener implements Initializable and thus must be set on the configuration object.
I have seen the related issue
GRAILS-4651 but an Interceptor is not enough for envers.
Attached is a patch against 1.1.2 (and a new file to add in grails/src/persistence/org/codehaus/groovy/grails/orm/hibernate)
With this patch applied I can do this in a plugin :