Drop support for EhCache 3 until it supports Jakarta EE 9
Closes gh-28800
This commit is contained in:
parent
a17d6f9791
commit
ba19440f8c
|
@ -85,7 +85,6 @@ dependencies {
|
|||
exclude group: "javax.websocket", module: "javax.websocket-client-api"
|
||||
exclude group: "org.eclipse.jetty", module: "jetty-jndi"
|
||||
}
|
||||
optional("org.ehcache:ehcache")
|
||||
optional("org.elasticsearch.client:elasticsearch-rest-client") {
|
||||
exclude group: "commons-logging", module: "commons-logging"
|
||||
}
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.cache;
|
||||
|
||||
import org.ehcache.jsr107.EhcacheCachingProvider;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.autoconfigure.cache.CacheAutoConfigurationTests.DefaultCacheConfiguration;
|
||||
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
|
||||
import org.springframework.cache.jcache.JCacheCacheManager;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Tests for {@link CacheAutoConfiguration} with EhCache 3.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
@ClassPathExclusions("ehcache-2*.jar")
|
||||
class EhCache3CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests {
|
||||
|
||||
@Test
|
||||
void ehcache3AsJCacheWithCaches() {
|
||||
String cachingProviderFqn = EhcacheCachingProvider.class.getName();
|
||||
this.contextRunner.withUserConfiguration(DefaultCacheConfiguration.class)
|
||||
.withPropertyValues("spring.cache.type=jcache", "spring.cache.jcache.provider=" + cachingProviderFqn,
|
||||
"spring.cache.cacheNames[0]=foo", "spring.cache.cacheNames[1]=bar")
|
||||
.run((context) -> {
|
||||
JCacheCacheManager cacheManager = getCacheManager(context, JCacheCacheManager.class);
|
||||
assertThat(cacheManager.getCacheNames()).containsOnly("foo", "bar");
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void ehcache3AsJCacheWithConfig() {
|
||||
String cachingProviderFqn = EhcacheCachingProvider.class.getName();
|
||||
String configLocation = "ehcache3.xml";
|
||||
this.contextRunner.withUserConfiguration(DefaultCacheConfiguration.class)
|
||||
.withPropertyValues("spring.cache.type=jcache", "spring.cache.jcache.provider=" + cachingProviderFqn,
|
||||
"spring.cache.jcache.config=" + configLocation)
|
||||
.run((context) -> {
|
||||
JCacheCacheManager cacheManager = getCacheManager(context, JCacheCacheManager.class);
|
||||
|
||||
Resource configResource = new ClassPathResource(configLocation);
|
||||
assertThat(cacheManager.getCacheManager().getURI()).isEqualTo(configResource.getURI());
|
||||
assertThat(cacheManager.getCacheNames()).containsOnly("foo", "bar");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package org.springframework.boot.autoconfigure.orm.jpa;
|
||||
|
||||
import org.ehcache.jsr107.EhcacheCachingProvider;
|
||||
import com.hazelcast.cache.impl.HazelcastServerCachingProvider;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
|
@ -41,9 +41,9 @@ class Hibernate2ndLevelCacheIntegrationTests {
|
|||
.withUserConfiguration(TestConfiguration.class);
|
||||
|
||||
@Test
|
||||
void hibernate2ndLevelCacheWithJCacheAndEhCache3() {
|
||||
String cachingProviderFqn = EhcacheCachingProvider.class.getName();
|
||||
String configLocation = "ehcache3.xml";
|
||||
void hibernate2ndLevelCacheWithJCacheAndHazelcast() {
|
||||
String cachingProviderFqn = HazelcastServerCachingProvider.class.getName();
|
||||
String configLocation = "classpath:hazelcast.xml";
|
||||
this.contextRunner
|
||||
.withPropertyValues("spring.cache.type=jcache", "spring.cache.jcache.provider=" + cachingProviderFqn,
|
||||
"spring.cache.jcache.config=" + configLocation,
|
||||
|
|
|
@ -192,15 +192,6 @@ bom {
|
|||
]
|
||||
}
|
||||
}
|
||||
library("Ehcache3", "3.9.7") {
|
||||
group("org.ehcache") {
|
||||
modules = [
|
||||
"ehcache",
|
||||
"ehcache-clustered",
|
||||
"ehcache-transactions"
|
||||
]
|
||||
}
|
||||
}
|
||||
library("Elasticsearch", "7.15.2") {
|
||||
group("org.elasticsearch") {
|
||||
modules = [
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
== IO
|
||||
If your application needs IO capabilities, see one or more of the following sections:
|
||||
|
||||
* *Caching:* <<io#io.caching, Caching support EhCache, Hazelcast and more>>
|
||||
* *Caching:* <<io#io.caching, Caching support with Hazelcast and more>>
|
||||
* *Quartz:* <<io#io.quartz, Quartz Scheduling>>
|
||||
* *Mail:* <<io#io.email, Sending Email>>
|
||||
* *Validation:* <<io#io.validation, JSR-303 Validation>>
|
||||
|
|
|
@ -40,7 +40,7 @@ The cache abstraction does not provide an actual store and relies on abstraction
|
|||
If you have not defined a bean of type `CacheManager` or a `CacheResolver` named `cacheResolver` (see {spring-framework-api}/cache/annotation/CachingConfigurer.html[`CachingConfigurer`]), Spring Boot tries to detect the following providers (in the indicated order):
|
||||
|
||||
. <<io#io.caching.provider.generic,Generic>>
|
||||
. <<io#io.caching.provider.jcache,JCache (JSR-107)>> (EhCache 3, Hazelcast, and others)
|
||||
. <<io#io.caching.provider.jcache,JCache (JSR-107)>> (Hazelcast and others)
|
||||
. <<io#io.caching.provider.hazelcast,Hazelcast>>
|
||||
. <<io#io.caching.provider.redis,Redis>>
|
||||
. <<io#io.caching.provider.caffeine,Caffeine>>
|
||||
|
|
|
@ -9,10 +9,6 @@ def caches = [
|
|||
"caffeine": [
|
||||
"com.github.ben-manes.caffeine:caffeine"
|
||||
],
|
||||
"ehcache": [
|
||||
"javax.cache:cache-api",
|
||||
"org.ehcache:ehcache"
|
||||
],
|
||||
"hazelcast": [
|
||||
"com.hazelcast:hazelcast",
|
||||
"com.hazelcast:hazelcast-spring"
|
||||
|
|
Loading…
Reference in New Issue