Gradle plugin
The Vulnlog Gradle plugin integrates Vulnlog commands into your Gradle build.
Installation
Apply the plugin in your build.gradle.kts:
plugins {
id("dev.vulnlog") version "0.17.0"
}
Configuration
The plugin is configured via the vulnlog extension block.
The top-level files property is shared across tasks; per-task settings live in nested blocks documented under each task.
vulnlog {
files.from("vulnlog.yaml", "other.vl.yaml")
}
| Property | Description |
|---|---|
|
File collection of Vulnlog YAML files to operate on. Used by all tasks except |
|
Container for the report tasks. Each report type has its own nested block: |
Diagnostics
The tasks emit the same diagnostics as the CLI’s -v and -vv flags through the Gradle logger.
Run with gradle --info to see parsed inputs, validation summaries, filter resolution, written outputs, and skipped suppression entries; gradle --debug adds debug detail such as included suppression entries and report entry counts.
Tasks
All tasks are registered in the vulnlog task group.
vulnlogInit
Scaffolds a minimal Vulnlog file.
See vulnlog init for the generated structure.
vulnlogInit is configured via project properties (-P) since it is a one-shot bootstrapping command.
| Property | Required | Description |
|---|---|---|
|
Yes |
Organization name for the Vulnlog project. |
|
Yes |
Project name. |
|
Yes |
Author name. |
|
Yes |
Output file path, relative to the project directory. |
./gradlew vulnlogInit \
-Pvulnlog.organization="Acme Corp" \
-Pvulnlog.name="Widget" \
-Pvulnlog.author="Alice" \
-Pvulnlog.output=vulnlog.yaml
vulnlogValidate
Validates the configured Vulnlog files.
See vulnlog validate for validation rules.
vulnlog {
validate {
strict = true // optional
}
}
| Property | Default | Description |
|---|---|---|
|
|
Treats warnings as errors and fails the build. |
The task uses Gradle’s up-to-date checking via @InputFiles and @Input, so it is skipped when neither the files nor strict have changed.
./gradlew vulnlogValidate
vulnlogFormat
Formats the configured Vulnlog files to the canonical style, rewriting them in place.
See vulnlog fmt for the formatting rules.
vulnlog {
fmt {
check = true // optional
}
}
| Property | Default | Description |
|---|---|---|
|
|
Do not write changes; fail the build if any file is not already formatted. Also available as the |
./gradlew vulnlogFormat
./gradlew vulnlogFormat --check # CI: fail if any file is unformatted
vulnlogSuppress
Generates suppression files for downstream scanners.
See vulnlog suppress for supported reporters.
vulnlog {
suppress {
outputDir = layout.projectDirectory.dir("suppressions") // optional
reporter = "trivy" // optional
asOf = "1.0.0" // optional
tags = setOf("frontend") // optional
}
}
| Property | Default | Description |
|---|---|---|
|
|
Directory where suppression files are written. |
|
All reporters |
Filter on reporter. |
|
All releases |
Report as of this release, including all releases up to and including it. |
|
All tags |
Filter on tags. |
./gradlew vulnlogSuppress
vulnlogImpactReport
Generates an HTML impact report from the configured Vulnlog files.
Multiple files are merged and must share the same project metadata.
See vulnlog report impact for details.
Settings live under report { impact { } }, so each report type keeps its own block.
vulnlog {
report {
impact {
outputFile.set(layout.buildDirectory.file("vulnlog/vulnlog-impact-report.html")) // optional
reporter = "trivy" // optional
asOf = "1.0.0" // optional
tags = setOf("frontend") // optional
states = setOf("open", "accepted") // optional
verdicts = setOf("affected") // optional
dispositions = setOf("wont fix") // optional
}
}
}
| Property | Default | Description |
|---|---|---|
|
|
File where the HTML report is written. |
|
All reporters |
Filter on reporter. |
|
All releases |
Report as of this release, including all releases up to and including it. |
|
All tags |
Filter on tags. |
|
All states |
Filter on vulnerability state: |
|
All verdicts |
Filter on triage verdict: |
|
All dispositions |
Filter on the remediation intent recorded for affected entries: |
The task is cacheable and uses Gradle’s up-to-date checking, so it is skipped when neither the files nor the filter settings have changed.
The task never fails because the report contains vulnerabilities.
It fails the build only on invalid input, for example an unknown asOf or input files with different project metadata.
./gradlew vulnlogImpactReport
vulnlogChangelogReport
Reports which vulnerabilities each release fixed, newest release first.
Multiple files are merged and must share the same project metadata.
See vulnlog report changelog for the report contents and for what it leaves out.
Settings live under report { changelog { } }.
vulnlog {
report {
changelog {
outputFile.set(layout.buildDirectory.file("vulnlog/vulnlog-changelog.md")) // optional
format = "markdown" // optional
brief = false // optional
fixedIn = "1.2.0" // optional
reporter = "trivy" // optional
asOf = "1.1.0" // optional
tags = setOf("frontend") // optional
}
}
}
| Property | Default | Description |
|---|---|---|
|
|
File where the report is written.
The default file name follows |
|
|
Output format: |
|
|
List identifiers and severity only. Descriptions, resolution notes, and references are left out. |
|
All releases |
Report only the vulnerabilities this release shipped a fix for. |
|
All reporters |
Filter on reporter. |
|
All releases |
Report as of this release, including all releases up to and including it. A fix that ships later is left out. |
|
All tags |
Filter on tags. |
The report holds no timestamp, so the output depends only on the inputs and the settings. The task is cacheable and is skipped when neither has changed.
The task always writes its output file.
When no entry records a resolution it writes the report for zero releases and logs info: no fixed vulnerabilities to report.
It fails the build only on invalid input, for example an unknown fixedIn or input files with different project metadata.
./gradlew vulnlogChangelogReport
VulnlogCopyTask
Copies vulnerability entries from a source Vulnlog file into one or more target files.
See vulnlog modify copy for the underlying behavior, including merge semantics for entries that already exist in a target.
The task type is provided but no task is registered by default, since the source, targets, and IDs to copy depend on the project. Register a task in your build script for each propagation you want to perform:
import dev.vulnlog.gradle.VulnlogCopyTask
tasks.register<VulnlogCopyTask>("vulnlogCopyToBranches") {
group = "vulnlog"
description = "Copy a vulnerability analysis into branch files."
sourceFile.set(layout.projectDirectory.file("source.vl.yaml"))
destinationFiles.from("target1.vl.yaml", "target2.vl.yaml")
vulnIds.set(setOf("CVE-2026-002"))
}
| Property | Description |
|---|---|
|
Vulnlog file to copy entries from. |
|
File collection of target Vulnlog files to copy entries into. |
|
Set of vulnerability IDs to copy. Each ID must exist in the source file. |
./gradlew vulnlogCopyToBranches