Skip to content

Commit bea05c7

Browse files
authored
ref(java): add Maven plugin to Java guides (#12759)
* ref(java): add Maven plugin to Java guides * address comments * add back raw Maven deps for Spring boot as well
1 parent 10210ea commit bea05c7

File tree

8 files changed

+199
-23
lines changed

8 files changed

+199
-23
lines changed

docs/platforms/java/common/integrations/graphql.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ plugins {
3434
implementation 'io.sentry:sentry-graphql:{{@inject packages.version('sentry.java.graphql', '6.28.0') }}'
3535
```
3636

37+
```xml {tabTitle:Maven Plugin}{filename:pom.xml}
38+
<plugin>
39+
<groupId>io.sentry</groupId>
40+
<artifactId>sentry-maven-plugin</artifactId>
41+
<version>{{@inject packages.version('sentry.java.maven-plugin', '0.0.2') }}</version>
42+
<!-- Required to allow auto-install of Sentry SDK and Integrations -->
43+
<extensions>true</extensions>
44+
</plugin>
45+
```
46+
3747
```xml {tabTitle:Maven}
3848
<dependency>
3949
<groupId>io.sentry</groupId>

docs/platforms/java/common/integrations/graphql22.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ plugins {
3434
implementation 'io.sentry:sentry-graphql-22:{{@inject packages.version('sentry.java.graphql-22', '8.0.0') }}'
3535
```
3636

37+
```xml {tabTitle:Maven Plugin}{filename:pom.xml}
38+
<plugin>
39+
<groupId>io.sentry</groupId>
40+
<artifactId>sentry-maven-plugin</artifactId>
41+
<version>{{@inject packages.version('sentry.java.maven-plugin', '0.0.2') }}</version>
42+
<!-- Required to allow auto-install of Sentry SDK and Integrations -->
43+
<extensions>true</extensions>
44+
</plugin>
45+
```
46+
3747
```xml {tabTitle:Maven}
3848
<dependency>
3949
<groupId>io.sentry</groupId>

docs/platforms/java/common/integrations/quartz.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ plugins {
2323
implementation 'io.sentry:sentry-quartz:{{@inject packages.version('sentry.java.quartz', '6.30.0') }}'
2424
```
2525

26+
```xml {tabTitle:Maven Plugin}{filename:pom.xml}
27+
<plugin>
28+
<groupId>io.sentry</groupId>
29+
<artifactId>sentry-maven-plugin</artifactId>
30+
<version>{{@inject packages.version('sentry.java.maven-plugin', '0.0.2') }}</version>
31+
<!-- Required to allow auto-install of Sentry SDK and Integrations -->
32+
<extensions>true</extensions>
33+
</plugin>
34+
```
35+
2636
```xml {tabTitle:Maven}
2737
<dependency>
2838
<groupId>io.sentry</groupId>

platform-includes/getting-started-install/java.log4j2.mdx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,37 @@
22
options={["error-monitoring", "performance", "opentelemetry"]}
33
/>
44

5+
```xml {tabTitle:Maven Plugin}{filename:pom.xml}
6+
<plugin>
7+
<groupId>io.sentry</groupId>
8+
<artifactId>sentry-maven-plugin</artifactId>
9+
<version>{{@inject packages.version('sentry.java.maven-plugin', '0.0.2') }}</version>
10+
<!-- Required to allow auto-install of Sentry SDK and Integrations -->
11+
<extensions>true</extensions>
12+
<configuration>
13+
<!-- In case you're self hosting, provide the URL here -->
14+
<!-- <url>http://localhost:8000/</url> -->
15+
<org>___SENTRY_ORG_SLUG___</org>
16+
<project>___SENTRY_PROJECT_SLUG___</project>
17+
<!-- Do not commit you auth token with this file, you should provide it via the SENTRY_AUTH_TOKEN environment variable or similar -->
18+
<!-- <authToken>${env.SENTRY_AUTH_TOKEN}</authToken> -->
19+
<authToken>___SENTRY_AUTH_TOKEN___</authToken>
20+
<!-- Enable debugging to see logs in case something goes wrong when uploading the source bundle -->
21+
<debugSentryCli>true</debugSentryCli>
22+
</configuration>
23+
<executions>
24+
<execution>
25+
<goals>
26+
<!-- Generates a source bundle and uploads it to Sentry -->
27+
<!-- This enables source context, allowing you to see your source code as part of your stack traces in Sentry -->
28+
<!-- Learn more about this feature in its dedicated "Source Context" docs page -->
29+
<goal>uploadSourceBundle</goal>
30+
</goals>
31+
</execution>
32+
</executions>
33+
</plugin>
34+
```
35+
536
```xml {tabTitle:Maven}
637
<dependency>
738
<groupId>io.sentry</groupId>

platform-includes/getting-started-install/java.logback.mdx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,37 @@
22
options={["error-monitoring", "performance", "opentelemetry"]}
33
/>
44

5+
```xml {tabTitle:Maven Plugin}{filename:pom.xml}
6+
<plugin>
7+
<groupId>io.sentry</groupId>
8+
<artifactId>sentry-maven-plugin</artifactId>
9+
<version>{{@inject packages.version('sentry.java.maven-plugin', '0.0.2') }}</version>
10+
<!-- Required to allow auto-install of Sentry SDK and Integrations -->
11+
<extensions>true</extensions>
12+
<configuration>
13+
<!-- In case you're self hosting, provide the URL here -->
14+
<!-- <url>http://localhost:8000/</url> -->
15+
<org>___SENTRY_ORG_SLUG___</org>
16+
<project>___SENTRY_PROJECT_SLUG___</project>
17+
<!-- Do not commit you auth token with this file, you should provide it via the SENTRY_AUTH_TOKEN environment variable or similar -->
18+
<!-- <authToken>${env.SENTRY_AUTH_TOKEN}</authToken> -->
19+
<authToken>___SENTRY_AUTH_TOKEN___</authToken>
20+
<!-- Enable debugging to see logs in case something goes wrong when uploading the source bundle -->
21+
<debugSentryCli>true</debugSentryCli>
22+
</configuration>
23+
<executions>
24+
<execution>
25+
<goals>
26+
<!-- Generates a source bundle and uploads it to Sentry -->
27+
<!-- This enables source context, allowing you to see your source code as part of your stack traces in Sentry -->
28+
<!-- Learn more about this feature in its dedicated "Source Context" docs page -->
29+
<goal>uploadSourceBundle</goal>
30+
</goals>
31+
</execution>
32+
</executions>
33+
</plugin>
34+
```
35+
536
```xml {tabTitle:Maven}
637
<dependency>
738
<groupId>io.sentry</groupId>

platform-includes/getting-started-install/java.mdx

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,35 @@ plugins {
88
}
99
```
1010

11-
```xml {tabTitle:Maven}{filename:pom.xml}
12-
<dependency>
13-
<groupId>io.sentry</groupId>
14-
<artifactId>sentry</artifactId>
15-
<version>{{@inject packages.version('sentry.java', '4.2.0') }}</version>
16-
</dependency>
11+
```xml {tabTitle:Maven Plugin}{filename:pom.xml}
12+
<plugin>
13+
<groupId>io.sentry</groupId>
14+
<artifactId>sentry-maven-plugin</artifactId>
15+
<version>{{@inject packages.version('sentry.java.maven-plugin', '0.0.2') }}</version>
16+
<!-- Required to allow auto-install of Sentry SDK and Integrations -->
17+
<extensions>true</extensions>
18+
<configuration>
19+
<!-- In case you're self hosting, provide the URL here -->
20+
<!-- <url>http://localhost:8000/</url> -->
21+
<org>___SENTRY_ORG_SLUG___</org>
22+
<project>___SENTRY_PROJECT_SLUG___</project>
23+
<!-- Do not commit you auth token with this file, you should provide it via the SENTRY_AUTH_TOKEN environment variable or similar -->
24+
<!-- <authToken>${env.SENTRY_AUTH_TOKEN}</authToken> -->
25+
<authToken>___SENTRY_AUTH_TOKEN___</authToken>
26+
<!-- Enable debugging to see logs in case something goes wrong when uploading the source bundle -->
27+
<debugSentryCli>true</debugSentryCli>
28+
</configuration>
29+
<executions>
30+
<execution>
31+
<goals>
32+
<!-- Generates a source bundle and uploads it to Sentry -->
33+
<!-- This enables source context, allowing you to see your source code as part of your stack traces in Sentry -->
34+
<!-- Learn more about this feature in its dedicated "Source Context" docs page -->
35+
<goal>uploadSourceBundle</goal>
36+
</goals>
37+
</execution>
38+
</executions>
39+
</plugin>
1740
```
1841

1942
```scala {tabTitle:SBT}

platform-includes/getting-started-install/java.spring-boot.mdx

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,45 @@ plugins {
88
}
99
```
1010

11+
```xml {tabTitle:Maven Plugin}{filename:pom.xml}
12+
<plugin>
13+
<groupId>io.sentry</groupId>
14+
<artifactId>sentry-maven-plugin</artifactId>
15+
<version>{{@inject packages.version('sentry.java.maven-plugin', '0.0.2') }}</version>
16+
<!-- Required to allow auto-install of Sentry SDK and Integrations -->
17+
<extensions>true</extensions>
18+
<configuration>
19+
<!-- In case you're self hosting, provide the URL here -->
20+
<!-- <url>http://localhost:8000/</url> -->
21+
<org>___SENTRY_ORG_SLUG___</org>
22+
<project>___SENTRY_PROJECT_SLUG___</project>
23+
<!-- Do not commit you auth token with this file, you should provide it via the SENTRY_AUTH_TOKEN environment variable or similar -->
24+
<!-- <authToken>${env.SENTRY_AUTH_TOKEN}</authToken> -->
25+
<authToken>___SENTRY_AUTH_TOKEN___</authToken>
26+
<!-- Enable debugging to see logs in case something goes wrong when uploading the source bundle -->
27+
<debugSentryCli>true</debugSentryCli>
28+
</configuration>
29+
<executions>
30+
<execution>
31+
<goals>
32+
<!-- Generates a source bundle and uploads it to Sentry -->
33+
<!-- This enables source context, allowing you to see your source code as part of your stack traces in Sentry -->
34+
<!-- Learn more about this feature in its dedicated "Source Context" docs page -->
35+
<goal>uploadSourceBundle</goal>
36+
</goals>
37+
</execution>
38+
</executions>
39+
</plugin>
40+
```
41+
42+
```groovy {tabTitle:Gradle (Spring Boot 2)}
43+
implementation 'io.sentry:sentry-spring-boot-starter:{{@inject packages.version('sentry.java.spring-boot', '4.2.0') }}'
44+
```
45+
46+
```groovy {tabTitle:Gradle (Spring Boot 3)}
47+
implementation 'io.sentry:sentry-spring-boot-starter-jakarta:{{@inject packages.version('sentry.java.spring-boot.jakarta', '6.7.0') }}'
48+
```
49+
1150
```xml {tabTitle:Maven (Spring Boot 2)}
1251
<dependency>
1352
<groupId>io.sentry</groupId>
@@ -22,15 +61,6 @@ plugins {
2261
<artifactId>sentry-spring-boot-starter-jakarta</artifactId>
2362
<version>{{@inject packages.version('sentry.java.spring-boot.jakarta', '6.7.0') }}</version>
2463
</dependency>
25-
```
26-
27-
```groovy {tabTitle:Gradle (Spring Boot 2)}
28-
implementation 'io.sentry:sentry-spring-boot-starter:{{@inject packages.version('sentry.java.spring-boot', '4.2.0') }}'
29-
```
30-
31-
```groovy {tabTitle:Gradle (Spring Boot 3)}
32-
implementation 'io.sentry:sentry-spring-boot-starter-jakarta:{{@inject packages.version('sentry.java.spring-boot.jakarta', '6.7.0') }}'
33-
```
3464

3565
<Alert>
3666

platform-includes/getting-started-install/java.spring.mdx

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,45 @@ plugins {
88
}
99
```
1010

11+
```xml {tabTitle:Maven Plugin}{filename:pom.xml}
12+
<plugin>
13+
<groupId>io.sentry</groupId>
14+
<artifactId>sentry-maven-plugin</artifactId>
15+
<version>{{@inject packages.version('sentry.java.maven-plugin', '0.0.2') }}</version>
16+
<!-- Required to allow auto-install of Sentry SDK and Integrations -->
17+
<extensions>true</extensions>
18+
<configuration>
19+
<!-- In case you're self hosting, provide the URL here -->
20+
<!-- <url>http://localhost:8000/</url> -->
21+
<org>___SENTRY_ORG_SLUG___</org>
22+
<project>___SENTRY_PROJECT_SLUG___</project>
23+
<!-- Do not commit you auth token with this file, you should provide it via the SENTRY_AUTH_TOKEN environment variable or similar -->
24+
<!-- <authToken>${env.SENTRY_AUTH_TOKEN}</authToken> -->
25+
<authToken>___SENTRY_AUTH_TOKEN___</authToken>
26+
<!-- Enable debugging to see logs in case something goes wrong when uploading the source bundle -->
27+
<debugSentryCli>true</debugSentryCli>
28+
</configuration>
29+
<executions>
30+
<execution>
31+
<goals>
32+
<!-- Generates a source bundle and uploads it to Sentry -->
33+
<!-- This enables source context, allowing you to see your source code as part of your stack traces in Sentry -->
34+
<!-- Learn more about this feature in its dedicated "Source Context" docs page -->
35+
<goal>uploadSourceBundle</goal>
36+
</goals>
37+
</execution>
38+
</executions>
39+
</plugin>
40+
```
41+
42+
```groovy {tabTitle:Gradle (Spring 5)}
43+
implementation 'io.sentry:sentry-spring:{{@inject packages.version('sentry.java.spring', '4.2.0') }}'
44+
```
45+
46+
```groovy {tabTitle:Gradle (Spring 6)}
47+
implementation 'io.sentry:sentry-spring-jakarta:{{@inject packages.version('sentry.java.spring.jakarta', '6.7.0') }}'
48+
```
49+
1150
```xml {tabTitle:Maven (Spring 5)}
1251
<dependency>
1352
<groupId>io.sentry</groupId>
@@ -24,14 +63,6 @@ plugins {
2463
</dependency>
2564
```
2665

27-
```groovy {tabTitle:Gradle (Spring 5)}
28-
implementation 'io.sentry:sentry-spring:{{@inject packages.version('sentry.java.spring', '4.2.0') }}'
29-
```
30-
31-
```groovy {tabTitle:Gradle (Spring 6)}
32-
implementation 'io.sentry:sentry-spring-jakarta:{{@inject packages.version('sentry.java.spring.jakarta', '6.7.0') }}'
33-
```
34-
3566
```scala {tabTitle: SBT (Spring 5)}
3667
libraryDependencies += "io.sentry" % "sentry-spring" % "{{@inject packages.version('sentry.java.spring', '4.2.0') }}"
3768
```

0 commit comments

Comments
 (0)