This guide provides comprehensive information for developers working on Spring Data Valkey, including building, testing, and contributing to the project.
Spring Data Valkey is organized as a multi-module Maven project:
spring-data-valkey- Core Spring Data Valkey libraryspring-boot-starter-data-valkey- Spring Boot starter for auto-configurationexamples- Example applications demonstrating various Spring Data features
- JDK 17 or above - Required for compilation and runtime
- make - For managing Valkey test infrastructure
- Maven v3.8.0 or above - If using
mvncommand (or use included./mvnw) - Docker (optional) - For testcontainers/Docker tests
Clone and build all modules:
$ git clone https://github.com/valkey-io/spring-data-valkey.git
$ cd spring-data-valkey
$ ./mvnw clean installThe project uses a Makefile to manage Valkey test infrastructure, automatically downloading and starting Valkey instances in various configurations (Standalone, Sentinel, Cluster).
Run full build with test infrastructure:
$ make testFor development, you can control the test environment manually:
$ make start # Start all Valkey instances
$ make stop # Stop all instances
$ make clean # Clean up containers and dataOnce instances are running, execute tests from your IDE or run the Maven build:
$ ./mvnw clean install# Clean build with tests
$ ./mvnw clean install
# Skip tests for faster build
$ ./mvnw clean install -DskipTests
# Build specific module
$ ./mvnw clean install -pl spring-data-valkey# All tests with infrastructure management
$ make test
# Extended tests including long-running tests
$ make all-tests
# Unit tests only (requires running Valkey)
$ ./mvnw test
# Specific module tests (requires running Valkey)
$ ./mvnw test -pl spring-data-valkey
$ ./mvnw test -pl spring-boot-starter-data-valkey# Run all examples with infrastructure management
$ make examples
# Run individual examples against existing Valkey instance
$ ./mvnw -q exec:java -pl examples/quickstart
$ ./mvnw -q exec:java -pl examples/spring-bootFor detailed information about all available examples and their specific features, see the examples directory.
Add to your application.properties:
# Enable debug logging for Spring Data Valkey
logging.level.io.valkey.springframework.data=DEBUG
# Client logging (depending on what client is being used)
logging.level.glide=DEBUG
logging.level.io.lettuce.core=DEBUG
logging.level.redis.clients.jedis=DEBUGFor non-Spring Boot applications, configure logging via logback.xml in your classpath:
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p %40.40c:%4L - %m%n</pattern>
</encoder>
</appender>
<!-- Spring Data Valkey logging -->
<logger name="io.valkey.springframework.data" level="DEBUG"/>
<!-- Client logging (depending on what client is being used) -->
<logger name="glide" level="DEBUG"/>
<logger name="io.lettuce.core" level="DEBUG"/>
<logger name="redis.clients.jedis" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="console"/>
</root>
</configuration>This repository is forked from Spring Data Redis and related projects. This section documents the source repositories to help with future upgrades, patches, and alignment.
| Local Module | Redis Source Repository | Branch/Tag | Notes |
|---|---|---|---|
./ |
spring-data-build | 3.5.1 |
Parent for Spring Data modules |
spring-data-valkey/ |
spring-data-redis | 3.5.1 |
Core Spring Data Redis functionality |
spring-boot-starter-data-valkey/ |
spring-boot | 3.5.1 |
Spring Boot auto-configuration for Redis |
docs/ |
spring-data-redis | 3.5.1 |
Documentation |
examples/ |
spring-data-examples | main |
Redis examples |
Key changes from Redis source:
- Package names:
- Spring Data:
org.springframework.data.redis.*→io.valkey.springframework.data.valkey.* - Spring Boot:
org.springframework.boot.*.redis.*→io.valkey.springframework.boot.*.valkey.*
- Spring Data:
- Class names and properties:
*Redis*→*Valkey*or*redis*→*valkey* - Dependencies:
- Spring Data:
org.springframework.data:spring-data-redis→io.valkey.springframework.data:spring-data-valkey - Spring Boot:
org.springframework.boot:spring-boot-starter-data-redis→io.valkey.springframework.boot:spring-boot-starter-data-valkey
- Spring Data:
- Driver support: Added Valkey GLIDE as the primary driver
- Documentation: Migrated from Antora/AsciiDoc to Starlight/Markdown
The documentation is deployed to GitHub Pages using GitHub Actions. This includes the Astro Starlight documentation under docs/, as well as the Spring Data Valkey JavaDocs and schema.
Manually trigger the Docs workflow in GitHub Actions for a given branch to deploy the documentation on that branch. The documentation will then be available at https://valkey-io.github.io/spring-data-valkey/ or https://spring.valkey.io (CNAME redirect).
$ cd docs
$ npm install
$ npm run devThe documentation will be available at http://localhost:4321/.
Versions are managed in the parent POM and inherited by all modules automatically.
When preparing a new release, use the Maven Versions Plugin to update all module versions.
For example:
$ mvn versions:set -DnewVersion=1.0.0
$ mvn versions:commit
# Revert instead of commit if necessary
$ mvn versions:revertThis automatically updates:
pom.xml- Root project version (<version>element)**/pom.xml- All child modules' parent version references (<parent><version>element)
Manual update of the version is still required in these files:
spring-data-valkey/src/main/resources/notice.txt- Version in notice text
In order to generate a new release, create and push a tag to the main branch. GitHub will build and test the project and add the artifacts to a draft release. Verify the release and then publish it in GitHub.
For example:
$ git tag v1.0.0
$ git push origin v1.0.0