2010-03-09 39 views
25

12:18:55541 INFO [UpdateChecker]新發現的更新(S):2.0.0 [http://ehcache.org/news.html]如何禁用Ehcache更新檢查器?

我如何抑制了Ehcache檢查新的更新(S),這是在加載我的J2EE應用程序中發生的事情,當ehcache正在初始化。

+10

此功能是完全失敗。我不明白他們爲什麼這樣做。想象一下,如果一個應用程序的所有20個依賴項都這樣做了會發生什麼! – cherouvim 2010-08-14 07:11:49

+0

@cherouvim:完全同意。谷歌搜索顯示一個[Jira問題](https://jira.terracotta.org/jira/browse/EHC-461),5年前關閉爲「不會修復」。讓開源軟件表現出令人難以置信的干擾方式。 – 2014-11-13 00:47:27

回答

30

一種方法是在類路徑中放置一個ehcache.xml

使用根標籤中的屬性updateCheck=」false」,困擾已消失。

在這裏你可以找到更多關於它的信息:http://www.svenlange.co.za/2010/02/disable-ehcaches-updatechecker-in-grails-application

另一種方法是做到以下幾點:

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

正是我所期待的 - 謝謝。修改ehcache.xml有幫助,並且它已經存在於類路徑 – Joe 2010-03-12 03:56:52

+2

實際上,這是部分正確的,sys prop設置將起作用,但僅僅將ehcache xml文件放在類路徑的根目錄下不會。您還必須將updateCheck =「false」添加到外部ehcache元素,如下所述@Anthony Dahanne和文檔中:http://ehcache.org/documentation/user-guide/configuration – TechTrip 2013-02-25 15:24:15

+0

當前配置文檔位於http:// www.ehcache.org/documentation/2.8/configuration/configuration.html#update-checker – Gregor 2017-05-26 14:43:18

4

還有另外一種方式:在配置文件ehcache.xml中中關閉更新選項UpdateCheck的= 「假」,如下示例:

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="ehcache.xsd" 
    updateCheck="false" monitoring="autodetect" 
    dynamicConfig="true"> 
16

簡單地說,在ehcache.xml中的配置文件,確保您禁用UpdateCheck的:

<ehcache updateCheck="false"> 

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

該文件必須位於類路徑的根目錄中。 – Tires 2013-08-20 18:26:45