eclipseeclipse-plugineclipse-rcpp2

Is there any method to clean old plugins/features from disk automatically once new plugin/features are installed in eclipse RCP?


I am building an RCP application, where there will be updates in the features/plugins every quarter. So, if a user chooses to auto update the feature/plugin then new jars for updated plugins are getting downloaded, but the old plugins are still using my disk space which are no more in use.

I have tired deleting the installation history which has the information of old jar. While I try to delete it, it shows me the below given message

Error Message for deleting installation history

But this does not delete the .jar, I can still find it in my feature/plugin folder.

Also, this is a manual process. So, is there any way where the old plugins gets deleted automatically when there is new jars with updated version.


Solution

  • Enable the p2 garbage collector in your plugin_customization.ini file as follows for that:

    # after upgrading delete the plug-ins that are no longer needed
    org.eclipse.equinox.p2.ui.sdk.scheduler/gcOnStartup=true
    

    For details see the Eclipse wiki: Equinox p2 FAQ - Why aren't bundles being removed when their associated feature has been removed?