Specifying the order of plugins in Grails

My grails application depends on several grails plugins that are added and written to web.xml

The problem is that I need to control the execution order of the plugins. There is a specific plugin that is used for some security purposes, which adds a filter to web.xml. This filter should be the first filter executed in web.xml. Thus, I would like this filter to be executed last, so that I can make sure that this plugin will add configurations in the first position.

I know that there is a dependOn property in the plugin class to guarantee that it will be executed last, but this only works if I know which plugins will be used in combination with this plugin. I would like this plugin to be general enough so that someone from my company can use this plugin and know for sure that this will be done last.

Is there any way to ensure that a particular plugin is launched last? Either in the grails-plugin project (i.e., a plugin class property), or in the grails application project configuration.

Thanks,

+4
source share
2 answers

Does grails use install plugins with the install-plugin command? If so, try declaring them in BuildConfig.groovy .

 plugins { runtime ':weceem:0.8' runtime ':hibernate:latest.release' } 

It is possible that the plugins announced here are loaded in the same order as they are, but I have not tested this theory.

0
source

It may be easier for you to find a way to make your plugin add its filters in different ways to make sure they are added to the position you want. I will need to see the code for the plugin if I try to help resolve it this way, though.

0
source

All Articles