Skip to content

Commit b0b2dab

Browse files
authored
Add explicit jakarta.annotation-api dependency to fix version conflict (#7972)
* Add explicit jakarta.annotation-api dependency to fix version conflict jakarta.resource-api:2.1.0 declares a transitive dependency on jakarta.annotation-api:2.1.0, but Spring Boot 3.3.4 (used by geode-gfsh) requires jakarta.annotation-api:2.1.1. This causes Maven enforcer to fail with a version conflict error. By explicitly declaring jakarta.annotation-api as an api dependency in geode-core, the published POM will include it with version 2.1.1 (from DependencyConstraints), which takes precedence over the transitive 2.1.0 dependency from jakarta.resource-api. Reported-by: Leon Finker * Update expected POM to include jakarta.annotation-api dependency
1 parent affba70 commit b0b2dab

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

geode-core/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ dependencies {
274274

275275
//The resource-API is used by the JCA support.
276276
api('jakarta.resource:jakarta.resource-api')
277+
// Explicitly declare jakarta.annotation-api to override the 2.1.0 version
278+
// transitively brought by jakarta.resource-api:2.1.0, ensuring consistency
279+
// with Spring Boot 3.3.4 which requires 2.1.1
280+
api('jakarta.annotation:jakarta.annotation-api')
277281
api('jakarta.transaction:jakarta.transaction-api')
278282

279283

geode-core/src/test/resources/expected-pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@
7979
</exclusion>
8080
</exclusions>
8181
</dependency>
82+
<dependency>
83+
<groupId>jakarta.annotation</groupId>
84+
<artifactId>jakarta.annotation-api</artifactId>
85+
<scope>compile</scope>
86+
<exclusions>
87+
<exclusion>
88+
<artifactId>log4j-to-slf4j</artifactId>
89+
<groupId>org.apache.logging.log4j</groupId>
90+
</exclusion>
91+
</exclusions>
92+
</dependency>
8293
<dependency>
8394
<groupId>jakarta.transaction</groupId>
8495
<artifactId>jakarta.transaction-api</artifactId>

0 commit comments

Comments
 (0)