Browse Source

Create spring-boot-cache module

See gh-46132
pull/46230/head
Stéphane Nicoll 9 months ago committed by Andy Wilkinson
parent
commit
23e8b315fe
  1. 1
      settings.gradle
  2. 1
      spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle
  3. 3
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cache/CachesEndpointAutoConfiguration.java
  4. 4
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsAutoConfiguration.java
  5. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsAutoConfigurationTests.java
  6. 1
      spring-boot-project/spring-boot-actuator/build.gradle
  7. 2
      spring-boot-project/spring-boot-actuator/src/dockerTest/java/org/springframework/boot/actuate/metrics/cache/RedisCacheMetricsTests.java
  8. 16
      spring-boot-project/spring-boot-autoconfigure-all/build.gradle
  9. 11
      spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json
  10. 1
      spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  11. 1
      spring-boot-project/spring-boot-autoconfigure/build.gradle
  12. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java
  13. 20
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/package-info.java
  14. 0
      spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/cache/autoconfigure/hazelcast-specific.xml
  15. 0
      spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/cache/support/MockCachingProvider.java
  16. 58
      spring-boot-project/spring-boot-cache/build.gradle
  17. 4
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/Cache2kBuilderCustomizer.java
  18. 2
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/Cache2kCacheConfiguration.java
  19. 9
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheAutoConfiguration.java
  20. 3
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheCondition.java
  21. 3
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheConfigurations.java
  22. 4
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizer.java
  23. 4
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizers.java
  24. 5
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheProperties.java
  25. 2
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CaffeineCacheConfiguration.java
  26. 4
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CouchbaseCacheConfiguration.java
  27. 4
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CouchbaseCacheManagerBuilderCustomizer.java
  28. 2
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/GenericCacheConfiguration.java
  29. 2
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/HazelcastCacheConfiguration.java
  30. 2
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/HazelcastJCacheCustomizationConfiguration.java
  31. 4
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/InfinispanCacheConfiguration.java
  32. 2
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCacheCacheConfiguration.java
  33. 4
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCacheManagerCustomizer.java
  34. 4
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCachePropertiesCustomizer.java
  35. 2
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/NoOpCacheConfiguration.java
  36. 4
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/RedisCacheConfiguration.java
  37. 4
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/RedisCacheManagerBuilderCustomizer.java
  38. 2
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/SimpleCacheConfiguration.java
  39. 2
      spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/package-info.java
  40. 17
      spring-boot-project/spring-boot-cache/src/main/resources/META-INF/additional-spring-configuration-metadata.json
  41. 1
      spring-boot-project/spring-boot-cache/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  42. 2
      spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/AbstractCacheAutoConfigurationTests.java
  43. 8
      spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/CacheAutoConfigurationTests.java
  44. 2
      spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizersTests.java
  45. 4
      spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/EhCache3CacheAutoConfigurationTests.java
  46. 4
      spring-boot-project/spring-boot-cache/src/test/resources/META-INF/services/javax.cache.spi.CachingProvider
  47. 19
      spring-boot-project/spring-boot-cache/src/test/resources/org/springframework/boot/cache/autoconfigure/hazelcast-specific.xml
  48. 1
      spring-boot-project/spring-boot-dependencies/build.gradle
  49. 3
      spring-boot-project/spring-boot-docs/build.gradle
  50. 2
      spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/MyCacheManagerConfiguration.java
  51. 2
      spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/cache2k/MyCache2kDefaultsConfiguration.java
  52. 2
      spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.java
  53. 2
      spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/redis/MyRedisCacheManagerConfiguration.java
  54. 2
      spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/MyCacheManagerConfiguration.kt
  55. 2
      spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/cache2k/MyCache2kDefaultsConfiguration.kt
  56. 2
      spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.kt
  57. 2
      spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/redis/MyRedisCacheManagerConfiguration.kt
  58. 2
      spring-boot-project/spring-boot-starters/spring-boot-starter-cache/build.gradle
  59. 1
      spring-boot-project/spring-boot-test-autoconfigure/build.gradle
  60. 2
      spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.core.AutoConfigureCache.imports
  61. 2
      spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestIntegrationTests.java

1
settings.gradle

@ -66,6 +66,7 @@ include "spring-boot-project:spring-boot-artemis" @@ -66,6 +66,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"

1
spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

@ -36,6 +36,7 @@ dependencies { @@ -36,6 +36,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"))

3
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cache/CachesEndpointAutoConfiguration.java vendored

@ -24,7 +24,6 @@ import org.springframework.boot.actuate.cache.CachesEndpoint; @@ -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; @@ -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 {

4
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsAutoConfiguration.java vendored

@ -19,7 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.metrics.cache; @@ -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; @@ -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 {

2
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsAutoConfigurationTests.java vendored

@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; @@ -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;

1
spring-boot-project/spring-boot-actuator/build.gradle

@ -28,6 +28,7 @@ dependencies { @@ -28,6 +28,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"))

2
spring-boot-project/spring-boot-actuator/src/dockerTest/java/org/springframework/boot/actuate/metrics/cache/RedisCacheMetricsTests.java vendored

@ -28,7 +28,7 @@ import org.testcontainers.junit.jupiter.Container; @@ -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;

16
spring-boot-project/spring-boot-autoconfigure-all/build.gradle

@ -50,14 +50,12 @@ dependencies { @@ -50,14 +50,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"))
@ -84,7 +82,6 @@ dependencies { @@ -84,7 +82,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")
@ -116,19 +113,12 @@ dependencies { @@ -116,19 +113,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")
@ -137,11 +127,6 @@ dependencies { @@ -137,11 +127,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") {
@ -164,7 +149,6 @@ dependencies { @@ -164,7 +149,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"

11
spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@ -520,17 +520,6 @@ @@ -520,17 +520,6 @@
}
],
"hints": [
{
"name": "spring.cache.jcache.provider",
"providers": [
{
"name": "class-reference",
"parameters": {
"target": "javax.cache.spi.CachingProvider"
}
}
]
},
{
"name": "spring.graphql.cors.allowed-headers",
"values": [

1
spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@ -1,5 +1,4 @@ @@ -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

1
spring-boot-project/spring-boot-autoconfigure/build.gradle

@ -39,6 +39,7 @@ dependencies { @@ -39,6 +39,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")
testFixturesImplementation(testFixtures(project(":spring-boot-project:spring-boot")))

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java → spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheType.java vendored

@ -22,7 +22,7 @@ package org.springframework.boot.autoconfigure.cache; @@ -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 {

20
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/package-info.java vendored

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
/*
* Copyright 2012-present 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;

0
spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/cache/hazelcast-specific.xml → spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/cache/autoconfigure/hazelcast-specific.xml vendored

0
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/support/MockCachingProvider.java → spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/cache/support/MockCachingProvider.java vendored

58
spring-boot-project/spring-boot-cache/build.gradle vendored

@ -0,0 +1,58 @@ @@ -0,0 +1,58 @@
/*
* Copyright 2012-present 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.
*/
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")
}

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/Cache2kBuilderCustomizer.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/Cache2kBuilderCustomizer.java vendored

@ -14,7 +14,7 @@ @@ -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; @@ -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 {

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/Cache2kCacheConfiguration.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/Cache2kCacheConfiguration.java vendored

@ -14,7 +14,7 @@ @@ -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;

9
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheAutoConfiguration.java vendored

@ -14,17 +14,18 @@ @@ -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; @@ -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",

3
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheCondition.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheCondition.java vendored

@ -14,8 +14,9 @@ @@ -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;

3
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheConfigurations.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheConfigurations.java vendored

@ -14,12 +14,13 @@ @@ -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;
/**

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizer.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizer.java vendored

@ -14,7 +14,7 @@ @@ -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; @@ -24,7 +24,7 @@ import org.springframework.cache.CacheManager;
*
* @param <T> the type of the {@link CacheManager}
* @author Stephane Nicoll
* @since 1.3.3
* @since 4.0.0
*/
@FunctionalInterface
public interface CacheManagerCustomizer<T extends CacheManager> {

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizers.java vendored

@ -14,7 +14,7 @@ @@ -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; @@ -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 {

5
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CacheProperties.java vendored

@ -14,12 +14,13 @@ @@ -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; @@ -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 {

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CaffeineCacheConfiguration.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CaffeineCacheConfiguration.java vendored

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.cache;
package org.springframework.boot.cache.autoconfigure;
import java.util.List;

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CouchbaseCacheConfiguration.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CouchbaseCacheConfiguration.java vendored

@ -14,7 +14,7 @@ @@ -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; @@ -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;

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CouchbaseCacheManagerBuilderCustomizer.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/CouchbaseCacheManagerBuilderCustomizer.java vendored

@ -14,7 +14,7 @@ @@ -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 @@ -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 {

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/GenericCacheConfiguration.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/GenericCacheConfiguration.java vendored

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.cache;
package org.springframework.boot.cache.autoconfigure;
import java.util.Collection;

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastCacheConfiguration.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/HazelcastCacheConfiguration.java vendored

@ -14,7 +14,7 @@ @@ -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;

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastJCacheCustomizationConfiguration.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/HazelcastJCacheCustomizationConfiguration.java vendored

@ -14,7 +14,7 @@ @@ -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;

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/InfinispanCacheConfiguration.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/InfinispanCacheConfiguration.java vendored

@ -14,7 +14,7 @@ @@ -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; @@ -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)

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCacheCacheConfiguration.java vendored

@ -14,7 +14,7 @@ @@ -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;

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheManagerCustomizer.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCacheManagerCustomizer.java vendored

@ -14,7 +14,7 @@ @@ -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; @@ -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 {

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/JCachePropertiesCustomizer.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/JCachePropertiesCustomizer.java vendored

@ -14,7 +14,7 @@ @@ -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; @@ -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 {

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/NoOpCacheConfiguration.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/NoOpCacheConfiguration.java vendored

@ -14,7 +14,7 @@ @@ -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;

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/RedisCacheConfiguration.java vendored

@ -14,17 +14,17 @@ @@ -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;

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheManagerBuilderCustomizer.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/RedisCacheManagerBuilderCustomizer.java vendored

@ -14,7 +14,7 @@ @@ -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 @@ -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 {

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/SimpleCacheConfiguration.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/SimpleCacheConfiguration.java vendored

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.cache;
package org.springframework.boot.cache.autoconfigure;
import java.util.List;

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/package-info.java → spring-boot-project/spring-boot-cache/src/main/java/org/springframework/boot/cache/autoconfigure/package-info.java vendored

@ -17,4 +17,4 @@ @@ -17,4 +17,4 @@
/**
* Auto-configuration for the cache abstraction.
*/
package org.springframework.boot.autoconfigure.cache;
package org.springframework.boot.cache.autoconfigure;

17
spring-boot-project/spring-boot-cache/src/main/resources/META-INF/additional-spring-configuration-metadata.json vendored

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
{
"groups": [],
"properties": [],
"hints": [
{
"name": "spring.cache.jcache.provider",
"providers": [
{
"name": "class-reference",
"parameters": {
"target": "javax.cache.spi.CachingProvider"
}
}
]
}
]
}

1
spring-boot-project/spring-boot-cache/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration

2
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/AbstractCacheAutoConfigurationTests.java → spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/AbstractCacheAutoConfigurationTests.java vendored

@ -14,7 +14,7 @@ @@ -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;

8
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java → spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/CacheAutoConfigurationTests.java vendored

@ -14,7 +14,7 @@ @@ -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 { @@ -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 { @@ -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 { @@ -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)

2
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizersTests.java → spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/CacheManagerCustomizersTests.java vendored

@ -14,7 +14,7 @@ @@ -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;

4
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/EhCache3CacheAutoConfigurationTests.java → spring-boot-project/spring-boot-cache/src/test/java/org/springframework/boot/cache/autoconfigure/EhCache3CacheAutoConfigurationTests.java vendored

@ -14,12 +14,12 @@ @@ -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;

4
spring-boot-project/spring-boot-cache/src/test/resources/META-INF/services/javax.cache.spi.CachingProvider vendored

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
#
# Test JSR 107 provider for testing purposes only.
#
org.springframework.boot.autoconfigure.cache.support.MockCachingProvider

19
spring-boot-project/spring-boot-cache/src/test/resources/org/springframework/boot/cache/autoconfigure/hazelcast-specific.xml vendored

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-5.0.xsd"
xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<queue name="foobar"/>
<map name="foobar">
<time-to-live-seconds>3600</time-to-live-seconds>
<max-idle-seconds>600</max-idle-seconds>
</map>
<network>
<join>
<auto-detection enabled="false" />
<multicast enabled="false"/>
</join>
</network>
</hazelcast>

1
spring-boot-project/spring-boot-dependencies/build.gradle

@ -1992,6 +1992,7 @@ bom { @@ -1992,6 +1992,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",

3
spring-boot-project/spring-boot-docs/build.gradle

@ -82,6 +82,7 @@ dependencies { @@ -82,6 +82,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"))
@ -145,6 +146,7 @@ dependencies { @@ -145,6 +146,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"))
@ -205,6 +207,7 @@ dependencies { @@ -205,6 +207,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"))

2
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/MyCacheManagerConfiguration.java

@ -16,7 +16,7 @@ @@ -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;

2
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/cache2k/MyCache2kDefaultsConfiguration.java

@ -18,7 +18,7 @@ package org.springframework.boot.docs.io.caching.provider.cache2k; @@ -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;

2
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.java

@ -18,7 +18,7 @@ package org.springframework.boot.docs.io.caching.provider.couchbase; @@ -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;

2
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/caching/provider/redis/MyRedisCacheManagerConfiguration.java

@ -18,7 +18,7 @@ package org.springframework.boot.docs.io.caching.provider.redis; @@ -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;

2
spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/MyCacheManagerConfiguration.kt

@ -16,7 +16,7 @@ @@ -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

2
spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/cache2k/MyCache2kDefaultsConfiguration.kt

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
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

2
spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/couchbase/MyCouchbaseCacheManagerConfiguration.kt

@ -16,7 +16,7 @@ @@ -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

2
spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/caching/provider/redis/MyRedisCacheManagerConfiguration.kt

@ -16,7 +16,7 @@ @@ -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

2
spring-boot-project/spring-boot-starters/spring-boot-starter-cache/build.gradle vendored

@ -22,5 +22,5 @@ description = "Starter for using Spring Framework's caching support" @@ -22,5 +22,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"))
}

1
spring-boot-project/spring-boot-test-autoconfigure/build.gradle

@ -53,6 +53,7 @@ dependencies { @@ -53,6 +53,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"))

2
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 @@ @@ -1,2 +1,2 @@
# AutoConfigureCache auto-configuration imports
org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration
optional:org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration

2
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; @@ -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;

Loading…
Cancel
Save