Skip to content

Latest commit

 

History

History
107 lines (72 loc) · 2.32 KB

File metadata and controls

107 lines (72 loc) · 2.32 KB

Contributing to the Zerobus Java SDK

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.

Development Setup

Prerequisites

Setting Up Your Development Environment

  1. Clone the repository:

    git clone https://github.com/databricks/zerobus-sdk.git
    cd zerobus-sdk/java
  2. 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.

  3. Run tests:

    mvn test

Coding Style

Code style is enforced by Spotless in your pull request. We use Google Java Format for code formatting.

Running the Formatter

Format your code before committing:

mvn spotless:apply

This will format:

  • Java code: Using Google Java Format
  • Imports: Organized and unused imports removed
  • pom.xml: Sorted dependencies and plugins

Checking Formatting

mvn spotless:check

Running Tests

# Run all tests
mvn test

# Run specific test class
mvn test -Dtest=ZerobusSdkTest

# Run specific test method
mvn test -Dtest=ZerobusSdkTest#testSingleRecordIngestAndAcknowledgment

Continuous Integration

All pull requests must pass CI checks:

  • fmt: Runs formatting checks (mvn spotless:check)
  • test: Runs mvn clean compile and mvn test on Java 11, 17, and 21 across Ubuntu and Windows runners.

You can view CI results in the GitHub Actions tab of the pull request.

Maven Commands

# 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