Home > Eclipse, Java, Maven, Spring > Maven dependency tree

Maven dependency tree

I was recently moving our project from Spring 2.5.6 to Spring 3.0 when I encountered a ClassNotFoundException. The jar containing the class was present in the war and everything pointed to a jar conflict.
I tried to search in Eclipse but could not find any reference to any other version of Spring. The following command made my life easy …

mvn dependency:tree -Dverbose

Details can be found here .

It gave me a list of the dependencies in a nice tree format and the culprit was found. It was Spring 2.0.7 jar that was being loaded from a module that I had not imported in Eclipse.

[INFO] |  |  +- com.ostermiller:ostermillerutils:jar:20041102:compile
[INFO] |  |  +- (log4j:log4j:jar:1.2.13:compile - omitted for duplicate)
[INFO] |  |  +- (commons-collections:commons-collections:jar:3.2:compile - omitted for duplicate)
[INFO] |  |  +- <strong>org.springframework:spring:jar:2.0.7:compile</strong>
[INFO] |  |  |  \- (commons-logging:commons-logging:jar:1.1:compile - omitted for conflict with 1.0.4)
[INFO] |  |  +- (org.hibernate:hibernate:jar:3.2.1.ga:compile - omitted for conflict with 3.2.6.ga)
[INFO] |  |  \- net.sourceforge.jtds:jtds:jar:1.2:runtime
[INFO] |  +- (log4j:log4j:jar:1.2.13:compile - omitted for duplicate)

Hope this helps someone who runs into a similar problem.

Technorati Tags: , , , , ,

Advertisements
Categories: Eclipse, Java, Maven, Spring
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: