Wednesday, July 20, 2011

Tame your Java dependencies

As an application becomes more modular but also bigger, one often ask him/herself questions like:
- is there a more recent version (or a released version) of this library ?
- is this library consistently used across the project?
- why is this library being used?

To address these, Milos Kleint, Matthew Piggott and I have been working on an Eclipse plug-in that allows to answer those questions directly from within the IDE and for any Java project (JDT, Maven, PDE, …). Even though the plug-in will only be made available after Thrusday's webinar, here is a introduction to it showing how the questions are being answered.

Is there a more recent version of this library?
This information is presented in the "Dependency Hub" view. This view is divided into two sections, an overview on the left, and a details section on the right. The overview presents a list of all the libraries used by the projects contained in the workspace and colour coded arrows representing the various updates available, whereas the details provides a list of the available versions.

Is this library consistently used across the project?
This information can quickly be found in the overview section of the view.

Why is this library being used?
When you find a suspicious dependency or some inconsistency, the search facility will identify how the library is brought in and present the results in the Eclipse search dialog. It not only searches in the direct dependencies but also in transitive dependencies when used with a Maven project.

Finally, another cool feature we've added but is Maven specific, is the ability to modify the pom.xml to update to a new library.

To conclude, we are pretty pleased with the tool and hope you will enjoy it to. This first version is beta and free, and over the next few months we will be rolling out more updates with new features.