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 featuresperformance- Performance testing and benchmarking tools
- 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.
# Default performance test with infrastructure management
$ make performance
# Test with different clients against existing Valkey instance
$ ./mvnw -q exec:java -pl performance -Dclient=valkeyglide
$ ./mvnw -q exec:java -pl performance -Dclient=lettuceFor detailed information about all available performance tests and benchmarking options, see the performance 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>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