Snyk Gradle Plugin - Scanning and monitoring your dependencies for security vulnerabilities from Gradle
Snyk helps you find, fix and monitor for known vulnerabilities in your dependencies, both on an ad-hoc basis and as part of your CI (Build) system.
The Snyk Gradle plugin tests and monitors your Gradle dependencies.
![]() |
---|
The latest version of the plugin is released at the Gradle Plugins Portal.
Import the plugin using the plugin DSL
Groovy:
plugins {
id "io.snyk.gradle.plugin.snykplugin" version "0.7.0"
}
Kotlin
plugins {
id("io.snyk.gradle.plugin.snykplugin") version "0.7.0"
}
Groovy:
snyk {
arguments = '--all-sub-projects'
severity = 'low'
api = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
autoDownload = true
autoUpdate = true
}
Kotlin:
snyk {
setArguments("--all-sub-projects")
setSeverity("low")
setApi("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
setAutoDownload(true)
setAutoUpdate(true)
}
all fields are optional
SNYK_TOKEN
and omit it hereSnyk Test:
$ gradle snyk-test
Snyk Test together with a clean build:
$ gradle clean build snyk-test
Snyk Monitor:
$ gradle snyk-monitor
Snyk Monitor together with a clean build:
$ gradle clean build snyk-monitor