开发者

Specifying order of plugins in Grails

My grails application depends on several grails plugins that append and entries to web.x开发者_如何学Goml

The problem is I need to control the order the plugins are executed. There is a particular plugin which is used for some security purposes which adds a filter in web.xml. This filter needs to be the first executed filter in web.xml Thus I would like this filter to be executed last so that I can ensure that this plugin will be appending the configurations in the first position.

I know there is a dependsOn property on the plugin class to ensure it gets executed last, but that only works if I know which plugins are going to be used in combination with this plugin. I would like this plugin to be general enough so that anyone in my company can use this plugin and know for sure that this gets executed last.

Is there any way I can ensure a particular plugin gets executed last? Either in the grails-plugin project (ie a property of the plugin class) or configuration of the grails application project.

Thanks,


Does the grails application install plugins using the install-plugin command? If so, try declaring them in BuildConfig.groovy instead.

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

It's possible that plugins declared here are loaded in the same order they're listed, though I haven't tested this theory.


It might be easier to find a way to make your plugin append it's filters differently to ensure they get appended to the position you want them in. I would have to see the code for the plugin if I was going to try to help solve this in that way though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜