diff --git a/settings.gradle b/settings.gradle index aa84a52facb..a54f042a1a2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -50,6 +50,7 @@ include "spring-boot-project:spring-boot-artemis" include "spring-boot-project:spring-boot-autoconfigure" include "spring-boot-project:spring-boot-autoconfigure-all" include "spring-boot-project:spring-boot-batch" +include "spring-boot-project:spring-boot-cache" include "spring-boot-project:spring-boot-cassandra" include "spring-boot-project:spring-boot-couchbase" include "spring-boot-project:spring-boot-data-cassandra" diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index 5f2a7ccd0be..c241e089765 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -20,6 +20,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-activemq")) optional(project(":spring-boot-project:spring-boot-amqp")) optional(project(":spring-boot-project:spring-boot-artemis")) + optional(project(":spring-boot-project:spring-boot-cache")) optional(project(":spring-boot-project:spring-boot-couchbase")) optional(project(":spring-boot-project:spring-boot-data-cassandra")) optional(project(":spring-boot-project:spring-boot-data-elasticsearch")) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cache/CachesEndpointAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cache/CachesEndpointAutoConfiguration.java index 61212d91e1a..d9f4215f4c6 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cache/CachesEndpointAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cache/CachesEndpointAutoConfiguration.java @@ -24,7 +24,6 @@ import org.springframework.boot.actuate.cache.CachesEndpoint; import org.springframework.boot.actuate.cache.CachesEndpointWebExtension; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -38,7 +37,7 @@ import org.springframework.context.annotation.Bean; * @author Stephane Nicoll * @since 2.1.0 */ -@AutoConfiguration(after = CacheAutoConfiguration.class) +@AutoConfiguration(afterName = "org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration") @ConditionalOnClass(CacheManager.class) @ConditionalOnAvailableEndpoint(CachesEndpoint.class) public class CachesEndpointAutoConfiguration { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsAutoConfiguration.java index 10290a3670b..37c17bf3f63 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -19,7 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.metrics.cache; import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; @@ -32,7 +31,8 @@ import org.springframework.context.annotation.Import; * @author Stephane Nicoll * @since 2.0.0 */ -@AutoConfiguration(after = { MetricsAutoConfiguration.class, CacheAutoConfiguration.class }) +@AutoConfiguration(after = MetricsAutoConfiguration.class, + afterName = "org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration") @ConditionalOnBean(CacheManager.class) @Import({ CacheMeterBinderProvidersConfiguration.class, CacheMetricsRegistrarConfiguration.class }) public class CacheMetricsAutoConfiguration { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsAutoConfigurationTests.java index 194b31f4be2..00f924be850 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsAutoConfigurationTests.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.autoconfigure.metrics.test.MetricsRun; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration; +import org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.CachingConfigurer; diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle index 29bd9f244a3..3f74d5560a2 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -12,6 +12,7 @@ dependencies { api(project(":spring-boot-project:spring-boot-all")) dockerTestImplementation(project(":spring-boot-project:spring-boot-autoconfigure-all")) + dockerTestImplementation(project(":spring-boot-project:spring-boot-cache")) dockerTestImplementation(project(":spring-boot-project:spring-boot-neo4j")) dockerTestImplementation(project(":spring-boot-project:spring-boot-test")) dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker")) diff --git a/spring-boot-project/spring-boot-actuator/src/dockerTest/java/org/springframework/boot/actuate/metrics/cache/RedisCacheMetricsTests.java b/spring-boot-project/spring-boot-actuator/src/dockerTest/java/org/springframework/boot/actuate/metrics/cache/RedisCacheMetricsTests.java index d19e84cc7e5..e363532def6 100644 --- a/spring-boot-project/spring-boot-actuator/src/dockerTest/java/org/springframework/boot/actuate/metrics/cache/RedisCacheMetricsTests.java +++ b/spring-boot-project/spring-boot-actuator/src/dockerTest/java/org/springframework/boot/actuate/metrics/cache/RedisCacheMetricsTests.java @@ -28,7 +28,7 @@ import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration; +import org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration; import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableApplicationContext; import org.springframework.boot.test.context.runner.ApplicationContextRunner; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle index 798495f3f9f..fa99dad71fc 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle @@ -33,14 +33,12 @@ dependencies { dockerTestImplementation("org.junit.jupiter:junit-jupiter") dockerTestImplementation("org.mockito:mockito-core") dockerTestImplementation("org.springframework:spring-test") - dockerTestImplementation("org.testcontainers:couchbase") dockerTestImplementation("org.testcontainers:junit-jupiter") dockerTestImplementation("org.testcontainers:mongodb") dockerTestImplementation("org.testcontainers:testcontainers") optional(project(":spring-boot-project:spring-boot-activemq")) optional(project(":spring-boot-project:spring-boot-artemis")) - optional(project(":spring-boot-project:spring-boot-data-couchbase")) optional(project(":spring-boot-project:spring-boot-data-jpa")) optional(project(":spring-boot-project:spring-boot-data-mongodb")) optional(project(":spring-boot-project:spring-boot-data-redis")) @@ -67,7 +65,6 @@ dependencies { optional("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") optional("com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations") optional("com.fasterxml.jackson.module:jackson-module-parameter-names") - optional("com.hazelcast:hazelcast-spring") optional("com.nimbusds:oauth2-oidc-sdk") optional("com.oracle.database.jdbc:ojdbc11") optional("com.oracle.database.jdbc:ucp11") @@ -102,19 +99,12 @@ dependencies { optional("org.apache.tomcat:tomcat-jdbc") optional("org.apiguardian:apiguardian-api") optional("org.eclipse.angus:angus-mail") - optional("com.github.ben-manes.caffeine:caffeine") optional("com.zaxxer:HikariCP") optional("org.aspectj:aspectjweaver") - optional("org.cache2k:cache2k-spring") optional("org.eclipse.jetty.ee10:jetty-ee10-webapp") optional("org.eclipse.jetty:jetty-reactive-httpclient") optional("org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-server") optional("org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jetty-server") - optional("org.ehcache:ehcache") { - artifact { - classifier = 'jakarta' - } - } optional("org.glassfish.jersey.containers:jersey-container-servlet-core") optional("org.glassfish.jersey.containers:jersey-container-servlet") optional("org.glassfish.jersey.core:jersey-server") @@ -123,11 +113,6 @@ dependencies { optional("org.hibernate.orm:hibernate-core") optional("org.hibernate.orm:hibernate-jcache") optional("org.hibernate.validator:hibernate-validator") - optional("org.infinispan:infinispan-commons") - optional("org.infinispan:infinispan-component-annotations") - optional("org.infinispan:infinispan-core") - optional("org.infinispan:infinispan-jcache") - optional("org.infinispan:infinispan-spring6-embedded") optional("org.influxdb:influxdb-java") optional("org.jooq:jooq") optional("org.liquibase:liquibase-core") { @@ -150,7 +135,6 @@ dependencies { optional("org.springframework:spring-websocket") optional("org.springframework:spring-webflux") optional("org.springframework:spring-webmvc") - optional("org.springframework.data:spring-data-couchbase") optional("org.springframework.data:spring-data-envers") { exclude group: "javax.activation", module: "javax.activation-api" exclude group: "javax.persistence", module: "javax.persistence-api" diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 9b88586132b..6ded99689f0 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -514,17 +514,6 @@ } ], "hints": [ - { - "name": "spring.cache.jcache.provider", - "providers": [ - { - "name": "class-reference", - "parameters": { - "target": "javax.cache.spi.CachingProvider" - } - } - ] - }, { "name": "spring.graphql.cors.allowed-headers", "values": [ diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index e6e685fd28a..f6d2ecc2aa3 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,5 +1,4 @@ org.springframework.boot.autoconfigure.aop.AopAutoConfiguration -org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration org.springframework.boot.autoconfigure.graphql.data.GraphQlReactiveQueryByExampleAutoConfiguration diff --git a/spring-boot-project/spring-boot-autoconfigure/build.gradle b/spring-boot-project/spring-boot-autoconfigure/build.gradle index 11257fce073..446b59f9069 100644 --- a/spring-boot-project/spring-boot-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure/build.gradle @@ -22,6 +22,7 @@ dependencies { testFixturesCompileOnly(project(":spring-boot-project:spring-boot-test")) testFixturesCompileOnly(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + testFixturesCompileOnly("javax.cache:cache-api") testFixturesCompileOnly("jakarta.websocket:jakarta.websocket-api") testFixturesCompileOnly("jakarta.websocket:jakarta.websocket-client-api") diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java similarity index 94% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java rename to spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java index d46bb4142d4..98c82c6c824 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -22,7 +22,7 @@ package org.springframework.boot.autoconfigure.cache; * @author Stephane Nicoll * @author Phillip Webb * @author Eddú Meléndez - * @since 1.3.0 + * @since 4.0.0 */ public enum CacheType { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/package-info.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/package-info.java new file mode 100644 index 00000000000..972239b3af9 --- /dev/null +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2012-2025 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. + */ + +/** + * Auto-configuration base classes for Caching support. + */ +package org.springframework.boot.autoconfigure.cache; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/cache/hazelcast-specific.xml b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/cache/autoconfigure/hazelcast-specific.xml similarity index 100% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/cache/hazelcast-specific.xml rename to spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/cache/autoconfigure/hazelcast-specific.xml diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/support/MockCachingProvider.java b/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/cache/support/MockCachingProvider.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/support/MockCachingProvider.java rename to spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/cache/support/MockCachingProvider.java index d9e039d888e..c53137dc9a7 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/support/MockCachingProvider.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/cache/support/MockCachingProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. diff --git a/spring-boot-project/spring-boot-cache/build.gradle b/spring-boot-project/spring-boot-cache/build.gradle new file mode 100644 index 00000000000..353e480fbce --- /dev/null +++ b/spring-boot-project/spring-boot-cache/build.gradle @@ -0,0 +1,42 @@ +plugins { + id "java-library" + id "org.springframework.boot.auto-configuration" + id "org.springframework.boot.configuration-properties" + id "org.springframework.boot.deployed" + id "org.springframework.boot.optional-dependencies" +} + +description = "Spring Boot Cache" + +dependencies { + api(project(":spring-boot-project:spring-boot")) + api("org.springframework:spring-context-support") + + optional(project(":spring-boot-project:spring-boot-autoconfigure")) + optional(project(":spring-boot-project:spring-boot-data-couchbase")) + optional(project(":spring-boot-project:spring-boot-data-redis")) + optional(project(":spring-boot-project:spring-boot-hazelcast")) + optional(project(":spring-boot-project:spring-boot-jpa")) + optional("com.hazelcast:hazelcast-spring") + optional("org.cache2k:cache2k-spring") + optional("javax.cache:cache-api") + optional("org.ehcache:ehcache") { + artifact { + classifier = 'jakarta' + } + } + + optional("org.hibernate.orm:hibernate-core") + optional("org.hibernate.orm:hibernate-jcache") + optional("org.infinispan:infinispan-commons") + optional("org.infinispan:infinispan-component-annotations") + optional("org.infinispan:infinispan-core") + optional("org.infinispan:infinispan-jcache") + optional("org.infinispan:infinispan-spring6-embedded") + + testImplementation(project(":spring-boot-project:spring-boot-test")) + testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure"))) + + testRuntimeOnly("ch.qos.logback:logback-classic") +} diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/Cache2kBuilderCustomizer.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/Cache2kBuilderCustomizer.java similarity index 89% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/Cache2kBuilderCustomizer.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/Cache2kBuilderCustomizer.java index cd0383eaad5..c32aa218853 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/Cache2kBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/Cache2kBuilderCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import org.cache2k.Cache2kBuilder; @@ -25,7 +25,7 @@ import org.cache2k.Cache2kBuilder; * * @author Jens Wilke * @author Stephane Nicoll - * @since 2.7.0 + * @since 4.0.0 */ public interface Cache2kBuilderCustomizer { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/Cache2kCacheConfiguration.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/Cache2kCacheConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/Cache2kCacheConfiguration.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/Cache2kCacheConfiguration.java index 87dd84d5579..ed4ffe4d958 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/Cache2kCacheConfiguration.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/Cache2kCacheConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.util.Collection; import java.util.function.Function; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheAutoConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheAutoConfiguration.java index 646ad7df58e..9db02e932c5 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheAutoConfiguration.java @@ -14,17 +14,18 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration.CacheConfigurationImportSelector; -import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration.CacheManagerEntityManagerFactoryDependsOnConfiguration; +import org.springframework.boot.autoconfigure.cache.CacheType; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration.CacheConfigurationImportSelector; +import org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration.CacheManagerEntityManagerFactoryDependsOnConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.jpa.autoconfigure.EntityManagerFactoryDependsOnPostProcessor; import org.springframework.cache.CacheManager; @@ -47,7 +48,7 @@ import org.springframework.util.Assert; * Cache store can be auto-detected or specified explicitly through configuration. * * @author Stephane Nicoll - * @since 1.3.0 + * @since 4.0.0 * @see EnableCaching */ @AutoConfiguration(afterName = { "org.springframework.boot.data.couchbase.autoconfigure.CouchbaseDataAutoConfiguration", diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheCondition.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheCondition.java similarity index 93% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheCondition.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheCondition.java index 34159a584b5..ad2e2688563 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheCondition.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -14,8 +14,9 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; +import org.springframework.boot.autoconfigure.cache.CacheType; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheConfigurations.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheConfigurations.java similarity index 93% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheConfigurations.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheConfigurations.java index d380748f335..03f5664847d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheConfigurations.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheConfigurations.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -14,12 +14,13 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.util.Collections; import java.util.EnumMap; import java.util.Map; +import org.springframework.boot.autoconfigure.cache.CacheType; import org.springframework.util.Assert; /** diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizer.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizer.java similarity index 89% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizer.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizer.java index f65f85bb0b9..3e8d4bd9214 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizer.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import org.springframework.cache.CacheManager; @@ -24,7 +24,7 @@ import org.springframework.cache.CacheManager; * * @param the type of the {@link CacheManager} * @author Stephane Nicoll - * @since 1.3.3 + * @since 4.0.0 */ @FunctionalInterface public interface CacheManagerCustomizer { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizers.java similarity index 93% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizers.java index 7dd7bc930b3..3290b82cbfd 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizers.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.util.ArrayList; import java.util.Collections; @@ -28,7 +28,7 @@ import org.springframework.cache.CacheManager; * given {@link CacheManager}. * * @author Stephane Nicoll - * @since 1.5.0 + * @since 4.0.0 */ public class CacheManagerCustomizers { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheProperties.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheProperties.java index aee56be5151..00efab1c04a 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheProperties.java @@ -14,12 +14,13 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.time.Duration; import java.util.ArrayList; import java.util.List; +import org.springframework.boot.autoconfigure.cache.CacheType; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.core.io.Resource; import org.springframework.util.Assert; @@ -30,7 +31,7 @@ import org.springframework.util.Assert; * @author Stephane Nicoll * @author Eddú Meléndez * @author Ryon Day - * @since 1.3.0 + * @since 4.0.0 */ @ConfigurationProperties("spring.cache") public class CacheProperties { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CaffeineCacheConfiguration.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CaffeineCacheConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CaffeineCacheConfiguration.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CaffeineCacheConfiguration.java index 6145482660f..67077a2e41c 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CaffeineCacheConfiguration.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CaffeineCacheConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.util.List; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CouchbaseCacheConfiguration.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CouchbaseCacheConfiguration.java similarity index 94% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CouchbaseCacheConfiguration.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CouchbaseCacheConfiguration.java index c4b4930f295..c59c6086d67 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CouchbaseCacheConfiguration.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CouchbaseCacheConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.util.LinkedHashSet; import java.util.List; @@ -22,10 +22,10 @@ import java.util.List; import com.couchbase.client.java.Cluster; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.autoconfigure.cache.CacheProperties.Couchbase; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate; +import org.springframework.boot.cache.autoconfigure.CacheProperties.Couchbase; import org.springframework.cache.CacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CouchbaseCacheManagerBuilderCustomizer.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CouchbaseCacheManagerBuilderCustomizer.java similarity index 90% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CouchbaseCacheManagerBuilderCustomizer.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CouchbaseCacheManagerBuilderCustomizer.java index 22081335947..011960d252f 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CouchbaseCacheManagerBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CouchbaseCacheManagerBuilderCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import org.springframework.data.couchbase.cache.CouchbaseCacheManager; import org.springframework.data.couchbase.cache.CouchbaseCacheManager.CouchbaseCacheManagerBuilder; @@ -25,7 +25,7 @@ import org.springframework.data.couchbase.cache.CouchbaseCacheManager.CouchbaseC * {@link CouchbaseCacheManager}. * * @author Stephane Nicoll - * @since 2.3.3 + * @since 4.0.0 */ @FunctionalInterface public interface CouchbaseCacheManagerBuilderCustomizer { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/GenericCacheConfiguration.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/GenericCacheConfiguration.java similarity index 93% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/GenericCacheConfiguration.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/GenericCacheConfiguration.java index b6ce554a4c1..331435712c2 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/GenericCacheConfiguration.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/GenericCacheConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.util.Collection; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastCacheConfiguration.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/HazelcastCacheConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastCacheConfiguration.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/HazelcastCacheConfiguration.java index 76d56d44ff2..daa6d0d9e8b 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastCacheConfiguration.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/HazelcastCacheConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import com.hazelcast.core.HazelcastInstance; import com.hazelcast.spring.cache.HazelcastCacheManager; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastJCacheCustomizationConfiguration.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/HazelcastJCacheCustomizationConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastJCacheCustomizationConfiguration.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/HazelcastJCacheCustomizationConfiguration.java index 7832328506e..1aaa19e1e31 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastJCacheCustomizationConfiguration.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/HazelcastJCacheCustomizationConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.io.IOException; import java.net.URI; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/InfinispanCacheConfiguration.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/InfinispanCacheConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/InfinispanCacheConfiguration.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/InfinispanCacheConfiguration.java index 13409c6a814..44f2834d66d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/InfinispanCacheConfiguration.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/InfinispanCacheConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.io.IOException; import java.io.InputStream; @@ -41,7 +41,7 @@ import org.springframework.util.CollectionUtils; * @author Eddú Meléndez * @author Stephane Nicoll * @author Raja Kolli - * @since 1.3.0 + * @since 4.0.0 */ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(SpringEmbeddedCacheManager.class) diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCacheCacheConfiguration.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCacheCacheConfiguration.java index e040229da3e..7faf8930503 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCacheCacheConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.io.IOException; import java.util.Iterator; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheManagerCustomizer.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCacheManagerCustomizer.java similarity index 89% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheManagerCustomizer.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCacheManagerCustomizer.java index b12028682e5..9f50543d4ce 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheManagerCustomizer.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCacheManagerCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import javax.cache.CacheManager; @@ -23,7 +23,7 @@ import javax.cache.CacheManager; * manager before it is used, in particular to create additional caches. * * @author Stephane Nicoll - * @since 1.3.0 + * @since 4.0.0 */ @FunctionalInterface public interface JCacheManagerCustomizer { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/JCachePropertiesCustomizer.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCachePropertiesCustomizer.java similarity index 90% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/JCachePropertiesCustomizer.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCachePropertiesCustomizer.java index 1663dd4742e..88ec79fa2fd 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/JCachePropertiesCustomizer.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCachePropertiesCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.util.Properties; @@ -26,7 +26,7 @@ import javax.cache.spi.CachingProvider; * used by the {@link CachingProvider} to create the {@link CacheManager}. * * @author Stephane Nicoll - * @since 3.4.0 + * @since 4.0.0 * @see CachingProvider#getCacheManager(java.net.URI, ClassLoader, Properties) */ public interface JCachePropertiesCustomizer { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/NoOpCacheConfiguration.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/NoOpCacheConfiguration.java similarity index 92% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/NoOpCacheConfiguration.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/NoOpCacheConfiguration.java index 508fe825d6c..02b437ccc5a 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/NoOpCacheConfiguration.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/NoOpCacheConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.cache.CacheManager; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/RedisCacheConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/RedisCacheConfiguration.java index fe8b332eeac..68567596eb3 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/RedisCacheConfiguration.java @@ -14,17 +14,17 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.util.LinkedHashSet; import java.util.List; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.cache.CacheProperties.Redis; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.cache.autoconfigure.CacheProperties.Redis; import org.springframework.cache.CacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheManagerBuilderCustomizer.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/RedisCacheManagerBuilderCustomizer.java similarity index 89% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheManagerBuilderCustomizer.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/RedisCacheManagerBuilderCustomizer.java index 79560c4d6ee..0103c36afaf 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheManagerBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/RedisCacheManagerBuilderCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import org.springframework.data.redis.cache.RedisCacheManager.RedisCacheManagerBuilder; @@ -22,7 +22,7 @@ import org.springframework.data.redis.cache.RedisCacheManager.RedisCacheManagerB * Callback interface that can be used to customize a {@link RedisCacheManagerBuilder}. * * @author Dmytro Nosan - * @since 2.2.0 + * @since 4.0.0 */ @FunctionalInterface public interface RedisCacheManagerBuilderCustomizer { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/SimpleCacheConfiguration.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/SimpleCacheConfiguration.java similarity index 93% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/SimpleCacheConfiguration.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/SimpleCacheConfiguration.java index 26fcfd16b4e..1650d76820e 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/SimpleCacheConfiguration.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/SimpleCacheConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.util.List; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/package-info.java b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/package-info.java similarity index 85% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/package-info.java rename to spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/package-info.java index c5faeffa26e..f9eaab7bded 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/package-info.java +++ b/spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -17,4 +17,4 @@ /** * Auto-configuration for the cache abstraction. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; diff --git a/spring-boot-project/spring-boot-cache/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-cache/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 00000000000..d58a9ce0f05 --- /dev/null +++ b/spring-boot-project/spring-boot-cache/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,17 @@ +{ + "groups": [], + "properties": [], + "hints": [ + { + "name": "spring.cache.jcache.provider", + "providers": [ + { + "name": "class-reference", + "parameters": { + "target": "javax.cache.spi.CachingProvider" + } + } + ] + } + ] +} diff --git a/spring-boot-project/spring-boot-cache/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-cache/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 00000000000..29caa971636 --- /dev/null +++ b/spring-boot-project/spring-boot-cache/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/AbstractCacheAutoConfigurationTests.java b/spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/AbstractCacheAutoConfigurationTests.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/AbstractCacheAutoConfigurationTests.java rename to spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/AbstractCacheAutoConfigurationTests.java index 7567f912874..35a70edff92 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/AbstractCacheAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/AbstractCacheAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.util.ArrayList; import java.util.Arrays; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java b/spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/CacheAutoConfigurationTests.java similarity index 99% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java rename to spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/CacheAutoConfigurationTests.java index fe6cb5b69c5..3d53a4a1432 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/CacheAutoConfigurationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -431,7 +431,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests { @Test void jCacheCacheWithConfig() { String cachingProviderFqn = MockCachingProvider.class.getName(); - String configLocation = "org/springframework/boot/autoconfigure/cache/hazelcast-specific.xml"; + String configLocation = "org/springframework/boot/cache/autoconfigure/hazelcast-specific.xml"; this.contextRunner.withUserConfiguration(JCacheCustomConfiguration.class) .withPropertyValues("spring.cache.type=jcache", "spring.cache.jcache.provider=" + cachingProviderFqn, "spring.cache.jcache.config=" + configLocation) @@ -445,7 +445,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests { @Test void jCacheCacheWithWrongConfig() { String cachingProviderFqn = MockCachingProvider.class.getName(); - String configLocation = "org/springframework/boot/autoconfigure/cache/does-not-exist.xml"; + String configLocation = "org/springframework/boot/cache/autoconfigure/does-not-exist.xml"; this.contextRunner.withUserConfiguration(JCacheCustomConfiguration.class) .withPropertyValues("spring.cache.type=jcache", "spring.cache.jcache.provider=" + cachingProviderFqn, "spring.cache.jcache.config=" + configLocation) @@ -519,7 +519,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests { @Test void hazelcastCacheWithHazelcastAutoConfiguration() { - String hazelcastConfig = "org/springframework/boot/autoconfigure/cache/hazelcast-specific.xml"; + String hazelcastConfig = "org/springframework/boot/cache/autoconfigure/hazelcast-specific.xml"; this.contextRunner.withConfiguration(AutoConfigurations.of(HazelcastAutoConfiguration.class)) .withUserConfiguration(DefaultCacheConfiguration.class) .withPropertyValues("spring.cache.type=hazelcast", "spring.hazelcast.config=" + hazelcastConfig) diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizersTests.java b/spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizersTests.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizersTests.java rename to spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizersTests.java index f7e23cdb799..b0eee6398fd 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizersTests.java +++ b/spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import java.util.ArrayList; import java.util.Arrays; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/EhCache3CacheAutoConfigurationTests.java b/spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/EhCache3CacheAutoConfigurationTests.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/EhCache3CacheAutoConfigurationTests.java rename to spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/EhCache3CacheAutoConfigurationTests.java index 92f66b9ac9b..22ed838fb1e 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/EhCache3CacheAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/EhCache3CacheAutoConfigurationTests.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.cache; +package org.springframework.boot.cache.autoconfigure; import org.ehcache.jsr107.EhcacheCachingProvider; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.cache.CacheAutoConfigurationTests.DefaultCacheConfiguration; +import org.springframework.boot.cache.autoconfigure.CacheAutoConfigurationTests.DefaultCacheConfiguration; import org.springframework.boot.testsupport.classpath.ClassPathExclusions; import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.cache.jcache.JCacheCacheManager; diff --git a/spring-boot-project/spring-boot-cache/src/test/resources/META-INF/services/javax.cache.spi.CachingProvider b/spring-boot-project/spring-boot-cache/src/test/resources/META-INF/services/javax.cache.spi.CachingProvider new file mode 100644 index 00000000000..a9ea8c43aa2 --- /dev/null +++ b/spring-boot-project/spring-boot-cache/src/test/resources/META-INF/services/javax.cache.spi.CachingProvider @@ -0,0 +1,4 @@ +# +# Test JSR 107 provider for testing purposes only. +# +org.springframework.boot.autoconfigure.cache.support.MockCachingProvider \ No newline at end of file diff --git a/spring-boot-project/spring-boot-cache/src/test/resources/org/springframework/boot/cache/autoconfigure/hazelcast-specific.xml b/spring-boot-project/spring-boot-cache/src/test/resources/org/springframework/boot/cache/autoconfigure/hazelcast-specific.xml new file mode 100644 index 00000000000..f5a30301dca --- /dev/null +++ b/spring-boot-project/spring-boot-cache/src/test/resources/org/springframework/boot/cache/autoconfigure/hazelcast-specific.xml @@ -0,0 +1,19 @@ + + + + + + 3600 + 600 + + + + + + + + + + diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 2e5dac829c5..ddcde028e0b 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -2021,6 +2021,7 @@ bom { "spring-boot-autoconfigure-processor", "spring-boot-batch", "spring-boot-buildpack-platform", + "spring-boot-cache", "spring-boot-cassandra", "spring-boot-configuration-metadata", "spring-boot-configuration-processor", diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index 38dee10b1b5..a761b5b8cfe 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -60,6 +60,7 @@ dependencies { autoConfiguration(project(path: ":spring-boot-project:spring-boot-autoconfigure", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-autoconfigure-all", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-batch", configuration: "autoConfigurationMetadata")) + autoConfiguration(project(path: ":spring-boot-project:spring-boot-cache", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-cassandra", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-couchbase", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-cassandra", configuration: "autoConfigurationMetadata")) @@ -123,6 +124,7 @@ dependencies { configurationProperties(project(path: ":spring-boot-project:spring-boot-autoconfigure", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-autoconfigure-all", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-batch", configuration: "configurationPropertiesMetadata")) + configurationProperties(project(path: ":spring-boot-project:spring-boot-cache", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-cassandra", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-couchbase", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-data-cassandra", configuration: "configurationPropertiesMetadata")) @@ -183,6 +185,7 @@ dependencies { implementation(project(path: ":spring-boot-project:spring-boot-actuator-autoconfigure")) implementation(project(path: ":spring-boot-project:spring-boot-amqp")) implementation(project(path: ":spring-boot-project:spring-boot-autoconfigure-all")) + implementation(project(path: ":spring-boot-project:spring-boot-cache")) implementation(project(path: ":spring-boot-project:spring-boot-data-cassandra")) implementation(project(path: ":spring-boot-project:spring-boot-data-elasticsearch")) implementation(project(path: ":spring-boot-project:spring-boot-data-neo4j")) diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/MyCacheManagerConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/MyCacheManagerConfiguration.java index d0aa481a967..786f7bd36c1 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/MyCacheManagerConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/MyCacheManagerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 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. @@ -16,7 +16,7 @@ package org.springframework.boot.docs.io.caching.provider; -import org.springframework.boot.autoconfigure.cache.CacheManagerCustomizer; +import org.springframework.boot.cache.autoconfigure.CacheManagerCustomizer; import org.springframework.cache.concurrent.ConcurrentMapCacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/cache2k/MyCache2kDefaultsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/cache2k/MyCache2kDefaultsConfiguration.java index 8e18d6071d7..ac44cc8f3a2 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/cache2k/MyCache2kDefaultsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/cache2k/MyCache2kDefaultsConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -18,7 +18,7 @@ package org.springframework.boot.docs.io.caching.provider.cache2k; import java.util.concurrent.TimeUnit; -import org.springframework.boot.autoconfigure.cache.Cache2kBuilderCustomizer; +import org.springframework.boot.cache.autoconfigure.Cache2kBuilderCustomizer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.java index 7f1e22a9237..b59c710ab4c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -18,7 +18,7 @@ package org.springframework.boot.docs.io.caching.provider.couchbase; import java.time.Duration; -import org.springframework.boot.autoconfigure.cache.CouchbaseCacheManagerBuilderCustomizer; +import org.springframework.boot.cache.autoconfigure.CouchbaseCacheManagerBuilderCustomizer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.couchbase.cache.CouchbaseCacheConfiguration; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/redis/MyRedisCacheManagerConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/redis/MyRedisCacheManagerConfiguration.java index 7a8695a3c8e..abdfc97df07 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/redis/MyRedisCacheManagerConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/redis/MyRedisCacheManagerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 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. @@ -18,7 +18,7 @@ package org.springframework.boot.docs.io.caching.provider.redis; import java.time.Duration; -import org.springframework.boot.autoconfigure.cache.RedisCacheManagerBuilderCustomizer; +import org.springframework.boot.cache.autoconfigure.RedisCacheManagerBuilderCustomizer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.cache.RedisCacheConfiguration; diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/MyCacheManagerConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/MyCacheManagerConfiguration.kt index 4975de209da..60438320be1 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/MyCacheManagerConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/MyCacheManagerConfiguration.kt @@ -16,7 +16,7 @@ package org.springframework.boot.docs.io.caching.provider -import org.springframework.boot.autoconfigure.cache.CacheManagerCustomizer +import org.springframework.boot.cache.autoconfigure.CacheManagerCustomizer import org.springframework.cache.concurrent.ConcurrentMapCacheManager import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/cache2k/MyCache2kDefaultsConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/cache2k/MyCache2kDefaultsConfiguration.kt index b359d6e5d78..dbb17970dd9 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/cache2k/MyCache2kDefaultsConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/cache2k/MyCache2kDefaultsConfiguration.kt @@ -1,6 +1,6 @@ package org.springframework.boot.docs.io.caching.provider.cache2k -import org.springframework.boot.autoconfigure.cache.Cache2kBuilderCustomizer +import org.springframework.boot.cache.autoconfigure.Cache2kBuilderCustomizer import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import java.util.concurrent.TimeUnit diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.kt index 4d992f91d02..897cebcc576 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.kt @@ -16,7 +16,7 @@ package org.springframework.boot.docs.io.caching.provider.couchbase -import org.springframework.boot.autoconfigure.cache.CouchbaseCacheManagerBuilderCustomizer +import org.springframework.boot.cache.autoconfigure.CouchbaseCacheManagerBuilderCustomizer import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.data.couchbase.cache.CouchbaseCacheConfiguration diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/redis/MyRedisCacheManagerConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/redis/MyRedisCacheManagerConfiguration.kt index 38943347fc8..7cc407836c2 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/redis/MyRedisCacheManagerConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/redis/MyRedisCacheManagerConfiguration.kt @@ -16,7 +16,7 @@ package org.springframework.boot.docs.io.caching.provider.redis -import org.springframework.boot.autoconfigure.cache.RedisCacheManagerBuilderCustomizer +import org.springframework.boot.cache.autoconfigure.RedisCacheManagerBuilderCustomizer import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.data.redis.cache.RedisCacheConfiguration diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-cache/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-cache/build.gradle index bb7fb848571..f2d8824ed33 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-cache/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-cache/build.gradle @@ -6,5 +6,5 @@ description = "Starter for using Spring Framework's caching support" dependencies { api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter")) - api("org.springframework:spring-context-support") + api(project(":spring-boot-project:spring-boot-cache")) } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle index c9a684d3189..9da3d1fc0a1 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle @@ -36,6 +36,7 @@ dependencies { dockerTestRuntimeOnly("io.lettuce:lettuce-core") dockerTestRuntimeOnly("org.springframework.data:spring-data-redis") + optional(project(":spring-boot-project:spring-boot-cache")) optional(project(":spring-boot-project:spring-boot-data-cassandra")) optional(project(":spring-boot-project:spring-boot-data-couchbase")) optional(project(":spring-boot-project:spring-boot-data-elasticsearch")) diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/core/AutoConfigureCache.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/core/AutoConfigureCache.java index 275c4eb853e..846cbc4ca5e 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/core/AutoConfigureCache.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/core/AutoConfigureCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.core.AutoConfigureCache.imports b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.core.AutoConfigureCache.imports index 4cd7501b5a5..25dc15614b0 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.core.AutoConfigureCache.imports +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.core.AutoConfigureCache.imports @@ -1,2 +1,2 @@ # AutoConfigureCache auto-configuration imports -org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration +optional:org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestIntegrationTests.java index 533e4d3f9b7..74644fa2f52 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestIntegrationTests.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration; +import org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration; import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.liquibase.autoconfigure.LiquibaseAutoConfiguration; import org.springframework.boot.test.autoconfigure.orm.jpa.ExampleComponent;