commons-collections和commons-beanutils中的重复类 [英] duplicate classes in commons-collections and commons-beanutils

查看:135
本文介绍了commons-collections和commons-beanutils中的重复类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apache的两个Maven工件中有四个重复的类:commons-beanutils:commons-beanutils:1.8.3commons-collections:commons-collections:3.2.1:

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.

推荐答案

在这种情况下,问题不是Maven或排除问题(通常是问题所在),但您使用的beanutils版本很可能是错误的.

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.

有一个beanutils jar版本,其中包含bean集合,而没有.具有bean集合的beanutils的Maven依赖关系包括commons集合.如果您自己使用的是Commons集合,请使用的核心版本,并在Maven依赖项中包括Commons集合.

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.

这里对此进行了一些解释: http://commons.apache.org/beanutils/

This is where it is explained a bit: http://commons.apache.org/beanutils/

该页面上这样说:

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

这篇关于commons-collections和commons-beanutils中的重复类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆