The Sentry Gradle Plugin is an addition to the main Java SDK and offers seamless integration with the Gradle build system. It supports the reporting of your application's external dependencies as part of events.



Using Gradle in your application module's build.gradle add:

buildscript {
    repositories {

plugins {
    id "io.sentry.jvm.gradle" version "3.10.0"


We expose the following configuration values directly in build.gradle:

sentry {
    // Enables more detailed log output, e.g. for sentry-cli.
    // Default is false.
    debug = true

    // Generates a source bundle and uploads it to Sentry.
    // This enables source context, allowing you to see your source
    // code as part of your stack traces in Sentry.
    // Default is disabled.
    includeSourceContext = true

    // Includes additional source directories into the source bundle.
    // These directories are resolved relative to the project directory.
    additionalSourceDirsForSourceContext = ["mysrc/java", "other-source-dir/main/kotlin"]

    // Disables or enables dependencies metadata reporting for Sentry.
    // If enabled, the plugin will collect external dependencies and
    // upload them to Sentry as part of events. If disabled, all the logic
    // related to the dependencies metadata report will be excluded.
    // Default is enabled.
    includeDependenciesReport = true

Source Context

See our documentation on Source Context.

Dependencies Report

The plugin automatically collects an application's external dependencies (including transitive ones), and generates a compile-time report. The Sentry Java SDK picks up the report at runtime and sends it along with every Sentry event. The event dependencies metadata will look something like this:

Java dependencies report

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").