Gradle

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.

Setup

Install

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

Copied
buildscript {
    repositories {
        mavenCentral()
    }
}

plugins {
    id "io.sentry.android.gradle" version "3.5.0"
}

Configure

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

Copied
sentry {
    // 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
}

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").