The 3.x development line uses Spring Boot 4.1 dependency management, Testcontainers 2, and JUnit 6. Java 17 remains the minimum supported version. The libraries are regular JARs; the Spring Boot BOM supplies dependency versions without applying Spring Boot application packaging.
Build with the Gradle wrapper and a JDK 17 or newer:
./gradlew build aggregateTestReports aggregateJacocoReport
./gradlew publishDocker must be running for Redis, Redis Stack, and Memcached integration tests.
Redis Enterprise container tests run on Linux. Tests against an external Redis
Enterprise installation require the REDIS_ENTERPRISE_HOST environment variable.
The publish task only stages artifacts under build/repos/local/release;
it does not upload them to Maven Central.
Dependency versions are maintained in gradle/libs.versions.toml. Dependabot
checks the catalog, Gradle wrapper, and this repository’s GitHub Actions weekly.
The shared release workflows are maintained in redis-field-engineering/redis-github-workflows.
For development snapshots, build and publish to Maven Local with
./gradlew publishToMavenLocal to try changes before a release.
@Testcontainers
class RedisExampleTest {
@Container
private static RedisContainer container = new RedisContainer(
RedisContainer.DEFAULT_IMAGE_NAME.withTag(RedisContainer.DEFAULT_TAG));
@Test
void testSomethingUsingLettuce() {
// Retrieve the Redis URI from the container
String redisURI = container.getRedisURI();
try (RedisClient client = RedisClient.create(redisURI);
StatefulRedisConnection<String, String> connection = client.connect()) {
RedisCommands<String, String> commands = connection.sync();
Assertions.assertEquals("PONG", commands.ping());
}
}
}@Testcontainers
class RedisStackExampleTest {
@Container
private static RedisStackContainer container = new RedisStackContainer(
RedisStackContainer.DEFAULT_IMAGE_NAME.withTag(RedisStackContainer.DEFAULT_TAG));
@Test
void testSomethingUsingLettuceMod() {
// Retrieve the Redis URI from the container
String redisURI = container.getRedisURI();
try (RedisModulesClient client = RedisModulesClient.create(redisURI);
StatefulRedisModulesConnection<String, String> connection = client.connect()) {
RedisModulesCommands<String, String> commands = connection.sync();
commands.ftCreate("myIndex", List.of(TagFieldArgs.<String>builder().name("myField").build()));
IndexInfo indexInfo = IndexInfo.parse(commands.ftInfo("myIndex"));
Assertions.assertEquals(1, indexInfo.getFields().size());
Assertions.assertEquals("myField", indexInfo.getFields().get(0).getName());
}
}
}