简体   繁体   中英

1.4 Commons-DBCP being brought in instead of 1.3

I have a strange situation. In jar A, I explicitly bring in version 1.3 of commons-dbcp. In jar B, I have a dependency on jar A. However, when I bring in the jar A dependency in jar B, my maven dependency hierarchy shows that jar B is now using 1.4. If I remove that dependency, commons-dbcp is gone from my maven dependency hierarchy so I feel certain it's not being pulled in elsewhere. And when I'm in jar A's maven dependency hierarchy, it only shows 1.3.

Does anyone have any idea why this might be happening?

Maven automatically determines the version to bring in for transitive dependencies. You may have more than one dependency on commons-dbcp (perhaps you're test wouldn't show it if they are in different scope). Use the Maven dependency plugin via mvn dependency:tree to see the other dependencies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM