This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven dependencies added from the blue? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven dependencies added from the blue?" Watch "Maven dependencies added from the blue?" New topic
Author

Maven dependencies added from the blue?

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9344
    
    2

I'm quite perplexed with one issue that I have with my Maven build. I have a pom.xml that has a dependency to a library as below:


When I build my project I ran into errors and so I decided to run the maven build using -X option. When I checked the classpath, I see the following:


I'm confused as to from where did the ones that are marked bold (casbah-commons_2.9.1, casbah-commons_2.9.1, mongo-java-driver/2.7.3, casbah-query_2.9.1) in the snippet above make it to the classpath? It is quite perplexing! If I look at the pom.xml that is referenced by the maven dependency that I added,

https://oss.sonatype.org/content/repositories/releases/org/mongodb/casbah-core_2.10/2.7.0-RC2/casbah-core_2.10-2.7.0-RC2.pom

there is no transitive dependency to the older versions (2.9.1) at all, then from where is this being pulled? Any clues?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9344
    
    2

Allright, I managed to get this fixed. The reason why the unwanted jar files ended being up in the classpath was because of the fact that I had an additional maven dependency to another framework called Salat which is a Scala wrapper to work with MongoDB. This was actually causing the confusion. As soon as I removed it, I was able to get rid of the strange error that I was facing. Now it is another challenge that I have to solve and this one pretty much looks like a Scala issue. So posting it in the Scala forum.

http://www.coderanch.com/t/630461/Scala/Scala-Manifest-Type-error#2886441
 
wood burning stoves
 
subject: Maven dependencies added from the blue?
 
Similar Threads
java.lang.AbstractMethodError
I can't make maven use my external jars I added to local repository
Scala Casbah - Cast Exception
Scala MongoDB driver error
CXF codegen plugin error