@@ -25,14 +25,19 @@ A Bill of Material
25
25
([ BOM] ( https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#bill-of-materials-bom-poms ) )
26
26
ensures that versions of dependencies (including transitive ones) are aligned.
27
27
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 .
31
31
32
32
{{% alert title="Note" color="info" %}}
33
33
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.
36
41
37
42
{{% /alert %}}
38
43
@@ -41,13 +46,6 @@ The following example shows how to import the OpenTelemetry BOMs using Maven:
41
46
``` xml
42
47
<dependencyManagement >
43
48
<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 >
51
49
<dependency >
52
50
<groupId >io.opentelemetry.instrumentation</groupId >
53
51
<artifactId >opentelemetry-instrumentation-bom</artifactId >
@@ -73,7 +71,6 @@ plugins {
73
71
74
72
dependencies {
75
73
implementation(platform(SpringBootPlugin .BOM_COORDINATES ))
76
- implementation(platform(" io.opentelemetry:opentelemetry-bom:{{% param vers.otel %}}" ))
77
74
implementation(platform(" io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:{{% param vers.instrumentation %}}" ))
78
75
}
79
76
```
@@ -90,7 +87,6 @@ plugins {
90
87
91
88
dependencyManagement {
92
89
imports {
93
- mavenBom(" io.opentelemetry:opentelemetry-bom:{{% param vers.otel %}}" )
94
90
mavenBom(" io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:{{% param vers.instrumentation %}}" )
95
91
}
96
92
}
@@ -100,7 +96,7 @@ dependencyManagement {
100
96
101
97
Be careful not to mix up the different ways of configuring things with Gradle.
102
98
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 %}}")) `
104
100
with the ` io.spring.dependency-management ` plugin.
105
101
106
102
{{% /alert %}}
0 commit comments