diff --git a/spring-boot-project/spring-boot-autoconfigure/build.gradle b/spring-boot-project/spring-boot-autoconfigure/build.gradle index aa43500724..6dc6fa794d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure/build.gradle @@ -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" } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/EhCache3CacheAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/EhCache3CacheAutoConfigurationTests.java deleted file mode 100644 index d3b0d56ec4..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/EhCache3CacheAutoConfigurationTests.java +++ /dev/null @@ -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"); - }); - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/Hibernate2ndLevelCacheIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/Hibernate2ndLevelCacheIntegrationTests.java index 049ae5abe9..51ec12e62f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/Hibernate2ndLevelCacheIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/Hibernate2ndLevelCacheIntegrationTests.java @@ -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, diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index cc3f143caa..7b9132a3e7 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -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 = [ diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/documentation/io.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/documentation/io.adoc index a3d419fbd9..38e458d4b1 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/documentation/io.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/documentation/io.adoc @@ -2,7 +2,7 @@ == IO If your application needs IO capabilities, see one or more of the following sections: -* *Caching:* <> +* *Caching:* <> * *Quartz:* <> * *Mail:* <> * *Validation:* <> diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/io/caching.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/io/caching.adoc index 0cfd5aa340..7956eddb13 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/io/caching.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/io/caching.adoc @@ -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): . <> -. <> (EhCache 3, Hazelcast, and others) +. <> (Hazelcast and others) . <> . <> . <> diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle index b8642417d7..7664156c00 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle @@ -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"