From bd7c20eb1cb8a8bf292476dcc34e0fe96325df2b Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 21 Sep 2016 14:59:02 +0200 Subject: [PATCH] Deprecate Guava support --- .../boot/actuate/cache/GuavaCacheStatisticsProvider.java | 2 ++ .../boot/autoconfigure/cache/CacheProperties.java | 6 ++++++ .../springframework/boot/autoconfigure/cache/CacheType.java | 1 + .../src/main/asciidoc/spring-boot-features.adoc | 4 ++-- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cache/GuavaCacheStatisticsProvider.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cache/GuavaCacheStatisticsProvider.java index f6fe2a50fb..45bc43d79f 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cache/GuavaCacheStatisticsProvider.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cache/GuavaCacheStatisticsProvider.java @@ -26,7 +26,9 @@ import org.springframework.cache.guava.GuavaCache; * * @author Stephane Nicoll * @since 1.3.0 + * @deprecated as of 1.5 following the removal of Guava support in Spring Framework 5 */ +@Deprecated public class GuavaCacheStatisticsProvider implements CacheStatisticsProvider { @Override diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java index df7bdf5e95..347f42db4c 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.List; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; import org.springframework.core.io.Resource; import org.springframework.util.Assert; @@ -266,10 +267,15 @@ public class CacheProperties { */ private String spec; + @Deprecated + @DeprecatedConfigurationProperty( + reason = "Caffeine will supersede the Guava support in Spring Boot 2.0", + replacement = "spring.cache.caffeine.spec") public String getSpec() { return this.spec; } + @Deprecated public void setSpec(String spec) { this.spec = spec; } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java index 0399777eec..b5cfe8a254 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java @@ -69,6 +69,7 @@ public enum CacheType { /** * Guava backed caching. */ + @Deprecated GUAVA, /** diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 831758b571..a1b72a3ef5 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -3799,7 +3799,7 @@ providers (in this order): * <> * <> * <> -* <> +* <> (deprecated) * <> TIP: It is also possible to _force_ the cache provider to use via the `spring.cache.type` @@ -4019,7 +4019,7 @@ auto-configuration. [[boot-features-caching-provider-guava]] -==== Guava +==== Guava (deprecated) If Guava is present, a `GuavaCacheManager` is auto-configured. Caches can be created on startup using the `spring.cache.cache-names` property and customized by one of the following (in this order):