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:
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id "io.sentry.android.gradle" version "3.5.0"
}
Although the plugin id contains android
, it can be used for non-android projects. However, for non-android projects, the plugin only collects external dependencies.
Configure
We expose the following configuration values directly in build.gradle
:
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:
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").
- Package:
- maven:io.sentry:sentry-spring
- Version:
- 6.18.1
- Repository:
- https://github.com/getsentry/sentry-java