【问题标题】:Choosing the right version of Apache Commons Logging选择正确版本的 Apache Commons Logging
【发布时间】:2009-09-08 08:10:04
【问题描述】:

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

每个项目都依赖于 JCL(Commons Logging),每个项目都依赖于不同版本的 JCL。

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

【问题讨论】:

    标签: java dependency-management


    【解决方案1】:

    1.1.1 版的RELEASE-NOTES 表示如下:

    == 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),看看是否出现问题。

    【讨论】:

    • 一点也不坏。事实上,谢谢你的开始——至少他们没有谈论 API 不兼容,除了这个。我只是担心 Commons 项目本身需要进行哪些更改以及它们是否已经完成。
    猜你喜欢
    • 2018-09-13
    • 2011-08-24
    • 2023-03-10
    • 2016-01-25
    • 1970-01-01
    • 1970-01-01
    • 2010-10-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多