请勿使用 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>

下面的示例显示了在 pom.xml

	<dependency><groupId>org.ehcache</groupId> <artifactId>诶诶诶诶诶诶诶诶诶诶诶诶诶</artifactId> <version>3.10.8</version> <classifier>雅加达</classifier></dependency>

有关更多信息,请参阅以下资源: