【问题标题】:How to disable the Ehcache update checker?如何禁用 Ehcache 更新检查器?
【发布时间】:2010-03-09 06:58:46
【问题描述】:

12:18:55,541 INFO [UpdateChecker] 发现新更新:2.0.0 [http://ehcache.org/news.html]

如何禁止 ehcache 检查新更新,这在加载我的 j2ee 应用程序和初始化 ehcache 时发生。

【问题讨论】:

  • 此功能完全失败。我无法理解他们为什么这样做。想象一下,如果一个应用程序的所有 20 个依赖项都这样做会发生什么!
  • @cherouvim:完全同意。谷歌搜索显示一个Jira issue,它在 5 年前因“无法修复”而关闭。开源软件的行为方式令人难以置信。

标签: ehcache


【解决方案1】:

一种方法是在您的类路径中放置一个ehcache.xml 文件,并在根标记中使用属性updateCheck="false"

例如:

<ehcache updateCheck="false">
  <defaultCache
    maxElementsInMemory="0"
    eternal="false"
    timeToIdleSeconds="0"
    timeToLiveSeconds="0"
    overflowToDisk="false"
    diskPersistent="false"/>
</ehcache>

另一种方法是设置环境变量:

System.setProperty("net.sf.ehcache.skipUpdateCheck", "true");

【讨论】:

【解决方案2】:

简单地说,在你的 ehcache.xml 配置文件中,确保你禁用 updateCheck :

<ehcache updateCheck="false">

<defaultCache
        maxElementsInMemory="0"
        eternal="false"
        timeToIdleSeconds="0"
        timeToLiveSeconds="0"
        overflowToDisk="false"
        diskPersistent="false"
        />
</ehcache>

【讨论】:

  • 文件必须在类路径的根目录下。
猜你喜欢
  • 2019-08-01
  • 2011-01-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-11-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多