Skip to content

Commit 11c1801

Browse files
committed
Create spring-boot-data-redis module
1 parent 1a0a628 commit 11c1801

File tree

72 files changed

+499
-463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+499
-463
lines changed

Diff for: settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ include "spring-boot-project:spring-boot-data-jpa"
5858
include "spring-boot-project:spring-boot-data-ldap"
5959
include "spring-boot-project:spring-boot-data-mongodb"
6060
include "spring-boot-project:spring-boot-data-neo4j"
61+
include "spring-boot-project:spring-boot-data-redis"
6162
include "spring-boot-project:spring-boot-dependencies"
6263
include "spring-boot-project:spring-boot-devtools"
6364
include "spring-boot-project:spring-boot-docker-compose"

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dependencies {
2626
optional(project(":spring-boot-project:spring-boot-data-jpa"))
2727
optional(project(":spring-boot-project:spring-boot-data-mongodb"))
2828
optional(project(":spring-boot-project:spring-boot-data-neo4j"))
29+
optional(project(":spring-boot-project:spring-boot-data-redis"))
2930
optional(project(":spring-boot-project:spring-boot-flyway"))
3031
optional(project(":spring-boot-project:spring-boot-hazelcast"))
3132
optional(project(":spring-boot-project:spring-boot-http"))

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
29-
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
3029
import org.springframework.context.annotation.Bean;
3130
import org.springframework.data.redis.connection.RedisConnectionFactory;
3231

@@ -39,7 +38,8 @@
3938
* @author Mark Paluch
4039
* @since 2.1.0
4140
*/
42-
@AutoConfiguration(after = { RedisAutoConfiguration.class, RedisReactiveHealthContributorAutoConfiguration.class })
41+
@AutoConfiguration(after = RedisReactiveHealthContributorAutoConfiguration.class,
42+
afterName = "org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration")
4343
@ConditionalOnClass(RedisConnectionFactory.class)
4444
@ConditionalOnBean(RedisConnectionFactory.class)
4545
@ConditionalOnEnabledHealthIndicator("redis")

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
2929
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
3030
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
31-
import org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration;
3231
import org.springframework.context.annotation.Bean;
3332
import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
3433

@@ -42,7 +41,7 @@
4241
* @author Mark Paluch
4342
* @since 2.1.0
4443
*/
45-
@AutoConfiguration(after = RedisReactiveAutoConfiguration.class)
44+
@AutoConfiguration(afterName = "org.springframework.boot.data.redis.autoconfigure.RedisReactiveAutoConfiguration")
4645
@ConditionalOnClass({ ReactiveRedisConnectionFactory.class, Flux.class })
4746
@ConditionalOnBean(ReactiveRedisConnectionFactory.class)
4847
@ConditionalOnEnabledHealthIndicator("redis")

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/redis/LettuceMetricsAutoConfiguration.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,8 +27,7 @@
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2929
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
30-
import org.springframework.boot.autoconfigure.data.redis.ClientResourcesBuilderCustomizer;
31-
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
30+
import org.springframework.boot.data.redis.autoconfigure.ClientResourcesBuilderCustomizer;
3231
import org.springframework.context.annotation.Bean;
3332

3433
/**
@@ -38,9 +37,10 @@
3837
* @author Yanming Zhou
3938
* @since 2.6.0
4039
*/
41-
@AutoConfiguration(before = RedisAutoConfiguration.class,
40+
@AutoConfiguration(beforeName = "org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration",
4241
after = { MetricsAutoConfiguration.class, CompositeMeterRegistryAutoConfiguration.class })
43-
@ConditionalOnClass({ RedisClient.class, MicrometerCommandLatencyRecorder.class })
42+
@ConditionalOnClass({ ClientResourcesBuilderCustomizer.class, RedisClient.class,
43+
MicrometerCommandLatencyRecorder.class })
4444
@ConditionalOnBean(MeterRegistry.class)
4545
public class LettuceMetricsAutoConfiguration {
4646

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfigurationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
2222
import org.springframework.boot.actuate.data.redis.RedisHealthIndicator;
2323
import org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator;
2424
import org.springframework.boot.autoconfigure.AutoConfigurations;
25-
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
25+
import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration;
2626
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
2727
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
2828

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfigurationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
2222
import org.springframework.boot.actuate.data.redis.RedisHealthIndicator;
2323
import org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator;
2424
import org.springframework.boot.autoconfigure.AutoConfigurations;
25-
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
25+
import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration;
2626
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
2727

2828
import static org.assertj.core.api.Assertions.assertThat;

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
import org.springframework.boot.actuate.health.HealthEndpointWebExtension;
2525
import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension;
2626
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
27-
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
28-
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
2927
import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration;
3028
import org.springframework.boot.cassandra.autoconfigure.CassandraAutoConfiguration;
3129
import org.springframework.boot.context.annotation.UserConfigurations;
@@ -35,6 +33,8 @@
3533
import org.springframework.boot.data.mongodb.autoconfigure.MongoReactiveDataAutoConfiguration;
3634
import org.springframework.boot.data.neo4j.autoconfigure.Neo4jDataAutoConfiguration;
3735
import org.springframework.boot.data.neo4j.autoconfigure.Neo4jReactiveDataAutoConfiguration;
36+
import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration;
37+
import org.springframework.boot.data.redis.autoconfigure.RedisRepositoriesAutoConfiguration;
3838
import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration;
3939
import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration;
4040
import org.springframework.boot.liquibase.autoconfigure.LiquibaseAutoConfiguration;

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/redis/LettuceMetricsAutoConfigurationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
2323

2424
import org.springframework.boot.actuate.autoconfigure.metrics.test.MetricsRun;
2525
import org.springframework.boot.autoconfigure.AutoConfigurations;
26-
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
26+
import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration;
2727
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
2828
import org.springframework.context.annotation.Bean;
2929
import org.springframework.context.annotation.Configuration;

Diff for: spring-boot-project/spring-boot-actuator/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dependencies {
2626

2727
optional(project(":spring-boot-project:spring-boot-activemq"))
2828
optional(project(":spring-boot-project:spring-boot-data-cassandra"))
29+
optional(project(":spring-boot-project:spring-boot-data-redis"))
2930
optional(project(":spring-boot-project:spring-boot-flyway"))
3031
optional(project(":spring-boot-project:spring-boot-http"))
3132
optional(project(":spring-boot-project:spring-boot-integration"))

Diff for: spring-boot-project/spring-boot-actuator/src/dockerTest/java/org/springframework/boot/actuate/metrics/cache/RedisCacheMetricsTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@
2929

3030
import org.springframework.boot.autoconfigure.AutoConfigurations;
3131
import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration;
32-
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
32+
import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration;
3333
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
3434
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
3535
import org.springframework.boot.test.context.runner.ContextConsumer;

Diff for: spring-boot-project/spring-boot-autoconfigure-all/build.gradle

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ dependencies {
4343
optional(project(":spring-boot-project:spring-boot-couchbase"))
4444
optional(project(":spring-boot-project:spring-boot-data-jpa"))
4545
optional(project(":spring-boot-project:spring-boot-data-mongodb"))
46+
optional(project(":spring-boot-project:spring-boot-data-redis"))
4647
optional(project(":spring-boot-project:spring-boot-flyway"))
4748
optional(project(":spring-boot-project:spring-boot-h2console"))
4849
optional(project(":spring-boot-project:spring-boot-hazelcast"))
@@ -161,7 +162,6 @@ dependencies {
161162
optional("org.springframework.data:spring-data-jdbc")
162163
optional("org.springframework.data:spring-data-mongodb")
163164
optional("org.springframework.data:spring-data-r2dbc")
164-
optional("org.springframework.data:spring-data-redis")
165165
optional("org.springframework.graphql:spring-graphql")
166166
optional("org.springframework.hateoas:spring-hateoas")
167167
optional("org.springframework.security:spring-security-acl")
@@ -188,7 +188,6 @@ dependencies {
188188
optional("org.springframework.session:spring-session-jdbc")
189189
optional("org.springframework.amqp:spring-rabbit")
190190
optional("org.springframework.amqp:spring-rabbit-stream")
191-
optional("redis.clients:jedis")
192191

193192
testImplementation(project(":spring-boot-project:spring-boot-freemarker"))
194193
testImplementation(project(":spring-boot-project:spring-boot-gson"))

Diff for: spring-boot-project/spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/session/ReactiveSessionAutoConfigurationRedisTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,10 +27,10 @@
2727
import reactor.core.publisher.Mono;
2828

2929
import org.springframework.boot.autoconfigure.AutoConfigurations;
30-
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
31-
import org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration;
3230
import org.springframework.boot.autoconfigure.web.ServerProperties;
3331
import org.springframework.boot.autoconfigure.web.reactive.WebSessionIdResolverAutoConfiguration;
32+
import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration;
33+
import org.springframework.boot.data.redis.autoconfigure.RedisReactiveAutoConfiguration;
3434
import org.springframework.boot.test.context.FilteredClassLoader;
3535
import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext;
3636
import org.springframework.boot.test.context.runner.ContextConsumer;

Diff for: spring-boot-project/spring-boot-autoconfigure-all/src/dockerTest/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,9 +25,9 @@
2525
import org.testcontainers.junit.jupiter.Testcontainers;
2626

2727
import org.springframework.boot.autoconfigure.AutoConfigurations;
28-
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
2928
import org.springframework.boot.autoconfigure.web.ServerProperties;
3029
import org.springframework.boot.context.properties.source.InvalidConfigurationPropertyValueException;
30+
import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration;
3131
import org.springframework.boot.test.context.FilteredClassLoader;
3232
import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext;
3333
import org.springframework.boot.test.context.runner.ContextConsumer;

Diff for: spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
2828
import org.springframework.boot.autoconfigure.data.couchbase.CouchbaseDataAutoConfiguration;
29-
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
3029
import org.springframework.boot.context.properties.EnableConfigurationProperties;
3130
import org.springframework.boot.jpa.autoconfigure.EntityManagerFactoryDependsOnPostProcessor;
3231
import org.springframework.cache.CacheManager;
@@ -52,8 +51,9 @@
5251
* @since 1.3.0
5352
* @see EnableCaching
5453
*/
55-
@AutoConfiguration(after = { CouchbaseDataAutoConfiguration.class, RedisAutoConfiguration.class },
56-
afterName = { "org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration",
54+
@AutoConfiguration(after = CouchbaseDataAutoConfiguration.class,
55+
afterName = { "org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration",
56+
"org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration",
5757
"org.springframework.boot.jpa.autoconfigure.hibernate.HibernateJpaAutoConfiguration" })
5858
@ConditionalOnClass(CacheManager.class)
5959
@ConditionalOnBean(CacheAspectSupport.class)

Diff for: spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@
2525
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
28-
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
2928
import org.springframework.cache.CacheManager;
3029
import org.springframework.context.annotation.Bean;
3130
import org.springframework.context.annotation.Conditional;
@@ -46,7 +45,7 @@
4645
*/
4746
@Configuration(proxyBeanMethods = false)
4847
@ConditionalOnClass(RedisConnectionFactory.class)
49-
@AutoConfigureAfter(RedisAutoConfiguration.class)
48+
@AutoConfigureAfter(name = "org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration")
5049
@ConditionalOnBean(RedisConnectionFactory.class)
5150
@ConditionalOnMissingBean(CacheManager.class)
5251
@Conditional(CacheCondition.class)

Diff for: spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2929
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
30-
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
31-
import org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration;
3230
import org.springframework.boot.autoconfigure.web.ServerProperties;
3331
import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration;
3432
import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration;
@@ -63,14 +61,14 @@
6361
* @author Weix Sun
6462
* @since 1.4.0
6563
*/
66-
@AutoConfiguration(
67-
after = { RedisAutoConfiguration.class, RedisReactiveAutoConfiguration.class,
68-
WebSessionIdResolverAutoConfiguration.class },
64+
@AutoConfiguration(after = WebSessionIdResolverAutoConfiguration.class,
6965
afterName = { "org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration",
7066
"org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration",
7167
"org.springframework.boot.jdbc.autoconfigure.JdbcTemplateAutoConfiguration",
7268
"org.springframework.boot.data.mongodb.autoconfigure.MongoDataAutoConfiguration",
73-
"org.springframework.boot.data.mongodb.autoconfigure.MongoReactiveDataAutoConfiguration" },
69+
"org.springframework.boot.data.mongodb.autoconfigure.MongoReactiveDataAutoConfiguration",
70+
"org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration",
71+
"org.springframework.boot.data.redis.autoconfigure.RedisReactiveAutoConfiguration" },
7472
before = { HttpHandlerAutoConfiguration.class, WebFluxAutoConfiguration.class })
7573
@ConditionalOnClass(Session.class)
7674
@ConditionalOnWebApplication

0 commit comments

Comments
 (0)