qgicup
qgicup

Reputation: 2239

Grails: How to bundle extensions together with main war-file when they should not be part of the built one?

I have some customer extensions that have to be implemented as separate module (e.g.: grails plugins) and which should be bootstrapped/configured with application at deploy time, but not included in the final war file.

The plugin does not have to be loaded at runtime, it just has not to be included in the war file, and still be able to communicate with the main application services.

I know I can specify location of a plugin in BuildConfig.groovy as grails docs says

An application can load plugins from anywhere on the file system, even if they have not been installed. Specify the location of the (unpacked) plugin in the application's grails-app/conf/BuildConfig.groovy file:

But I want to be able to exclude plugin from the built WAR file.

I think that a solution for this is to use binary plugins, which generate a jar, and use a classLoader to load plugin.

Please give me your valuable suggestions as I cannot find a good solution for this.

Thanks in advance!

Upvotes: 0

Views: 141

Answers (1)

dmahapatro
dmahapatro

Reputation: 50245

If you mark properly, your use case resembles that of grails tomcat plugin which is embedded in grails apps by default. Here is how:

  • Used during build process.
  • Not packaged in war.
  • Not loaded in runtime.
  • Acts as an embedded server for the application.

Inference:
Can you use your plugin in the build configuration same as tomcat?

//BuildConfig.groovy
....
plugins{
    build ':yourPlugun:1.0'
}
....

Upvotes: 1

Related Questions