From 81f87b2bc2d6b7ee958cea7029a479a660ced9f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Fri, 28 Mar 2025 14:11:55 +0100 Subject: [PATCH] Create spring-boot-data-redis module --- settings.gradle | 1 + .../build.gradle | 1 + ...disHealthContributorAutoConfiguration.java | 4 +- ...iveHealthContributorAutoConfiguration.java | 3 +- .../LettuceMetricsAutoConfiguration.java | 10 +- ...althContributorAutoConfigurationTests.java | 4 +- ...althContributorAutoConfigurationTests.java | 4 +- ...intsAutoConfigurationIntegrationTests.java | 4 +- .../LettuceMetricsAutoConfigurationTests.java | 4 +- .../spring-boot-actuator/build.gradle | 1 + .../metrics/cache/RedisCacheMetricsTests.java | 4 +- .../build.gradle | 3 +- ...iveSessionAutoConfigurationRedisTests.java | 6 +- .../SessionAutoConfigurationRedisTests.java | 4 +- .../cache/CacheAutoConfiguration.java | 6 +- .../cache/RedisCacheConfiguration.java | 5 +- .../session/SessionAutoConfiguration.java | 10 +- ...itional-spring-configuration-metadata.json | 312 ----------------- .../main/resources/META-INF/spring.factories | 4 - ...ot.autoconfigure.AutoConfiguration.imports | 3 - .../spring-boot-data-redis/build.gradle | 32 ++ ...disRepositoriesAutoConfigurationTests.java | 17 +- .../ClientResourcesBuilderCustomizer.java | 6 +- ...sClientConfigurationBuilderCustomizer.java | 6 +- .../JedisConnectionConfiguration.java | 2 +- ...eClientConfigurationBuilderCustomizer.java | 6 +- ...LettuceClientOptionsBuilderCustomizer.java | 6 +- .../LettuceConnectionConfiguration.java | 6 +- .../PropertiesRedisConnectionDetails.java | 2 +- .../RedisAutoConfiguration.java | 4 +- .../RedisConnectionConfiguration.java | 10 +- .../RedisConnectionDetails.java | 4 +- .../redis/autoconfigure}/RedisProperties.java | 4 +- .../RedisReactiveAutoConfiguration.java | 6 +- .../RedisRepositoriesAutoConfiguration.java | 4 +- .../RedisRepositoriesRegistrar.java | 4 +- .../data/redis/autoconfigure}/RedisUrl.java | 2 +- .../RedisUrlSyntaxException.java | 4 +- .../RedisUrlSyntaxFailureAnalyzer.java | 4 +- .../redis/autoconfigure}/package-info.java | 4 +- ...itional-spring-configuration-metadata.json | 319 ++++++++++++++++++ .../main/resources/META-INF/spring.factories | 4 + ...ot.autoconfigure.AutoConfiguration.imports | 3 + ...PropertiesRedisConnectionDetailsTests.java | 4 +- .../RedisAutoConfigurationJedisTests.java | 2 +- ...rationLettuceWithoutCommonsPool2Tests.java | 4 +- .../RedisAutoConfigurationTests.java | 4 +- .../autoconfigure}/RedisPropertiesTests.java | 6 +- .../RedisReactiveAutoConfigurationTests.java | 4 +- .../RedisUrlSyntaxFailureAnalyzerTests.java | 4 +- .../boot/data/redis/domain}/city/City.java | 4 +- .../redis/domain}/city/CityRepository.java | 4 +- .../redis/domain/empty/EmptyPackage.java} | 9 +- .../boot/data/redis/autoconfigure}/test.jks | Bin .../spring-boot-dependencies/build.gradle | 1 + .../spring-boot-docker-compose/build.gradle | 1 + ...nectionDetailsFactoryIntegrationTests.java | 4 +- ...DockerComposeConnectionDetailsFactory.java | 2 +- .../spring-boot-docs/build.gradle | 2 + .../modules/reference/pages/data/nosql.adoc | 6 +- .../pages/features/dev-services.adoc | 2 +- .../pages/testing/testcontainers.adoc | 4 +- .../build.gradle | 3 +- .../build.gradle | 3 +- .../build.gradle | 1 + ....data.redis.AutoConfigureDataRedis.imports | 6 +- .../spring-boot-testcontainers/build.gradle | 1 + ...rviceConnectionAutoConfigurationTests.java | 6 +- ...ontainerConnectionDetailsFactoryTests.java | 2 +- ...ontainerConnectionDetailsFactoryTests.java | 6 +- ...ontainerConnectionDetailsFactoryTests.java | 6 +- ...ontainerConnectionDetailsFactoryTests.java | 6 +- ...edisContainerConnectionDetailsFactory.java | 2 +- 73 files changed, 499 insertions(+), 462 deletions(-) create mode 100644 spring-boot-project/spring-boot-data-redis/build.gradle rename spring-boot-project/{spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/dockerTest/java/org/springframework/boot/data/redis/autoconfigure}/RedisRepositoriesAutoConfigurationTests.java (84%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/ClientResourcesBuilderCustomizer.java (89%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/JedisClientConfigurationBuilderCustomizer.java (91%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/JedisConnectionConfiguration.java (99%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/LettuceClientConfigurationBuilderCustomizer.java (92%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/LettuceClientOptionsBuilderCustomizer.java (91%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/LettuceConnectionConfiguration.java (98%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/PropertiesRedisConnectionDetails.java (98%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/RedisAutoConfiguration.java (97%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/RedisConnectionConfiguration.java (95%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/RedisConnectionDetails.java (98%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/RedisProperties.java (99%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/RedisReactiveAutoConfiguration.java (95%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/RedisRepositoriesAutoConfiguration.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/RedisRepositoriesRegistrar.java (93%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/RedisUrl.java (97%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/RedisUrlSyntaxException.java (90%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/RedisUrlSyntaxFailureAnalyzer.java (95%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure}/package-info.java (84%) create mode 100644 spring-boot-project/spring-boot-data-redis/src/main/resources/META-INF/additional-spring-configuration-metadata.json create mode 100644 spring-boot-project/spring-boot-data-redis/src/main/resources/META-INF/spring.factories create mode 100644 spring-boot-project/spring-boot-data-redis/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure}/PropertiesRedisConnectionDetailsTests.java (98%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure}/RedisAutoConfigurationJedisTests.java (99%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure}/RedisAutoConfigurationLettuceWithoutCommonsPool2Tests.java (94%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure}/RedisAutoConfigurationTests.java (99%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure}/RedisPropertiesTests.java (87%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure}/RedisReactiveAutoConfigurationTests.java (92%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure}/RedisUrlSyntaxFailureAnalyzerTests.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/domain}/city/City.java (92%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/domain}/city/CityRepository.java (89%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/alt/redis/CityRedisRepository.java => spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/domain/empty/EmptyPackage.java} (64%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/data/redis => spring-boot-data-redis/src/test/resources/org/springframework/boot/data/redis/autoconfigure}/test.jks (100%) diff --git a/settings.gradle b/settings.gradle index 71a4b177744..ae3017c5218 100644 --- a/settings.gradle +++ b/settings.gradle @@ -58,6 +58,7 @@ include "spring-boot-project:spring-boot-data-jpa" include "spring-boot-project:spring-boot-data-ldap" include "spring-boot-project:spring-boot-data-mongodb" include "spring-boot-project:spring-boot-data-neo4j" +include "spring-boot-project:spring-boot-data-redis" include "spring-boot-project:spring-boot-dependencies" include "spring-boot-project:spring-boot-devtools" include "spring-boot-project:spring-boot-docker-compose" diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index 0ba1f57347a..a1393529df9 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -26,6 +26,7 @@ dependencies { 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-neo4j")) + optional(project(":spring-boot-project:spring-boot-data-redis")) optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-hazelcast")) optional(project(":spring-boot-project:spring-boot-http")) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfiguration.java index 22aacbbdb90..2a75103033d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfiguration.java @@ -26,7 +26,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 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.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.data.redis.connection.RedisConnectionFactory; @@ -39,7 +38,8 @@ import org.springframework.data.redis.connection.RedisConnectionFactory; * @author Mark Paluch * @since 2.1.0 */ -@AutoConfiguration(after = { RedisAutoConfiguration.class, RedisReactiveHealthContributorAutoConfiguration.class }) +@AutoConfiguration(after = RedisReactiveHealthContributorAutoConfiguration.class, + afterName = "org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration") @ConditionalOnClass(RedisConnectionFactory.class) @ConditionalOnBean(RedisConnectionFactory.class) @ConditionalOnEnabledHealthIndicator("redis") diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java index 1b69195ad0c..2f22a65422f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java @@ -28,7 +28,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 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.autoconfigure.data.redis.RedisReactiveAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory; @@ -42,7 +41,7 @@ import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory; * @author Mark Paluch * @since 2.1.0 */ -@AutoConfiguration(after = RedisReactiveAutoConfiguration.class) +@AutoConfiguration(afterName = "org.springframework.boot.data.redis.autoconfigure.RedisReactiveAutoConfiguration") @ConditionalOnClass({ ReactiveRedisConnectionFactory.class, Flux.class }) @ConditionalOnBean(ReactiveRedisConnectionFactory.class) @ConditionalOnEnabledHealthIndicator("redis") diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/redis/LettuceMetricsAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/redis/LettuceMetricsAutoConfiguration.java index 3b7bc7a8024..0db75b8ba13 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/redis/LettuceMetricsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/redis/LettuceMetricsAutoConfiguration.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. @@ -27,8 +27,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; 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.autoconfigure.data.redis.ClientResourcesBuilderCustomizer; -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.ClientResourcesBuilderCustomizer; import org.springframework.context.annotation.Bean; /** @@ -38,9 +37,10 @@ import org.springframework.context.annotation.Bean; * @author Yanming Zhou * @since 2.6.0 */ -@AutoConfiguration(before = RedisAutoConfiguration.class, +@AutoConfiguration(beforeName = "org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration", after = { MetricsAutoConfiguration.class, CompositeMeterRegistryAutoConfiguration.class }) -@ConditionalOnClass({ RedisClient.class, MicrometerCommandLatencyRecorder.class }) +@ConditionalOnClass({ ClientResourcesBuilderCustomizer.class, RedisClient.class, + MicrometerCommandLatencyRecorder.class }) @ConditionalOnBean(MeterRegistry.class) public class LettuceMetricsAutoConfiguration { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfigurationTests.java index eda99dd58f3..f5bbfb49668 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfigurationTests.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. @@ -22,7 +22,7 @@ import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAu import org.springframework.boot.actuate.data.redis.RedisHealthIndicator; import org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.testsupport.classpath.ClassPathExclusions; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfigurationTests.java index 59c121f0b03..7a635bdf189 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfigurationTests.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. @@ -22,7 +22,7 @@ import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAu import org.springframework.boot.actuate.data.redis.RedisHealthIndicator; import org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java index 95aa41db281..2b774cfea6c 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java @@ -24,8 +24,6 @@ import org.springframework.boot.actuate.autoconfigure.tracing.OpenTelemetryTraci import org.springframework.boot.actuate.health.HealthEndpointWebExtension; import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration; import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration; import org.springframework.boot.cassandra.autoconfigure.CassandraAutoConfiguration; import org.springframework.boot.context.annotation.UserConfigurations; @@ -35,6 +33,8 @@ import org.springframework.boot.data.mongodb.autoconfigure.MongoDataAutoConfigur import org.springframework.boot.data.mongodb.autoconfigure.MongoReactiveDataAutoConfiguration; import org.springframework.boot.data.neo4j.autoconfigure.Neo4jDataAutoConfiguration; import org.springframework.boot.data.neo4j.autoconfigure.Neo4jReactiveDataAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.RedisRepositoriesAutoConfiguration; import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration; import org.springframework.boot.liquibase.autoconfigure.LiquibaseAutoConfiguration; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/redis/LettuceMetricsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/redis/LettuceMetricsAutoConfigurationTests.java index c2479f3fbd1..1f0d282e3dd 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/redis/LettuceMetricsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/redis/LettuceMetricsAutoConfigurationTests.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. @@ -23,7 +23,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.data.redis.RedisAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle index e7d73aac6d5..29bd9f244a3 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -26,6 +26,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-activemq")) optional(project(":spring-boot-project:spring-boot-data-cassandra")) + optional(project(":spring-boot-project:spring-boot-data-redis")) optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-http")) optional(project(":spring-boot-project:spring-boot-integration")) 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 0d200299ff2..d19e84cc7e5 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 @@ -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. @@ -29,7 +29,7 @@ import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableApplicationContext; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ContextConsumer; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle index ef05f7d7c87..2a5c55365ce 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle @@ -43,6 +43,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-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")) optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-h2console")) optional(project(":spring-boot-project:spring-boot-hazelcast")) @@ -158,7 +159,6 @@ dependencies { optional("org.springframework.data:spring-data-jdbc") optional("org.springframework.data:spring-data-mongodb") optional("org.springframework.data:spring-data-r2dbc") - optional("org.springframework.data:spring-data-redis") optional("org.springframework.graphql:spring-graphql") optional("org.springframework.hateoas:spring-hateoas") optional("org.springframework.security:spring-security-acl") @@ -183,7 +183,6 @@ dependencies { optional("org.springframework.session:spring-session-jdbc") optional("org.springframework.amqp:spring-rabbit") optional("org.springframework.amqp:spring-rabbit-stream") - optional("redis.clients:jedis") testImplementation(project(":spring-boot-project:spring-boot-freemarker")) testImplementation(project(":spring-boot-project:spring-boot-gson")) diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/session/ReactiveSessionAutoConfigurationRedisTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/session/ReactiveSessionAutoConfigurationRedisTests.java index 5387e5579e0..b21b832c97e 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/session/ReactiveSessionAutoConfigurationRedisTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/session/ReactiveSessionAutoConfigurationRedisTests.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. @@ -27,10 +27,10 @@ import org.testcontainers.junit.jupiter.Testcontainers; import reactor.core.publisher.Mono; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.autoconfigure.web.reactive.WebSessionIdResolverAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.RedisReactiveAutoConfiguration; import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ContextConsumer; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.java index 5233fd3ad92..d2bac83073e 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.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. @@ -25,9 +25,9 @@ import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.source.InvalidConfigurationPropertyValueException; +import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; import org.springframework.boot.test.context.runner.ContextConsumer; 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-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java index 92cad5d9046..831c28d78c0 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-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java @@ -26,7 +26,6 @@ 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.autoconfigure.data.couchbase.CouchbaseDataAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.jpa.autoconfigure.EntityManagerFactoryDependsOnPostProcessor; import org.springframework.cache.CacheManager; @@ -52,8 +51,9 @@ import org.springframework.util.Assert; * @since 1.3.0 * @see EnableCaching */ -@AutoConfiguration(after = { CouchbaseDataAutoConfiguration.class, RedisAutoConfiguration.class }, - afterName = { "org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration", +@AutoConfiguration(after = CouchbaseDataAutoConfiguration.class, + afterName = { "org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration", + "org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration", "org.springframework.boot.jpa.autoconfigure.hibernate.HibernateJpaAutoConfiguration" }) @ConditionalOnClass(CacheManager.class) @ConditionalOnBean(CacheAspectSupport.class) 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-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java index ebd8ca33cfa..fe8b332eeac 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-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.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. @@ -25,7 +25,6 @@ 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.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.cache.CacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; @@ -46,7 +45,7 @@ import org.springframework.data.redis.serializer.RedisSerializationContext.Seria */ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(RedisConnectionFactory.class) -@AutoConfigureAfter(RedisAutoConfiguration.class) +@AutoConfigureAfter(name = "org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration") @ConditionalOnBean(RedisConnectionFactory.class) @ConditionalOnMissingBean(CacheManager.class) @Conditional(CacheCondition.class) diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java index ccc3a9da3f4..ac3a49fd772 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java @@ -27,8 +27,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration; @@ -63,14 +61,14 @@ import org.springframework.session.web.http.HttpSessionIdResolver; * @author Weix Sun * @since 1.4.0 */ -@AutoConfiguration( - after = { RedisAutoConfiguration.class, RedisReactiveAutoConfiguration.class, - WebSessionIdResolverAutoConfiguration.class }, +@AutoConfiguration(after = WebSessionIdResolverAutoConfiguration.class, afterName = { "org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration", "org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration", "org.springframework.boot.jdbc.autoconfigure.JdbcTemplateAutoConfiguration", "org.springframework.boot.data.mongodb.autoconfigure.MongoDataAutoConfiguration", - "org.springframework.boot.data.mongodb.autoconfigure.MongoReactiveDataAutoConfiguration" }, + "org.springframework.boot.data.mongodb.autoconfigure.MongoReactiveDataAutoConfiguration", + "org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration", + "org.springframework.boot.data.redis.autoconfigure.RedisReactiveAutoConfiguration" }, before = { HttpHandlerAutoConfiguration.class, WebFluxAutoConfiguration.class }) @ConditionalOnClass(Session.class) @ConditionalOnWebApplication 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 6f5fd3135d6..621dbdbcab2 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 @@ -44,20 +44,6 @@ "description": "Whether to enable R2DBC repositories.", "defaultValue": true }, - { - "name": "spring.data.redis.repositories.enabled", - "type": "java.lang.Boolean", - "description": "Whether to enable Redis repositories.", - "defaultValue": true - }, - { - "name": "spring.data.redis.ssl", - "type": "java.lang.Boolean", - "deprecation": { - "replacement": "spring.data.redis.ssl.enabled", - "level": "error" - } - }, { "name": "spring.graphql.schema.file-extensions", "defaultValue": ".graphqls,.gqls" @@ -294,258 +280,6 @@ "replacement": "spring.reactor.debug-agent.enabled" } }, - { - "name": "spring.redis.client-name", - "type": "java.lang.String", - "deprecation": { - "replacement": "spring.data.redis.client-name", - "level": "error" - } - }, - { - "name": "spring.redis.client-type", - "type": "org.springframework.boot.autoconfigure.data.redis.RedisProperties$ClientType", - "deprecation": { - "replacement": "spring.data.redis.client-type", - "level": "error" - } - }, - { - "name": "spring.redis.cluster.max-redirects", - "type": "java.lang.Integer", - "deprecation": { - "replacement": "spring.data.redis.cluster.max-redirects", - "level": "error" - } - }, - { - "name": "spring.redis.cluster.nodes", - "type": "java.util.List", - "deprecation": { - "replacement": "spring.data.redis.cluster.nodes", - "level": "error" - } - }, - { - "name": "spring.redis.connect-timeout", - "type": "java.time.Duration", - "deprecation": { - "replacement": "spring.data.redis.connect-timeout", - "level": "error" - } - }, - { - "name": "spring.redis.database", - "type": "java.lang.Integer", - "deprecation": { - "replacement": "spring.data.redis.database", - "level": "error" - } - }, - { - "name": "spring.redis.host", - "type": "java.lang.String", - "deprecation": { - "replacement": "spring.data.redis.host", - "level": "error" - } - }, - { - "name": "spring.redis.jedis.pool.enabled", - "type": "java.lang.Boolean", - "deprecation": { - "level": "error" - } - }, - { - "name": "spring.redis.jedis.pool.max-active", - "type": "java.lang.Integer", - "deprecation": { - "level": "error" - } - }, - { - "name": "spring.redis.jedis.pool.max-idle", - "type": "java.lang.Integer", - "deprecation": { - "level": "error" - } - }, - { - "name": "spring.redis.jedis.pool.max-wait", - "type": "java.time.Duration", - "deprecation": { - "level": "error" - } - }, - { - "name": "spring.redis.jedis.pool.min-idle", - "type": "java.lang.Integer", - "deprecation": { - "level": "error" - } - }, - { - "name": "spring.redis.jedis.pool.time-between-eviction-runs", - "type": "java.time.Duration", - "deprecation": { - "level": "error" - } - }, - { - "name": "spring.redis.lettuce.cluster.refresh.adaptive", - "type": "java.lang.Boolean", - "deprecation": { - "replacement": "spring.data.redis.lettuce.cluster.refresh.adaptive", - "level": "error" - } - }, - { - "name": "spring.redis.lettuce.cluster.refresh.dynamic-refresh-sources", - "type": "java.lang.Boolean", - "deprecation": { - "replacement": "spring.data.redis.lettuce.cluster.refresh.dynamic-refresh-sources", - "level": "error" - } - }, - { - "name": "spring.redis.lettuce.cluster.refresh.period", - "type": "java.time.Duration", - "deprecation": { - "replacement": "spring.data.redis.lettuce.cluster.refresh.period", - "level": "error" - } - }, - { - "name": "spring.redis.lettuce.pool.enabled", - "type": "java.lang.Boolean", - "deprecation": { - "level": "error" - } - }, - { - "name": "spring.redis.lettuce.pool.max-active", - "type": "java.lang.Integer", - "deprecation": { - "level": "error" - } - }, - { - "name": "spring.redis.lettuce.pool.max-idle", - "type": "java.lang.Integer", - "deprecation": { - "level": "error" - } - }, - { - "name": "spring.redis.lettuce.pool.max-wait", - "type": "java.time.Duration", - "deprecation": { - "level": "error" - } - }, - { - "name": "spring.redis.lettuce.pool.min-idle", - "type": "java.lang.Integer", - "deprecation": { - "level": "error" - } - }, - { - "name": "spring.redis.lettuce.pool.time-between-eviction-runs", - "type": "java.time.Duration", - "deprecation": { - "level": "error" - } - }, - { - "name": "spring.redis.lettuce.shutdown-timeout", - "type": "java.time.Duration", - "deprecation": { - "replacement": "spring.data.redis.lettuce.shutdown-timeout", - "level": "error" - } - }, - { - "name": "spring.redis.password", - "type": "java.lang.String", - "deprecation": { - "replacement": "spring.data.redis.password", - "level": "error" - } - }, - { - "name": "spring.redis.port", - "type": "java.lang.Integer", - "deprecation": { - "replacement": "spring.data.redis.port", - "level": "error" - } - }, - { - "name": "spring.redis.sentinel.master", - "type": "java.lang.String", - "deprecation": { - "replacement": "spring.data.redis.sentinel.master", - "level": "error" - } - }, - { - "name": "spring.redis.sentinel.nodes", - "type": "java.util.List", - "deprecation": { - "replacement": "spring.data.redis.sentinel.nodes", - "level": "error" - } - }, - { - "name": "spring.redis.sentinel.password", - "type": "java.lang.String", - "deprecation": { - "replacement": "spring.data.redis.sentinel.password", - "level": "error" - } - }, - { - "name": "spring.redis.sentinel.username", - "type": "java.lang.String", - "deprecation": { - "replacement": "spring.data.redis.sentinel.username", - "level": "error" - } - }, - { - "name": "spring.redis.ssl", - "type": "java.lang.Boolean", - "deprecation": { - "replacement": "spring.data.redis.ssl", - "level": "error" - } - }, - { - "name": "spring.redis.timeout", - "type": "java.time.Duration", - "deprecation": { - "replacement": "spring.data.redis.timeout", - "level": "error" - } - }, - { - "name": "spring.redis.url", - "type": "java.lang.String", - "deprecation": { - "replacement": "spring.data.redis.url", - "level": "error" - } - }, - { - "name": "spring.redis.username", - "type": "java.lang.String", - "deprecation": { - "replacement": "spring.data.redis.username", - "level": "error" - } - }, { "name": "spring.resources.add-mappings", "type": "java.lang.Boolean", @@ -816,52 +550,6 @@ } ] }, - { - "name": "spring.data.redis.lettuce.read-from", - "values": [ - { - "value": "any", - "description": "Read from any node." - }, - { - "value": "any-replica", - "description": "Read from any replica node." - }, - { - "value": "lowest-latency", - "description": "Read from the node with the lowest latency during topology discovery." - }, - { - "value": "regex:", - "description": "Read from any node that has RedisURI matching with the given pattern." - }, - { - "value": "replica", - "description": "Read from the replica only." - }, - { - "value": "replica-preferred", - "description": "Read preferred from replica and fall back to upstream if no replica is available." - }, - { - "value": "subnet:", - "description": "Read from any node in the subnets." - }, - { - "value": "upstream", - "description": "Read from the upstream only." - }, - { - "value": "upstream-preferred", - "description": "Read preferred from the upstream and fall back to a replica if the upstream is not available." - } - ], - "providers": [ - { - "name": "any" - } - ] - }, { "name": "spring.graphql.cors.allowed-headers", "values": [ diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring.factories index 823bc5e0796..47cfe7757e4 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring.factories @@ -1,7 +1,3 @@ -# Failure Analyzers -org.springframework.boot.diagnostics.FailureAnalyzer=\ -org.springframework.boot.autoconfigure.data.redis.RedisUrlSyntaxFailureAnalyzer - # Depends on Database Initialization Detectors org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitializationDetector=\ org.springframework.boot.autoconfigure.session.JdbcIndexedSessionRepositoryDependsOnDatabaseInitializationDetector 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 61d5dc5ddeb..2a55f50bc17 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 @@ -8,9 +8,6 @@ org.springframework.boot.autoconfigure.data.couchbase.CouchbaseRepositoriesAutoC org.springframework.boot.autoconfigure.data.jdbc.JdbcRepositoriesAutoConfiguration org.springframework.boot.autoconfigure.data.r2dbc.R2dbcDataAutoConfiguration org.springframework.boot.autoconfigure.data.r2dbc.R2dbcRepositoriesAutoConfiguration -org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration -org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration -org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration diff --git a/spring-boot-project/spring-boot-data-redis/build.gradle b/spring-boot-project/spring-boot-data-redis/build.gradle new file mode 100644 index 00000000000..6b48cbfb102 --- /dev/null +++ b/spring-boot-project/spring-boot-data-redis/build.gradle @@ -0,0 +1,32 @@ +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.docker-test" + id "org.springframework.boot.optional-dependencies" +} + +description = "Spring Boot Data Redis" + +dependencies { + api(project(":spring-boot-project:spring-boot")) + api("io.lettuce:lettuce-core") + api("org.springframework.data:spring-data-redis") + + dockerTestImplementation(project(":spring-boot-project:spring-boot-test")) + dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker")) + dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure"))) + dockerTestImplementation("ch.qos.logback:logback-classic") + dockerTestImplementation("com.redis:testcontainers-redis") + dockerTestImplementation("org.junit.jupiter:junit-jupiter") + dockerTestImplementation("org.testcontainers:junit-jupiter") + + optional(project(":spring-boot-project:spring-boot-autoconfigure")) + optional("redis.clients:jedis") + + testImplementation(project(":spring-boot-project:spring-boot-test")) + testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + + testRuntimeOnly("ch.qos.logback:logback-classic") +} diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfigurationTests.java b/spring-boot-project/spring-boot-data-redis/src/dockerTest/java/org/springframework/boot/data/redis/autoconfigure/RedisRepositoriesAutoConfigurationTests.java similarity index 84% rename from spring-boot-project/spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfigurationTests.java rename to spring-boot-project/spring-boot-data-redis/src/dockerTest/java/org/springframework/boot/data/redis/autoconfigure/RedisRepositoriesAutoConfigurationTests.java index e631f8be2b8..10291c2b96a 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-data-redis/src/dockerTest/java/org/springframework/boot/data/redis/autoconfigure/RedisRepositoriesAutoConfigurationTests.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.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import com.redis.testcontainers.RedisContainer; import org.junit.jupiter.api.AfterEach; @@ -25,10 +25,9 @@ import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage; import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; -import org.springframework.boot.autoconfigure.data.alt.redis.CityRedisRepository; -import org.springframework.boot.autoconfigure.data.empty.EmptyDataPackage; -import org.springframework.boot.autoconfigure.data.redis.city.City; -import org.springframework.boot.autoconfigure.data.redis.city.CityRepository; +import org.springframework.boot.data.redis.domain.city.City; +import org.springframework.boot.data.redis.domain.city.CityRepository; +import org.springframework.boot.data.redis.domain.empty.EmptyPackage; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.testsupport.container.TestImage; import org.springframework.context.annotation.AnnotationConfigApplicationContext; @@ -83,7 +82,7 @@ class RedisRepositoriesAutoConfigurationTests { this.context.register(CustomizedConfiguration.class, RedisAutoConfiguration.class, RedisRepositoriesAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class); this.context.refresh(); - assertThat(this.context.getBean(CityRedisRepository.class)).isNotNull(); + assertThat(this.context.getBean(CityRepository.class)).isNotNull(); } @Configuration(proxyBeanMethods = false) @@ -93,14 +92,14 @@ class RedisRepositoriesAutoConfigurationTests { } @Configuration(proxyBeanMethods = false) - @TestAutoConfigurationPackage(EmptyDataPackage.class) + @TestAutoConfigurationPackage(EmptyPackage.class) static class EmptyConfiguration { } @Configuration(proxyBeanMethods = false) @TestAutoConfigurationPackage(RedisRepositoriesAutoConfigurationTests.class) - @EnableRedisRepositories(basePackageClasses = CityRedisRepository.class) + @EnableRedisRepositories(basePackageClasses = CityRepository.class) static class CustomizedConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/ClientResourcesBuilderCustomizer.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/ClientResourcesBuilderCustomizer.java similarity index 89% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/ClientResourcesBuilderCustomizer.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/ClientResourcesBuilderCustomizer.java index 19a42b93c09..e5fffd4875d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/ClientResourcesBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/ClientResourcesBuilderCustomizer.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.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import io.lettuce.core.resource.ClientResources; import io.lettuce.core.resource.ClientResources.Builder; @@ -25,7 +25,7 @@ import io.lettuce.core.resource.ClientResources.Builder; * auto-configuration. * * @author Stephane Nicoll - * @since 2.6.0 + * @since 4.0.0 */ public interface ClientResourcesBuilderCustomizer { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/JedisClientConfigurationBuilderCustomizer.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/JedisClientConfigurationBuilderCustomizer.java similarity index 91% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/JedisClientConfigurationBuilderCustomizer.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/JedisClientConfigurationBuilderCustomizer.java index d8f70edf760..eb7948f185d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/JedisClientConfigurationBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/JedisClientConfigurationBuilderCustomizer.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.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import org.springframework.data.redis.connection.jedis.JedisClientConfiguration; import org.springframework.data.redis.connection.jedis.JedisClientConfiguration.JedisClientConfigurationBuilder; @@ -26,7 +26,7 @@ import org.springframework.data.redis.connection.jedis.JedisClientConfiguration. * auto-configuration. * * @author Mark Paluch - * @since 2.0.0 + * @since 4.0.0 */ @FunctionalInterface public interface JedisClientConfigurationBuilderCustomizer { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/JedisConnectionConfiguration.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/JedisConnectionConfiguration.java similarity index 99% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/JedisConnectionConfiguration.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/JedisConnectionConfiguration.java index 353b2ef9c9d..06141dbe234 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/JedisConnectionConfiguration.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/JedisConnectionConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import javax.net.ssl.SSLParameters; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceClientConfigurationBuilderCustomizer.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/LettuceClientConfigurationBuilderCustomizer.java similarity index 92% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceClientConfigurationBuilderCustomizer.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/LettuceClientConfigurationBuilderCustomizer.java index 1599a68310c..a36799c97bd 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceClientConfigurationBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/LettuceClientConfigurationBuilderCustomizer.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.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration; import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration.LettuceClientConfigurationBuilder; @@ -28,7 +28,7 @@ import org.springframework.data.redis.connection.lettuce.LettuceClientConfigurat * configuration, use {@link LettuceClientOptionsBuilderCustomizer} instead. * * @author Mark Paluch - * @since 2.0.0 + * @since 4.0.0 */ @FunctionalInterface public interface LettuceClientConfigurationBuilderCustomizer { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceClientOptionsBuilderCustomizer.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/LettuceClientOptionsBuilderCustomizer.java similarity index 91% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceClientOptionsBuilderCustomizer.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/LettuceClientOptionsBuilderCustomizer.java index 625d8b6864d..f540da737fd 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceClientOptionsBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/LettuceClientOptionsBuilderCustomizer.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.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import io.lettuce.core.ClientOptions; import io.lettuce.core.ClientOptions.Builder; @@ -28,7 +28,7 @@ import org.springframework.data.redis.connection.lettuce.LettuceClientConfigurat * configuration, use {@link LettuceClientConfigurationBuilderCustomizer} instead. * * @author Soohyun Lim - * @since 3.4.0 + * @since 4.0.0 */ @FunctionalInterface public interface LettuceClientOptionsBuilderCustomizer { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/LettuceConnectionConfiguration.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/LettuceConnectionConfiguration.java index 734c747e51b..3af225335f2 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/LettuceConnectionConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import java.time.Duration; @@ -36,9 +36,9 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnThreading; -import org.springframework.boot.autoconfigure.data.redis.RedisProperties.Lettuce.Cluster.Refresh; -import org.springframework.boot.autoconfigure.data.redis.RedisProperties.Pool; import org.springframework.boot.autoconfigure.thread.Threading; +import org.springframework.boot.data.redis.autoconfigure.RedisProperties.Lettuce.Cluster.Refresh; +import org.springframework.boot.data.redis.autoconfigure.RedisProperties.Pool; import org.springframework.boot.ssl.SslBundle; import org.springframework.boot.ssl.SslBundles; import org.springframework.boot.ssl.SslOptions; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/PropertiesRedisConnectionDetails.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/PropertiesRedisConnectionDetails.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/PropertiesRedisConnectionDetails.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/PropertiesRedisConnectionDetails.java index 7b42223c691..8c80dc13ecf 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/PropertiesRedisConnectionDetails.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/PropertiesRedisConnectionDetails.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import java.util.List; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisAutoConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisAutoConfiguration.java index c5480cc9a96..89757b811f4 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -43,7 +43,7 @@ import org.springframework.data.redis.core.StringRedisTemplate; * @author Stephane Nicoll * @author Marco Aust * @author Mark Paluch - * @since 1.0.0 + * @since 4.0.0 */ @AutoConfiguration @ConditionalOnClass(RedisOperations.class) diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisConnectionConfiguration.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisConnectionConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisConnectionConfiguration.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisConnectionConfiguration.java index d3a703608ee..3e2f4e44f0b 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisConnectionConfiguration.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisConnectionConfiguration.java @@ -14,16 +14,16 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails.Cluster; -import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails.Node; -import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails.Sentinel; -import org.springframework.boot.autoconfigure.data.redis.RedisProperties.Pool; +import org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails.Cluster; +import org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails.Node; +import org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails.Sentinel; +import org.springframework.boot.data.redis.autoconfigure.RedisProperties.Pool; import org.springframework.boot.ssl.SslBundle; import org.springframework.boot.ssl.SslBundles; import org.springframework.data.redis.connection.RedisClusterConfiguration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisConnectionDetails.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisConnectionDetails.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisConnectionDetails.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisConnectionDetails.java index 013aaee5d0b..9aa164b7cbb 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisConnectionDetails.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisConnectionDetails.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import java.util.List; @@ -27,7 +27,7 @@ import org.springframework.util.Assert; * * @author Moritz Halbritter * @author Andy Wilkinson - * @since 3.1.0 + * @since 4.0.0 */ public interface RedisConnectionDetails extends ConnectionDetails { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisProperties.java similarity index 99% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisProperties.java index ca7a85875ab..a02038dc85e 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisProperties.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import java.time.Duration; import java.util.List; @@ -32,7 +32,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Stephane Nicoll * @author Scott Frederick * @author Yanming Zhou - * @since 1.0.0 + * @since 4.0.0 */ @ConfigurationProperties("spring.data.redis") public class RedisProperties { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisReactiveAutoConfiguration.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisReactiveAutoConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisReactiveAutoConfiguration.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisReactiveAutoConfiguration.java index 1e1fefe8ef3..eab905334f2 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisReactiveAutoConfiguration.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisReactiveAutoConfiguration.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.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import reactor.core.publisher.Flux; @@ -37,7 +37,7 @@ import org.springframework.data.redis.serializer.RedisSerializer; * * @author Mark Paluch * @author Stephane Nicoll - * @since 2.0.0 + * @since 4.0.0 */ @AutoConfiguration(after = RedisAutoConfiguration.class) @ConditionalOnClass({ ReactiveRedisConnectionFactory.class, ReactiveRedisTemplate.class, Flux.class }) diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfiguration.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisRepositoriesAutoConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfiguration.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisRepositoriesAutoConfiguration.java index 442247b85ed..895b990276c 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfiguration.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisRepositoriesAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -33,7 +33,7 @@ import org.springframework.data.redis.repository.support.RedisRepositoryFactoryB * * @author EddĂș MelĂ©ndez * @author Stephane Nicoll - * @since 1.4.0 + * @since 4.0.0 * @see EnableRedisRepositories */ @AutoConfiguration(after = RedisAutoConfiguration.class) diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesRegistrar.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisRepositoriesRegistrar.java similarity index 93% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesRegistrar.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisRepositoriesRegistrar.java index 45213adfd11..2d4cc703849 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesRegistrar.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisRepositoriesRegistrar.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.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import java.lang.annotation.Annotation; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisUrl.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisUrl.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisUrl.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisUrl.java index 7639b16e77f..9b3cd75b982 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisUrl.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisUrl.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import java.net.URI; import java.net.URISyntaxException; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxException.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisUrlSyntaxException.java similarity index 90% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxException.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisUrlSyntaxException.java index d9087678fa9..f5a940e61c7 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxException.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisUrlSyntaxException.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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.data.redis; +package org.springframework.boot.data.redis.autoconfigure; /** * Exception thrown when a Redis URL is malformed or invalid. diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzer.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisUrlSyntaxFailureAnalyzer.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzer.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisUrlSyntaxFailureAnalyzer.java index 88d99bdc77d..6b65d0bff08 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzer.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/RedisUrlSyntaxFailureAnalyzer.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.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import java.net.URI; import java.net.URISyntaxException; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/package-info.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/package-info.java similarity index 84% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/package-info.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/autoconfigure/package-info.java index 38587422ab8..42bd2992674 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/redis/package-info.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/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 Spring Data Redis. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; diff --git a/spring-boot-project/spring-boot-data-redis/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-data-redis/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 00000000000..6070ecdf235 --- /dev/null +++ b/spring-boot-project/spring-boot-data-redis/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,319 @@ +{ + "groups": [], + "properties": [ + { + "name": "spring.data.redis.repositories.enabled", + "type": "java.lang.Boolean", + "description": "Whether to enable Redis repositories.", + "defaultValue": true + }, + { + "name": "spring.data.redis.ssl", + "type": "java.lang.Boolean", + "deprecation": { + "replacement": "spring.data.redis.ssl.enabled", + "level": "error" + } + }, + { + "name": "spring.redis.client-name", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.client-name", + "level": "error" + } + }, + { + "name": "spring.redis.client-type", + "type": "org.springframework.boot.data.redis.autoconfigure.RedisProperties$ClientType", + "deprecation": { + "replacement": "spring.data.redis.client-type", + "level": "error" + } + }, + { + "name": "spring.redis.cluster.max-redirects", + "type": "java.lang.Integer", + "deprecation": { + "replacement": "spring.data.redis.cluster.max-redirects", + "level": "error" + } + }, + { + "name": "spring.redis.cluster.nodes", + "type": "java.util.List", + "deprecation": { + "replacement": "spring.data.redis.cluster.nodes", + "level": "error" + } + }, + { + "name": "spring.redis.connect-timeout", + "type": "java.time.Duration", + "deprecation": { + "replacement": "spring.data.redis.connect-timeout", + "level": "error" + } + }, + { + "name": "spring.redis.database", + "type": "java.lang.Integer", + "deprecation": { + "replacement": "spring.data.redis.database", + "level": "error" + } + }, + { + "name": "spring.redis.host", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.host", + "level": "error" + } + }, + { + "name": "spring.redis.jedis.pool.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.jedis.pool.max-active", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.jedis.pool.max-idle", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.jedis.pool.max-wait", + "type": "java.time.Duration", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.jedis.pool.min-idle", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.jedis.pool.time-between-eviction-runs", + "type": "java.time.Duration", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.cluster.refresh.adaptive", + "type": "java.lang.Boolean", + "deprecation": { + "replacement": "spring.data.redis.lettuce.cluster.refresh.adaptive", + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.cluster.refresh.dynamic-refresh-sources", + "type": "java.lang.Boolean", + "deprecation": { + "replacement": "spring.data.redis.lettuce.cluster.refresh.dynamic-refresh-sources", + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.cluster.refresh.period", + "type": "java.time.Duration", + "deprecation": { + "replacement": "spring.data.redis.lettuce.cluster.refresh.period", + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.pool.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.pool.max-active", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.pool.max-idle", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.pool.max-wait", + "type": "java.time.Duration", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.pool.min-idle", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.pool.time-between-eviction-runs", + "type": "java.time.Duration", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.shutdown-timeout", + "type": "java.time.Duration", + "deprecation": { + "replacement": "spring.data.redis.lettuce.shutdown-timeout", + "level": "error" + } + }, + { + "name": "spring.redis.password", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.password", + "level": "error" + } + }, + { + "name": "spring.redis.port", + "type": "java.lang.Integer", + "deprecation": { + "replacement": "spring.data.redis.port", + "level": "error" + } + }, + { + "name": "spring.redis.sentinel.master", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.sentinel.master", + "level": "error" + } + }, + { + "name": "spring.redis.sentinel.nodes", + "type": "java.util.List", + "deprecation": { + "replacement": "spring.data.redis.sentinel.nodes", + "level": "error" + } + }, + { + "name": "spring.redis.sentinel.password", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.sentinel.password", + "level": "error" + } + }, + { + "name": "spring.redis.sentinel.username", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.sentinel.username", + "level": "error" + } + }, + { + "name": "spring.redis.ssl", + "type": "java.lang.Boolean", + "deprecation": { + "replacement": "spring.data.redis.ssl", + "level": "error" + } + }, + { + "name": "spring.redis.timeout", + "type": "java.time.Duration", + "deprecation": { + "replacement": "spring.data.redis.timeout", + "level": "error" + } + }, + { + "name": "spring.redis.url", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.url", + "level": "error" + } + }, + { + "name": "spring.redis.username", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.username", + "level": "error" + } + } + ], + "hints": [ + { + "name": "spring.data.redis.lettuce.read-from", + "values": [ + { + "value": "any", + "description": "Read from any node." + }, + { + "value": "any-replica", + "description": "Read from any replica node." + }, + { + "value": "lowest-latency", + "description": "Read from the node with the lowest latency during topology discovery." + }, + { + "value": "regex:", + "description": "Read from any node that has RedisURI matching with the given pattern." + }, + { + "value": "replica", + "description": "Read from the replica only." + }, + { + "value": "replica-preferred", + "description": "Read preferred from replica and fall back to upstream if no replica is available." + }, + { + "value": "subnet:", + "description": "Read from any node in the subnets." + }, + { + "value": "upstream", + "description": "Read from the upstream only." + }, + { + "value": "upstream-preferred", + "description": "Read preferred from the upstream and fall back to a replica if the upstream is not available." + } + ], + "providers": [ + { + "name": "any" + } + ] + } + ] +} diff --git a/spring-boot-project/spring-boot-data-redis/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-data-redis/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000000..187f283870e --- /dev/null +++ b/spring-boot-project/spring-boot-data-redis/src/main/resources/META-INF/spring.factories @@ -0,0 +1,4 @@ +# Failure Analyzers +org.springframework.boot.diagnostics.FailureAnalyzer=\ +org.springframework.boot.data.redis.autoconfigure.RedisUrlSyntaxFailureAnalyzer + diff --git a/spring-boot-project/spring-boot-data-redis/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-data-redis/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 00000000000..4591be9d557 --- /dev/null +++ b/spring-boot-project/spring-boot-data-redis/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,3 @@ +org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration +org.springframework.boot.data.redis.autoconfigure.RedisReactiveAutoConfiguration +org.springframework.boot.data.redis.autoconfigure.RedisRepositoriesAutoConfiguration diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/PropertiesRedisConnectionDetailsTests.java b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/PropertiesRedisConnectionDetailsTests.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/PropertiesRedisConnectionDetailsTests.java rename to spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/PropertiesRedisConnectionDetailsTests.java index 6b044544032..24c8ddb2394 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/PropertiesRedisConnectionDetailsTests.java +++ b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/PropertiesRedisConnectionDetailsTests.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails.Node; +import org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails.Node; import org.springframework.boot.ssl.DefaultSslBundleRegistry; import org.springframework.boot.ssl.SslBundle; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationJedisTests.java b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisAutoConfigurationJedisTests.java similarity index 99% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationJedisTests.java rename to spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisAutoConfigurationJedisTests.java index bee589fa0ce..2341e81b091 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationJedisTests.java +++ b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisAutoConfigurationJedisTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import java.time.Duration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationLettuceWithoutCommonsPool2Tests.java b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisAutoConfigurationLettuceWithoutCommonsPool2Tests.java similarity index 94% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationLettuceWithoutCommonsPool2Tests.java rename to spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisAutoConfigurationLettuceWithoutCommonsPool2Tests.java index 1114cf7c9aa..4a0816bfeea 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationLettuceWithoutCommonsPool2Tests.java +++ b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisAutoConfigurationLettuceWithoutCommonsPool2Tests.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.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationTests.java b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisAutoConfigurationTests.java similarity index 99% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationTests.java rename to spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisAutoConfigurationTests.java index f908e6f47d5..a17fc0f7058 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisAutoConfigurationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import java.time.Duration; import java.util.Arrays; @@ -45,8 +45,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.data.redis.RedisProperties.Pool; import org.springframework.boot.autoconfigure.ssl.SslAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.RedisProperties.Pool; import org.springframework.boot.test.context.assertj.AssertableApplicationContext; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ContextConsumer; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisPropertiesTests.java b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisPropertiesTests.java similarity index 87% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisPropertiesTests.java rename to spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisPropertiesTests.java index 5d2544bc44b..27af757d33d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisPropertiesTests.java +++ b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisPropertiesTests.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,12 +14,12 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import io.lettuce.core.cluster.ClusterTopologyRefreshOptions; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.data.redis.RedisProperties.Lettuce; +import org.springframework.boot.data.redis.autoconfigure.RedisProperties.Lettuce; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisReactiveAutoConfigurationTests.java b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisReactiveAutoConfigurationTests.java similarity index 92% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisReactiveAutoConfigurationTests.java rename to spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisReactiveAutoConfigurationTests.java index 545ace7385c..b2703a686a5 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisReactiveAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisReactiveAutoConfigurationTests.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.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import java.util.Map; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzerTests.java b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisUrlSyntaxFailureAnalyzerTests.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzerTests.java rename to spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisUrlSyntaxFailureAnalyzerTests.java index a875cd5e6dd..ce5d6055d34 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/RedisUrlSyntaxFailureAnalyzerTests.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.data.redis; +package org.springframework.boot.data.redis.autoconfigure; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/city/City.java b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/domain/city/City.java similarity index 92% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/city/City.java rename to spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/domain/city/City.java index 44387ef3e1f..c6b01bc4369 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/city/City.java +++ b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/domain/city/City.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.data.redis.city; +package org.springframework.boot.data.redis.domain.city; import java.io.Serializable; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/city/CityRepository.java b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/domain/city/CityRepository.java similarity index 89% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/city/CityRepository.java rename to spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/domain/city/CityRepository.java index e0561aee866..0a68ca8836d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/redis/city/CityRepository.java +++ b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/domain/city/CityRepository.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.data.redis.city; +package org.springframework.boot.data.redis.domain.city; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/alt/redis/CityRedisRepository.java b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/domain/empty/EmptyPackage.java similarity index 64% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/alt/redis/CityRedisRepository.java rename to spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/domain/empty/EmptyPackage.java index 7c0f86911c8..b2d76b97b6c 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/alt/redis/CityRedisRepository.java +++ b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/domain/empty/EmptyPackage.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,11 +14,8 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.alt.redis; +package org.springframework.boot.data.redis.domain.empty; -import org.springframework.boot.autoconfigure.data.redis.city.City; -import org.springframework.data.repository.Repository; - -public interface CityRedisRepository extends Repository { +public class EmptyPackage { } diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/data/redis/test.jks b/spring-boot-project/spring-boot-data-redis/src/test/resources/org/springframework/boot/data/redis/autoconfigure/test.jks similarity index 100% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/data/redis/test.jks rename to spring-boot-project/spring-boot-data-redis/src/test/resources/org/springframework/boot/data/redis/autoconfigure/test.jks diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 9cebfd7b25e..9d30e229156 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -2031,6 +2031,7 @@ bom { "spring-boot-data-ldap", "spring-boot-data-mongodb", "spring-boot-data-neo4j", + "spring-boot-data-redis", "spring-boot-devtools", "spring-boot-docker-compose", "spring-boot-elasticsearch", diff --git a/spring-boot-project/spring-boot-docker-compose/build.gradle b/spring-boot-project/spring-boot-docker-compose/build.gradle index ad00fd71ff9..48268de3859 100644 --- a/spring-boot-project/spring-boot-docker-compose/build.gradle +++ b/spring-boot-project/spring-boot-docker-compose/build.gradle @@ -40,6 +40,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-autoconfigure-all")) optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure")) optional(project(":spring-boot-project:spring-boot-cassandra")) + optional(project(":spring-boot-project:spring-boot-data-redis")) optional(project(":spring-boot-project:spring-boot-elasticsearch")) optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-hazelcast")) diff --git a/spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/redis/RedisDockerComposeConnectionDetailsFactoryIntegrationTests.java b/spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/redis/RedisDockerComposeConnectionDetailsFactoryIntegrationTests.java index 1dec0840d29..b3f1ea74dbb 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/redis/RedisDockerComposeConnectionDetailsFactoryIntegrationTests.java +++ b/spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/redis/RedisDockerComposeConnectionDetailsFactoryIntegrationTests.java @@ -18,8 +18,8 @@ package org.springframework.boot.docker.compose.service.connection.redis; import javax.net.ssl.SSLContext; -import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails; -import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails.Standalone; +import org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails; +import org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails.Standalone; import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; import org.springframework.boot.ssl.SslBundle; import org.springframework.boot.testsupport.container.TestImage; diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/redis/RedisDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/redis/RedisDockerComposeConnectionDetailsFactory.java index bc3f47dc37c..4b16be5828e 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/redis/RedisDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/redis/RedisDockerComposeConnectionDetailsFactory.java @@ -16,7 +16,7 @@ package org.springframework.boot.docker.compose.service.connection.redis; -import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails; +import org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails; import org.springframework.boot.docker.compose.core.RunningService; import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionDetailsFactory; import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionSource; diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index 6888a7b86ab..57f6e217d42 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -68,6 +68,7 @@ dependencies { autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-ldap", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-mongodb", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-neo4j", configuration: "autoConfigurationMetadata")) + autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-redis", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-flyway", configuration: "autoConfigurationMetadata")) @@ -124,6 +125,7 @@ dependencies { configurationProperties(project(path: ":spring-boot-project:spring-boot-data-jpa", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-data-ldap", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-data-neo4j", configuration: "configurationPropertiesMetadata")) + configurationProperties(project(path: ":spring-boot-project:spring-boot-data-redis", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-docker-compose", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "configurationPropertiesMetadata")) diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/data/nosql.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/data/nosql.adoc index 59bc1571860..703a344f2cc 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/data/nosql.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/data/nosql.adoc @@ -72,9 +72,9 @@ spring: ---- -TIP: You can also register an arbitrary number of beans that implement javadoc:org.springframework.boot.autoconfigure.data.redis.LettuceClientConfigurationBuilderCustomizer[] for more advanced customizations. -javadoc:io.lettuce.core.resource.ClientResources[] can also be customized using javadoc:org.springframework.boot.autoconfigure.data.redis.ClientResourcesBuilderCustomizer[]. -If you use Jedis, javadoc:org.springframework.boot.autoconfigure.data.redis.JedisClientConfigurationBuilderCustomizer[] is also available. +TIP: You can also register an arbitrary number of beans that implement javadoc:org.springframework.boot.data.redis.autoconfigure.LettuceClientConfigurationBuilderCustomizer[] for more advanced customizations. +javadoc:io.lettuce.core.resource.ClientResources[] can also be customized using javadoc:org.springframework.boot.data.redis.autoconfigure.ClientResourcesBuilderCustomizer[]. +If you use Jedis, javadoc:org.springframework.boot.data.redis.autoconfigure.JedisClientConfigurationBuilderCustomizer[] is also available. Alternatively, you can register a bean of type javadoc:org.springframework.data.redis.connection.RedisStandaloneConfiguration[], javadoc:org.springframework.data.redis.connection.RedisSentinelConfiguration[], or javadoc:org.springframework.data.redis.connection.RedisClusterConfiguration[] to take full control over the configuration. If you add your own javadoc:org.springframework.context.annotation.Bean[format=annotation] of any of the auto-configured types, it replaces the default (except in the case of javadoc:org.springframework.data.redis.core.RedisTemplate[], when the exclusion is based on the bean name, `redisTemplate`, not its type). diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/dev-services.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/dev-services.adoc index 7df7d5de6b3..300e8584c6e 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/dev-services.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/dev-services.adoc @@ -128,7 +128,7 @@ The following service connections are currently supported: | javadoc:org.springframework.boot.autoconfigure.amqp.RabbitConnectionDetails[] | Containers named "rabbitmq" or "bitnami/rabbitmq" -| javadoc:org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails[] +| javadoc:org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails[] | Containers named "redis", "bitnami/redis", "redis/redis-stack" or "redis/redis-stack-server" | javadoc:org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinConnectionDetails[] diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/testcontainers.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/testcontainers.adoc index fc76ed3a257..2de06e407df 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/testcontainers.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/testcontainers.adoc @@ -92,7 +92,7 @@ The following service connection factories are provided in the `spring-boot-test | javadoc:org.springframework.boot.autoconfigure.amqp.RabbitConnectionDetails[] | Containers of type javadoc:{url-testcontainers-rabbitmq-javadoc}/org.testcontainers.containers.RabbitMQContainer[] -| javadoc:org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails[] +| javadoc:org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails[] | Containers of type javadoc:com.redis.testcontainers.RedisContainer[] or javadoc:com.redis.testcontainers.RedisStackContainer[], or containers named "redis", "redis/redis-stack" or "redis/redis-stack-server" | javadoc:org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinConnectionDetails[] @@ -121,7 +121,7 @@ include-code::MyRedisConfiguration[] Spring Boot can't tell from javadoc:org.testcontainers.containers.GenericContainer[] which container image is used, so the `name` attribute from javadoc:org.springframework.boot.testcontainers.service.connection.ServiceConnection[format=annotation] must be used to provide that hint. You can also use the `name` attribute of javadoc:org.springframework.boot.testcontainers.service.connection.ServiceConnection[format=annotation] to override which connection detail will be used, for example when using custom images. -If you are using the Docker image `registry.mycompany.com/mirror/myredis`, you'd use `@ServiceConnection(name="redis")` to ensure javadoc:org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails[] are created. +If you are using the Docker image `registry.mycompany.com/mirror/myredis`, you'd use `@ServiceConnection(name="redis")` to ensure javadoc:org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails[] are created. diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis-reactive/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis-reactive/build.gradle index 936be03434f..eab5c52645f 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis-reactive/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis-reactive/build.gradle @@ -6,8 +6,7 @@ description = "Starter for using Redis key-value data store with Spring Data Red dependencies { api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter")) + api(project(":spring-boot-project:spring-boot-data-redis")) api(project(":spring-boot-project:spring-boot-tx")) - api("io.lettuce:lettuce-core") api("io.projectreactor:reactor-core") - api("org.springframework.data:spring-data-redis") } diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis/build.gradle index bd6c983152f..450348877ba 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis/build.gradle @@ -6,7 +6,6 @@ description = "Starter for using Redis key-value data store with Spring Data Red dependencies { api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter")) + api(project(":spring-boot-project:spring-boot-data-redis")) api(project(":spring-boot-project:spring-boot-tx")) - api("io.lettuce:lettuce-core") - api("org.springframework.data:spring-data-redis") } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle index ae719677393..1cc29aa4edb 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle @@ -43,6 +43,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-data-ldap")) optional(project(":spring-boot-project:spring-boot-data-mongodb")) optional(project(":spring-boot-project:spring-boot-data-neo4j")) + optional(project(":spring-boot-project:spring-boot-data-redis")) optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-groovy-templates")) optional(project(":spring-boot-project:spring-boot-hateoas")) diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.redis.AutoConfigureDataRedis.imports b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.redis.AutoConfigureDataRedis.imports index 2db18c955ff..e7f14895517 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.redis.AutoConfigureDataRedis.imports +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.redis.AutoConfigureDataRedis.imports @@ -1,6 +1,6 @@ # AutoConfigureDataRedis auto-configuration imports -org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration -org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration -org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration +org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration +org.springframework.boot.data.redis.autoconfigure.RedisReactiveAutoConfiguration +org.springframework.boot.data.redis.autoconfigure.RedisRepositoriesAutoConfiguration org.springframework.boot.autoconfigure.ssl.SslAutoConfiguration optional:org.springframework.boot.testcontainers.service.connection.ServiceConnectionAutoConfiguration diff --git a/spring-boot-project/spring-boot-testcontainers/build.gradle b/spring-boot-project/spring-boot-testcontainers/build.gradle index b948b306cce..fb8c0f45d95 100644 --- a/spring-boot-project/spring-boot-testcontainers/build.gradle +++ b/spring-boot-project/spring-boot-testcontainers/build.gradle @@ -66,6 +66,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure")) optional(project(":spring-boot-project:spring-boot-cassandra")) optional(project(":spring-boot-project:spring-boot-couchbase")) + optional(project(":spring-boot-project:spring-boot-data-redis")) optional(project(":spring-boot-project:spring-boot-elasticsearch")) optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-hazelcast")) diff --git a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/ServiceConnectionAutoConfigurationTests.java b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/ServiceConnectionAutoConfigurationTests.java index d4f6ff944eb..4c118bbd7d1 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/ServiceConnectionAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/ServiceConnectionAutoConfigurationTests.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. @@ -27,8 +27,8 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.BeanNameGenerator; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails; +import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails; import org.springframework.boot.testcontainers.beans.TestcontainerBeanDefinition; import org.springframework.boot.testcontainers.lifecycle.TestcontainersLifecycleApplicationContextInitializer; import org.springframework.boot.testsupport.classpath.ClassPathExclusions; diff --git a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/CustomRedisContainerConnectionDetailsFactoryTests.java b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/CustomRedisContainerConnectionDetailsFactoryTests.java index 9ce215bb597..07af1b68d82 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/CustomRedisContainerConnectionDetailsFactoryTests.java +++ b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/CustomRedisContainerConnectionDetailsFactoryTests.java @@ -22,9 +22,9 @@ import com.redis.testcontainers.RedisContainer; import com.redis.testcontainers.RedisStackContainer; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails; import org.springframework.boot.autoconfigure.service.connection.ConnectionDetails; import org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactories; +import org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails; import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource; import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.springframework.boot.testcontainers.service.connection.TestContainerConnectionSource; diff --git a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/RedisContainerConnectionDetailsFactoryTests.java b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/RedisContainerConnectionDetailsFactoryTests.java index e7c68c4140b..e28eadf69ee 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/RedisContainerConnectionDetailsFactoryTests.java +++ b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/RedisContainerConnectionDetailsFactoryTests.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. @@ -23,8 +23,8 @@ import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails; +import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails; import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.springframework.boot.testsupport.container.TestImage; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/RedisStackContainerConnectionDetailsFactoryTests.java b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/RedisStackContainerConnectionDetailsFactoryTests.java index 1616e8f1eb8..c7767b45a6b 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/RedisStackContainerConnectionDetailsFactoryTests.java +++ b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/RedisStackContainerConnectionDetailsFactoryTests.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. @@ -23,8 +23,8 @@ import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails; +import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails; import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.springframework.boot.testsupport.container.TestImage; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/RedisStackServerContainerConnectionDetailsFactoryTests.java b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/RedisStackServerContainerConnectionDetailsFactoryTests.java index a3ebf8d7d8c..65ff1d84a87 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/RedisStackServerContainerConnectionDetailsFactoryTests.java +++ b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/redis/RedisStackServerContainerConnectionDetailsFactoryTests.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. @@ -22,8 +22,8 @@ import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; -import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails; +import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; +import org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails; import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.springframework.boot.testsupport.container.RedisStackServerContainer; import org.springframework.boot.testsupport.container.TestImage; diff --git a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/redis/RedisContainerConnectionDetailsFactory.java b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/redis/RedisContainerConnectionDetailsFactory.java index ea2095cb3b0..1ee8afda167 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/redis/RedisContainerConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/redis/RedisContainerConnectionDetailsFactory.java @@ -23,7 +23,7 @@ import com.redis.testcontainers.RedisStackContainer; import org.testcontainers.containers.Container; import org.testcontainers.containers.GenericContainer; -import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails; +import org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails; import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory; import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource; import org.springframework.boot.testcontainers.service.connection.ServiceConnection;