Monday, May 31, 2010

Maven dependency helpers

All my projects now use Maven, most of these have a parent and many sub-projects and sub-projects etc as it is logical to breakup your project.  There is even a "common" project for core functionality.  Each project has a number of dependencies and it is common to have developed one sub-project that has different version of a dependency.  Always good if these can be cleaned up so there are Maven plugins that can help with this kind of thing.


Checking for new plugin updates:
http://mojo.codehaus.org/versions-maven-plugin/examples/display-plugin-updates.html



mvn versions:display-dependency-updates


Checking for version clashes:
http://hexapixel.com/software/maven-version-clash-plugin
Follow the install and run instructions on the above link.
I found this one best put in your parent pom as a build plugin so its run each compile - use a profile if you don't want it to run like this.



Dependency tree:
http://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html
mvn dependency:tree