請勿使用 Ehcache 2.x

Spring 框架 不支援。 6.0 Ehcache 2.x 該規則標記使用 org.springframework.cache.ehcache 包裝或存在 ehcache.xml 檔案中。

Ehcache 3 是直接替換。 更新您的相依性以使用 org.ehcache:ehcachejakarta 個 沒有更新版本的 org.springframework.cache.ehcache因此,建議透過 JCache API 或其新的本機 API 使用 Ehcache。

以下範例顯示一個 ehcache.xml 檔案,該檔案被 此規則標記的檔案。

	<ehcache>
		<diskStore path="java.io.tmpdir"/>
		<defaultCache
			maxElementsInMemory="1000"
			eternal="false"
			timeToIdleSeconds="120"
			timeToLiveSeconds="120"
			overflowToDisk="true"/>
	</ehcache>

以下範例顯示更新後的 maven 相依性,在 pom.xml

	<dependency><groupId>org.ehcache</groupId> <artifactId>咹全</artifactId> <version>3.10.8</version> <classifier>雅加達</classifier></dependency>

如需相關資訊,請參閱下列資源: