Dagger Java SDK supports checks with `@Check`
Introduced 2026-02-05 · score 0.97
HOW TO USE IT
When a Java module function should validate a condition, annotate its method with both `@Function` and `@Check`. It must return `void` or throw an exception to indicate pass or failure, and can be invoked via `dagger check`.
@Object
public class MyModule {
@Function
@Check
public void validateBuild() {
// Validate conditions; throw an exception on failure.
}
}WHY THIS HELPS
Mark a Java module function as a check to validate its build or other repository operation.
REQUIREMENTS AND LIMITATIONS
- Version: v0.19.11
- @Check (required): Method annotation that marks a function as a check.
- @Function (required): Must be combined with `@Check` so the check is a callable function.
- Prerequisite: The check must be a callable function; the annotation documentation says it can be invoked via `dagger check`.
- Prerequisite: Checks return `void` or throw exceptions to indicate pass/fail.
FIRST-PARTY EVIDENCE
- https://github.com/dagger/dagger/releases/tag/v0.19.11
- https://github.com/dagger/dagger/pull/11704
- https://github.com/dagger/dagger/blob/v0.19.11/sdk/java/dagger-java-sdk/src/main/java/io/dagger/module/annotation/Check.java
Check the installed version and the source before using it. Entry JSON