There are four duplicate classes in two Maven artifacts from Apache: commons-beanutils:commons-beanutils:1.8.3
and commons-collections:commons-collections:3.2.1
:
org.apache.commons.collections.ArrayStack
org.apache.commons.collections.Buffer
org.apache.commons.collections.BufferUnderflowException
org.apache.commons.collections.FastHashMap
Is it possible to replace one of them with some other artifact to avoid this duplication? I tried to google but didn't find any solution. Rather annoying problem.
Commons Collections was introduced as a series of utilities that augment the Java Collections API. Commons Collections contains functors such as Predicate and Closure , utilities for filtering and selecting elements in a collection, and some new collections: Bag and Buffer .
Commons Collections augments Java Collections Framework. It provides several features to make collection handling easy. It provides many new interfaces, implementations and utilities.
In this case, the problem isn't maven or exclusions (which usually is the issue) but you are using the wrong version of beanutils most likely.
There is a version of the beanutils jar that has bean collections included and one that does not. The maven dependencies for the beanutils with bean collections includes commons collections. If you are using commons collections yourself, use the core version of and include commons collections in the maven dependencies.
This is where it is explained a bit: http://commons.apache.org/beanutils/
That page says this:
commons-beanutils.jar - contains everything commons-beanutils-core.jar - excludes Bean Collections classes commons-beanutils-bean-collections.jar - only Bean Collections classes The main commons-beanutils.jar has an optional dependency on Commons Collections
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With