Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/platform-includes/getting-started-install/java.log4j2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
</dependency>
```

```groovy {tabTitle:Gradle Plugin}
plugins {
id "io.sentry.jvm.gradle" version "{{@inject packages.version('sentry.java.android.gradle-plugin', '3.12.0') }}"
}
```

```groovy {tabTitle:Gradle}
implementation 'io.sentry:sentry-log4j2:{{@inject packages.version('sentry.java.log4j2', '4.2.0') }}'
```
Expand All @@ -18,6 +24,8 @@ For other dependency managers see the [central Maven repository](https://search.

<Note>

If you are using multiple Sentry dependencies, you can add a [bill of materials](/platforms/java/configuration/bill-of-materials) to avoid specifying the version of each dependency.
We recommend using our Gradle plugin as it can add integrations and provide source context for events.

If you are manually adding multiple Sentry dependencies, you can add a [bill of materials](/platforms/java/configuration/bill-of-materials) to avoid specifying the version of each dependency.

</Note>
10 changes: 9 additions & 1 deletion src/platform-includes/getting-started-install/java.logback.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
</dependency>
```

```groovy {tabTitle:Gradle Plugin}
plugins {
id "io.sentry.jvm.gradle" version "{{@inject packages.version('sentry.java.android.gradle-plugin', '3.12.0') }}"
}
```

```groovy {tabTitle:Gradle}
implementation 'io.sentry:sentry-logback:{{@inject packages.version('sentry.java.logback', '4.2.0') }}'
```
Expand All @@ -18,6 +24,8 @@ For other dependency managers, see the [central Maven repository](https://search

<Note>

If you are using multiple Sentry dependencies, you can add a [bill of materials](/platforms/java/configuration/bill-of-materials) to avoid specifying the version of each dependency.
We recommend using our Gradle plugin as it can add integrations and provide source context for events.

If you are manually adding multiple Sentry dependencies, you can add a [bill of materials](/platforms/java/configuration/bill-of-materials) to avoid specifying the version of each dependency.

</Note>
15 changes: 11 additions & 4 deletions src/platform-includes/getting-started-install/java.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
```groovy {filename:build.gradle}
// Make sure mavenCentral is there.
buildscript {
repositories {
mavenCentral()
}
}

repositories {
mavenCentral()
}

// Add Sentry's SDK as a dependency.
dependencies {
implementation 'io.sentry:sentry:{{@inject packages.version('sentry.java', '4.2.0') }}'
plugins {
id "io.sentry.jvm.gradle" version "{{@inject packages.version('sentry.java.android.gradle-plugin', '3.12.0') }}"
}
```

Expand All @@ -24,6 +29,8 @@ libraryDependencies += "io.sentry" % "sentry" % "{{@inject packages.version('sen

<Note>

If you are using multiple Sentry dependencies, you can add a [bill of materials](/platforms/java/configuration/bill-of-materials) to avoid specifying the version of each dependency.
We recommend using our Gradle plugin as it can add integrations and provide source context for events.

If you are manually adding multiple Sentry dependencies, you can add a [bill of materials](/platforms/java/configuration/bill-of-materials) to avoid specifying the version of each dependency.

</Note>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
</dependency>
```

```groovy {tabTitle:Gradle Plugin}
plugins {
id "io.sentry.jvm.gradle" version "{{@inject packages.version('sentry.java.android.gradle-plugin', '3.12.0') }}"
}
```

```groovy {tabTitle:Gradle (Spring Boot 2)}
implementation 'io.sentry:sentry-spring-boot-starter:{{@inject packages.version('sentry.java.spring-boot', '4.2.0') }}'
```
Expand All @@ -24,6 +30,8 @@ implementation 'io.sentry:sentry-spring-boot-starter-jakarta:{{@inject packages.

<Note>

If you are using multiple Sentry dependencies, you can add a [bill of materials](/platforms/java/configuration/bill-of-materials) to avoid specifying the version of each dependency.
We recommend using our Gradle plugin as it can add integrations and provide source context for events.

If you are manually adding multiple Sentry dependencies, you can add a [bill of materials](/platforms/java/configuration/bill-of-materials) to avoid specifying the version of each dependency.

</Note>
10 changes: 9 additions & 1 deletion src/platform-includes/getting-started-install/java.spring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
</dependency>
```

```groovy {tabTitle:Gradle Plugin}
plugins {
id "io.sentry.jvm.gradle" version "{{@inject packages.version('sentry.java.android.gradle-plugin', '3.12.0') }}"
}
```

```groovy {tabTitle:Gradle (Spring 5)}
implementation 'io.sentry:sentry-spring:{{@inject packages.version('sentry.java.spring', '4.2.0') }}'
```
Expand All @@ -34,6 +40,8 @@ For other dependency managers see the [central Maven repository (Spring 5)](http

<Note>

If you are using multiple Sentry dependencies, you can add a [bill of materials](/platforms/java/configuration/bill-of-materials) to avoid specifying the version of each dependency.
We recommend using our Gradle plugin as it can add integrations and provide source context for events.

If you are manually adding multiple Sentry dependencies, you can add a [bill of materials](/platforms/java/configuration/bill-of-materials) to avoid specifying the version of each dependency.

</Note>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Note>

There are two variants of Sentry available for Spring Boot. If you're using Spring Boot 2, use `sentry-spring-boot-starter` ([GitHub](https://github.com/getsentry/sentry-java/tree/master/sentry-spring-boot-starter)). If you're using Spring Boot 3, use `sentry-spring-boot-starter-jakarta` instead ([GitHub](https://github.com/getsentry/sentry-java/tree/master/sentry-spring-boot-starter-jakarta)).
There are two variants of Sentry available for Spring Boot. If you're using our Gradle plugin it will pick the right dependency for you. If you're manually adding the dependency and using Spring Boot 2, use `sentry-spring-boot-starter` ([GitHub](https://github.com/getsentry/sentry-java/tree/master/sentry-spring-boot-starter)). If you're using Spring Boot 3, use `sentry-spring-boot-starter-jakarta` instead ([GitHub](https://github.com/getsentry/sentry-java/tree/master/sentry-spring-boot-starter-jakarta)).

Sentry's integration with [Spring Boot](https://spring.io/projects/spring-boot) supports Spring Boot 2.1.0 and above to report unhandled exceptions as well as release and registration of beans. If you're on an older version, use [our legacy integration](/platforms/java/legacy/spring/).

Expand Down
20 changes: 19 additions & 1 deletion src/platforms/java/common/gradle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ description: "Learn about using the Sentry Gradle Plugin."
---

The [Sentry Gradle Plugin](https://github.com/getsentry/sentry-android-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.
seamless integration with the Gradle build system. It supports the following features:

- Auto-installation of Sentry Java SDK and relevant integrations
- External dependencies report
- Uploading Source Context

## Setup

Expand Down Expand Up @@ -72,6 +76,11 @@ sentry {
//
// Default is enabled.
includeDependenciesReport = true

// Automatically adds Sentry dependencies to your project.
autoInstallation {
enabled = true
}
}
```

Expand Down Expand Up @@ -100,9 +109,18 @@ sentry {
//
// Default is enabled.
includeDependenciesReport.set(true)

// Automatically adds Sentry dependencies to your project.
autoInstallation {
enabled.set(true)
}
}
```

## Auto Installation

The plugin automatically adds the Sentry Java SDK as well as available Sentry integrations as dependencies if it detects a library dependency we support. For example, if your project has a dependency on `graphql-java` the plugin will automatically add `sentry-graphql` as an additional dependency.

## Source Context

See our documentation on <PlatformLink to="/source-context/">Source Context</PlatformLink>.
Expand Down