Skip to content

Commit 497dd23

Browse files
authoredJul 23, 2024··
simplify spring starter dependencies (#4848)
1 parent 7a7a503 commit 497dd23

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed
 

‎content/en/docs/zero-code/java/spring-boot-starter/getting-started.md

+11-15
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,19 @@ A Bill of Material
2525
([BOM](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#bill-of-materials-bom-poms))
2626
ensures that versions of dependencies (including transitive ones) are aligned.
2727

28-
Importing the `opentelemetry-bom` and `opentelemetry-instrumentation-bom` BOMs
29-
when using the OpenTelemetry starter is important to ensure version alignment
30-
across all OpenTelemetry dependencies.
28+
To ensure version alignment across all OpenTelemetry dependencies, you must
29+
import the `opentelemetry-instrumentation-bom` BOM when using the OpenTelemetry
30+
starter.
3131

3232
{{% alert title="Note" color="info" %}}
3333

34-
If you import the `spring-boot-dependencies` BOM, you have to declare it after
35-
the OpenTelemetry BOMs.
34+
When using Maven, import the OpenTelemetry BOMs before any other BOMs in your
35+
project. For example, if you import the `spring-boot-dependencies` BOM, you have
36+
to declare it after the OpenTelemetry BOMs.
37+
38+
Gradle selects the
39+
[latest version](https://docs.gradle.org/current/userguide/dependency_resolution.html#sec:version-conflict)
40+
of a dependency when multiple BOMs, so the order of BOMs is not important.
3641

3742
{{% /alert %}}
3843

@@ -41,13 +46,6 @@ The following example shows how to import the OpenTelemetry BOMs using Maven:
4146
```xml
4247
<dependencyManagement>
4348
<dependencies>
44-
<dependency>
45-
<groupId>io.opentelemetry</groupId>
46-
<artifactId>opentelemetry-bom</artifactId>
47-
<version>{{% param vers.otel %}}</version>
48-
<type>pom</type>
49-
<scope>import</scope>
50-
</dependency>
5149
<dependency>
5250
<groupId>io.opentelemetry.instrumentation</groupId>
5351
<artifactId>opentelemetry-instrumentation-bom</artifactId>
@@ -73,7 +71,6 @@ plugins {
7371

7472
dependencies {
7573
implementation(platform(SpringBootPlugin.BOM_COORDINATES))
76-
implementation(platform("io.opentelemetry:opentelemetry-bom:{{% param vers.otel %}}"))
7774
implementation(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:{{% param vers.instrumentation %}}"))
7875
}
7976
```
@@ -90,7 +87,6 @@ plugins {
9087

9188
dependencyManagement {
9289
imports {
93-
mavenBom("io.opentelemetry:opentelemetry-bom:{{% param vers.otel %}}")
9490
mavenBom("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:{{% param vers.instrumentation %}}")
9591
}
9692
}
@@ -100,7 +96,7 @@ dependencyManagement {
10096

10197
Be careful not to mix up the different ways of configuring things with Gradle.
10298
For example, don't use
103-
`implementation(platform("io.opentelemetry:opentelemetry-bom:{{% param vers.otel %}}"))`
99+
`implementation(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:{{% param vers.instrumentation %}}"))`
104100
with the `io.spring.dependency-management` plugin.
105101

106102
{{% /alert %}}

‎static/refcache.json

+4
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,10 @@
12471247
"StatusCode": 200,
12481248
"LastSeen": "2024-01-30T06:05:57.197702-05:00"
12491249
},
1250+
"https://docs.gradle.org/current/userguide/dependency_resolution.html#sec:version-conflict": {
1251+
"StatusCode": 206,
1252+
"LastSeen": "2024-07-23T10:18:05.857983751+02:00"
1253+
},
12501254
"https://docs.greptime.com/user-guide/clients/otlp": {
12511255
"StatusCode": 200,
12521256
"LastSeen": "2024-01-30T15:24:43.194115-05:00"

0 commit comments

Comments
 (0)
Please sign in to comment.