java - 选择正确版本的 Apache Commons Logging

标签 java dependency-management

我依赖于几个 Apache TLP(顶级项目),如 Apache Axis、Commons HttpClient、Commons DBCP、Commons Transaction 等。

这些项目中的每一个都依赖于 JCL(Commons Logging),并且每个项目都依赖于不同版本的 JCL。

我应该选择哪个版本的 JCL - 最高版本是否是最佳选择?更高版本的 JCL 是否与针对较低版本编译的项目兼容(一些项目是针对 JCL 的 1.0.x 版本编译的,而其他项目是针对 1.1.x 编译的)? JCL 项目本身是否在某处传达了此信息?

最佳答案

RELEASE-NOTES版本 1.1.1 说以下内容:

== Incompatibilities ==

The protected method LogFactory.getContextClassLoader has been reverted to pre-1.1
behaviour. In earlier releases, this method did not use an AccessController when
obtaining the context classloader. In version 1.1 it did. In this release, it has
reverted to not using an AccessController; any user-level code that needs to obtain
a context classloader should itself create an AccessController, and call the
LogFactory.getContextClassLoader method via the doPrivileged method. This fixes a
potential security issue, where untrusted code could get access to the context
classloader if a signed Commons Logging library was in the classpath.

这对我来说听起来很具体。我会尝试最新版本 (1.1.1) 并查看是否出现问题。

关于java - 选择正确版本的 Apache Commons Logging,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1392634/

相关文章:

c++ - 您如何在团队环境中管理大型 C++ 依赖项?

java - Maven 拒绝从远程存储库下载 aar 打包的依赖项

android - 如何使用 gradle 从 maven repo 中正确删除传递依赖

java - 在 Android 中使用 Intent

java - 在 JgraphX 中旋转边缘标签

c++ - 滥用 soversion minor revision 来支持可选的依赖

java - Ivy 不会发布到我的本地存储库

java - qrgen 和 zxing 库出现 java.lang.NoSuchMethodError 异常

java - 如何在 Spring 中将 SQLErrorCodeSQLExceptionTranslator 和 DAO 类与 @Repository 一起使用?

java - 如何在 RxJava 中让多个订阅者订阅一个分组的 Observable?