Please read the top-level CONTRIBUTING.md first for general contribution guidelines, pull request process, and commit requirements.
This document covers Java-specific development setup and workflow.
- Git
- Java 8 or higher - Download Java
- Maven 3.6 or higher - Download Maven
- Protocol Buffers compiler (
protoc) 33.0 - Download protoc
-
Clone the repository:
git clone https://github.com/databricks/zerobus-sdk.git cd zerobus-sdk/java -
Build the project:
mvn clean install
This will generate protobuf Java classes, compile the source code, run tests, and install the artifact to your local Maven repository.
-
Run tests:
mvn test
Code style is enforced by Spotless in your pull request. We use Google Java Format for code formatting.
Format your code before committing:
mvn spotless:applyThis will format:
- Java code: Using Google Java Format
- Imports: Organized and unused imports removed
- pom.xml: Sorted dependencies and plugins
mvn spotless:check# Run all tests
mvn test
# Run specific test class
mvn test -Dtest=ZerobusSdkTest
# Run specific test method
mvn test -Dtest=ZerobusSdkTest#testSingleRecordIngestAndAcknowledgmentAll pull requests must pass CI checks:
- fmt: Runs formatting checks (
mvn spotless:check) - test: Runs
mvn clean compileandmvn teston Java 11, 17, and 21 across Ubuntu and Windows runners.
You can view CI results in the GitHub Actions tab of the pull request.
# Clean build
mvn clean
# Compile code
mvn compile
# Run tests
mvn test
# Format code
mvn spotless:apply
# Check formatting
mvn spotless:check
# Create JARs (regular + fat JAR)
mvn package
# Install to local Maven repo
mvn install
# Generate protobuf classes
mvn protobuf:compile