Local development with Deephaven libraries

This guide explains how to build Java or Groovy projects that depend on Deephaven Community libraries. This is useful for creating utilities, custom functions, or extensions that work with Deephaven tables.

Set up your project

Deephaven publishes artifacts to Maven Central, so no credentials are required.

Gradle

Add the Maven Central repository and Deephaven dependencies to your build.gradle:

Maven

Add dependencies to your pom.xml:

To compile Groovy sources, add the gmavenplus-plugin to your build. Also pin a modern maven-surefire-plugin version so Maven executes JUnit Jupiter tests, since Surefire versions older than 2.22.0 silently run zero Jupiter tests:

Common dependencies by use case

The dependencies you need depend on what your project does. Here are common patterns:

Use caseDependencies
Table operations (select, where, join)deephaven-engine-api, deephaven-engine-table
Read/write CSV filesdeephaven-extensions-csv
Read/write Parquet filesdeephaven-extensions-parquet-table
Configuration utilitiesdeephaven-Configuration
Default configuration propertiesdeephaven-configs
Date/time utilitiesdeephaven-engine-time
Loggingdeephaven-log-factory, deephaven-log-to-slf4j

Browse all available modules on Maven Central.

Local unit testing

To use Deephaven table operations in unit tests, you need to open an ExecutionContext.

Note: Advanced use cases like the Barrage Java client may require an additional JVM argument: --add-opens=java.base/java.nio=ALL-UNNAMED.

Example test setup

Add deephaven-engine-test-utils (for TestExecutionContext) and JUnit Jupiter as test dependencies. Gradle 9 also requires you to declare the JUnit Platform launcher. The logging sink from the base setup above is already available on the test classpath:

Or in Maven:

Use JUnit with an ExecutionContext to test table operations:

Reading test data

Add the appropriate extensions as dependencies:

Load test data from CSV or Parquet files in your test resources. Reading the CSV file and converting the Parquet resource URL to a URI both throw checked exceptions, so the test method declares throws Exception:

See CsvTools.readCsv and ParquetTools.readTable for more options.