Skip to content

Commit 75d8572

Browse files
authored
Merge pull request #3560 from DataDog/halil.sener/issue-3533-fix-optionals
Move `optional` tags to module POMs
2 parents bec357f + 970a64e commit 75d8572

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

extended/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
<artifactId>client-java-api-fluent</artifactId>
3535
<version>${project.version}</version>
3636
</dependency>
37+
<dependency>
38+
<groupId>io.prometheus</groupId>
39+
<artifactId>simpleclient</artifactId>
40+
<optional>${prometheus.client.optional}</optional>
41+
</dependency>
3742
<dependency>
3843
<groupId>org.apache.commons</groupId>
3944
<artifactId>commons-lang3</artifactId>

pom.xml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@
7070
<prometheus.client.version>0.16.0</prometheus.client.version>
7171
<reflections.version>0.10.2</reflections.version>
7272

73+
<!-- The `optional` tag in `dependencyManagement` is not inherited; see
74+
https://issues.apache.org/jira/browse/MNG-5227 and
75+
https://issues.apache.org/jira/browse/MNG-5632. Therefore, we specify
76+
optional dependencies here to manage them in a single location. -->
77+
<prometheus.client.optional>true</prometheus.client.optional>
78+
<com.amazonaws.aws-java-sdk-sts.optional>true</com.amazonaws.aws-java-sdk-sts.optional>
79+
<com.google.auth.google-auth-library-oauth2-http.optional>true</com.google.auth.google-auth-library-oauth2-http.optional>
80+
<org.springframework.boot.spring-boot-actuator.optional>true</org.springframework.boot.spring-boot-actuator.optional>
81+
7382
<e2e.skip>true</e2e.skip>
7483

7584
<gpg.keyname>48540ECBBF00A28EACCF04E720FD12AFB0C9EBA9</gpg.keyname>
@@ -144,7 +153,6 @@
144153
<groupId>com.amazonaws</groupId>
145154
<artifactId>aws-java-sdk-sts</artifactId>
146155
<version>1.12.760</version>
147-
<optional>true</optional>
148156
</dependency>
149157
<dependency>
150158
<groupId>com.google.protobuf</groupId>
@@ -180,19 +188,16 @@
180188
<groupId>org.springframework.boot</groupId>
181189
<artifactId>spring-boot-actuator</artifactId>
182190
<version>${spring.boot.version}</version>
183-
<optional>true</optional>
184191
</dependency>
185192
<dependency>
186193
<groupId>io.prometheus</groupId>
187194
<artifactId>simpleclient</artifactId>
188195
<version>${prometheus.client.version}</version>
189-
<optional>true</optional>
190196
</dependency>
191197
<dependency>
192198
<groupId>io.prometheus</groupId>
193199
<artifactId>simpleclient_httpserver</artifactId>
194200
<version>${prometheus.client.version}</version>
195-
<optional>true</optional>
196201
</dependency>
197202
<dependency>
198203
<groupId>com.google.code.gson</groupId>
@@ -248,13 +253,6 @@
248253
<groupId>com.google.auth</groupId>
249254
<artifactId>google-auth-library-oauth2-http</artifactId>
250255
<version>1.24.0</version>
251-
<optional>true</optional>
252-
</dependency>
253-
<dependency>
254-
<groupId>com.fasterxml.jackson.core</groupId>
255-
<artifactId>jackson-annotations</artifactId>
256-
<version>2.17.2</version>
257-
<optional>true</optional>
258256
</dependency>
259257

260258
<!-- tests -->

spring/pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
<artifactId>client-java-extended</artifactId>
3030
<version>${project.version}</version>
3131
</dependency>
32-
32+
<dependency>
33+
<groupId>io.prometheus</groupId>
34+
<artifactId>simpleclient</artifactId>
35+
<optional>${prometheus.client.optional}</optional>
36+
</dependency>
3337
<dependency>
3438
<groupId>org.springframework.boot</groupId>
3539
<artifactId>spring-boot</artifactId>
@@ -41,6 +45,7 @@
4145
<dependency>
4246
<groupId>org.springframework.boot</groupId>
4347
<artifactId>spring-boot-actuator</artifactId>
48+
<optional>${org.springframework.boot.spring-boot-actuator.optional}</optional>
4449
</dependency>
4550
<dependency>
4651
<groupId>com.github.ben-manes.caffeine</groupId>

util/pom.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
<dependency>
1515
<groupId>io.prometheus</groupId>
1616
<artifactId>simpleclient</artifactId>
17+
<optional>${prometheus.client.optional}</optional>
1718
</dependency>
1819
<dependency>
1920
<groupId>io.prometheus</groupId>
2021
<artifactId>simpleclient_httpserver</artifactId>
22+
<optional>${prometheus.client.optional}</optional>
2123
</dependency>
2224
<dependency>
2325
<groupId>io.kubernetes</groupId>
@@ -60,6 +62,7 @@
6062
<dependency>
6163
<groupId>com.amazonaws</groupId>
6264
<artifactId>aws-java-sdk-sts</artifactId>
65+
<optional>${com.amazonaws.aws-java-sdk-sts.optional}</optional>
6366
</dependency>
6467
<dependency>
6568
<groupId>ch.qos.logback</groupId>
@@ -81,7 +84,7 @@
8184
<dependency>
8285
<groupId>com.google.auth</groupId>
8386
<artifactId>google-auth-library-oauth2-http</artifactId>
84-
<optional>true</optional>
87+
<optional>${com.google.auth.google-auth-library-oauth2-http.optional}</optional>
8588
</dependency>
8689
<!-- test dependencies -->
8790
<dependency>

0 commit comments

Comments
 (0)