One of my preocupation when writing code is to perform exactly the needed work and to have pieces of code as small as possible. All unnecessary “things” HAVE to be removed.
One of these “things” in Eclipse is plugin dependencies.
The first way to avoid adding useless dependencies is to uncheck the “Generate activator …” and “This plugin will make contribution to the UI” checkboxes when creating a new “Library plugin”.
“Library plugins” are plugins that do not contribute anything to the platform but just exposes some “library” code. For example a plugin encapsulating sqlite.jar (JDBC driver for sqlite database) is a library plugin. Such plugin doesn’t need an Activator so doesn’t need dependencies on any Eclipse plugin. A common mistake is to use the Activator only to access Eclipse logging service. Such plugins should just through exceptions to clients plugins instead of using Eclipse logging service in order to remove dependencies on Eclipse’s core classes.
The second way to remove unused dependencies for any plugin is to simply use the Wonderfull PDE ;o)
Just click on the find unused dependencies link and PDE will tell you what dependencies you can remove !!!
Remove all these dependencies will lead to a smaller (mainly in terms of disk space) application for RCP developers. For plateform plugins developers it will increase the probability that your bundle will be resolved on your client’s Eclipse installation.
Use the PDE tools and remove your unused dependencies !!!