1
votes

Is it possible to use a grails plugin outside a grails application?

I would like to use the functionality of grails-mail-plugin in a simple groovy/gradle app.

I found some information about binary plugins but I'm not sure how to define the dependency to an official grails plugin.

Thanks!

1

1 Answers

1
votes

I don't think you could use any Grails plugin itself outside the Grails environment, usually there is a ton of Grails-specific assumptions built into the plugins' code.

If your Groovy application uses Spring, you could migrate the most important functionality out of it.

For this, you will have to get into the innards of the source code of the plugin (e.g. how it uses the Spring Mail package for example) which not may be very quick or easy work.

If your requirements are simple, you may be better of with building a standalone solution, possibly, directly on top of JavaMail.

If you already have a heterogeneous architecture, you may build a separate Grails application/module which only does mailing functionality (possibly through the Async Mail plugins database tables) in integration with the module you build in pure Groovy.