updating of project specific plugin

I'm writing a project-specific plugin (not usable for people outside our team) and want it to be automatically updated from our resource storage. How can I do it?

I can detect that plugin is outdated. But I can't simply replace plugin .jars with a new version because IDEA is already loaded and .jars files are locked.

Message was edited by:
Vitaly Berov


Look at how IntelliJ does it for "normal" plugins. If you use the built in plugin manager and download a new or updated plugin you need to restart IDEA for the updates to take effect.

If I were you I would detect that your plugin is outdated, ask the user if they want to update. If they do then replace the jars and shutdown IDEA. Then the user can restart and the update will be in place.

Just a thought anyway.



The problem in the stage "replace jars". I can't replace jars because plugin is loaded and jar s locked by IDEA. So I'm looking for some way to unload plugin to be able to replace jars.


IDEA itself is downloading the plugin to be installed into a separate directory (${idea.system.path}/plugins) and creates a file 'action.script' to install the plugin on next startup. The only way for you to go is to do something similar or to hook into this mechanism. Unfortunately there's no OpenAPI access to this mechanism yet, so maybe it is worth to file a JIRA request to add this to OpenAPI.

If you want to mimic this mechanism yourself then I think the only solution is to force your users to launch IDEA with a modified startup script which scans a dedicated directory for new versions of the plugin and installing it into the correct location prior to launch IDEA.


Oh yeah, this must be on WIndows. I forgot Windows doesn't like you overwriting files that are open.


Please sign in to leave a comment.