Find Questions…

Close ×
First time here? Check out the FAQ!

How to intercept plugin upgrade?

Pankaj Jangid asked this question · 609 karma ·

I want to run some code before upgrade. Is there a way to intercept plugin upgrade, run custom code and then resume upgrade.


One Answer:

Dheeraj Kumar Aggarwal · 211 karma ·

JIRA converts components into spring beans internally.

Create a Component Plugin module that implements InitializingBean and DisposableBean. When the plugin will be installed/enabled/upgraded then afterPropertiesSet method will be invoked and when plugin will be disabled/uninstalled then the destroy method will be invoked.

So, If you are upgrading a new plugin then afterPropertiesSet method will be invoked on new plugin and destroy will be invoked on old plugin.

Looking for something else?

Find Questions…

or Browse other questions tagged:

or Ask a Question