views:

151

answers:

1

Is there a Maven plugin that allows you to check if there are newer versions of dependencies available in the repository?

Say, you are using dependency X with version 1.2. Now a new version of X is released with version 1.3. I'd like to know, based on the dependencies used in my project, which dependencies have newer versions available.

+3  A: 

The Maven Versions plugin and its display-dependency-updates mojo are what you're looking for:

mvn versions:display-dependency-updates

Here is what the output looks like:

[INFO] ------------------------------------------------------------------------
[INFO] Building Build Helper Maven Plugin
[INFO]    task-segment: [versions:display-dependency-updates]
[INFO] ------------------------------------------------------------------------
[INFO] [versions:display-dependency-updates]
[INFO]
[INFO] The following dependency updates are available:
[INFO]   org.apache.maven:maven-artifact ........................ 2.0 -> 2.0.9
[INFO]   org.apache.maven:maven-plugin-api ...................... 2.0 -> 2.0.9
[INFO]   org.apache.maven:maven-project ....................... 2.0.2 -> 2.0.9
[INFO]   org.codehaus.plexus:plexus-utils ....................... 1.1 -> 1.5.6
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17 seconds
[INFO] Finished at: Fri Aug 15 10:46:03 IST 2008
[INFO] Final Memory: 10M/167M
[INFO] ------------------------------------------------------------------------
Pascal Thivent
Thanks Pascal. That's what I was looking for. Though, for Spring version 3.0.1.RELEASE it reports a newer version of 2.5.6. Maybe a bug in the plugin?
Felix Roethenbacher
@Felix You're welcome. Regarding the Spring artifact, I wonder if the problem is not due to the fact that Spring is not following ["the rule"](http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution): version should be 3.0.1-RELEASE, not 3.0.1.RELEASE. In other words, I'm not sure it's a bug (I mean, sure, I'd expect the plugin to report 3.0.1.RELEASE as newer too, but I'm not sure this would be accepted as a bug).
Pascal Thivent