Using v2 and v3 BOMs together results in ambiguous version management of jackson-annotations. The BOM listed higher "wins", which when coupled with the requireUpperBoundDeps enforcer rule causes thrashing as each are released independently.
2.22.0
|
<jackson.version.annotations>2.22</jackson.version.annotations> |
3.1.4
|
<jackson.version.annotations>2.21</jackson.version.annotations> |
Rule 0: org.apache.maven.enforcer.rules.dependency.RequireUpperBoundDeps failed with message:
Failed while enforcing RequireUpperBoundDeps. The error(s) are [
Require upper bound dependencies error for com.fasterxml.jackson.core:jackson-annotations:2.21 [test] paths to dependency are:
+-myGroup:myArtifact:1.0.0-SNAPSHOT
+-com.fasterxml.jackson.core:jackson-annotations:2.21 [test]
and
+-myGroup:myArtifact:1.0.0-SNAPSHOT
+-com.fasterxml.jackson.core:jackson-databind:2.22.0 [test]
+-com.fasterxml.jackson.core:jackson-annotations:2.21 [test] (managed) <-- com.fasterxml.jackson.core:jackson-annotations:2.22 [test]
]
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.22.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>tools.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>3.1.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Current workarounds
- Evaluate and reorder BOMs on every version bump to determine which should be first.
- Manage jackson-annotations explicitly.
Possible solution
- Create a combined BOM that include v2 and v3.
- Sync up v2/v3 releases to minimize divergence.
Using v2 and v3 BOMs together results in ambiguous version management of
jackson-annotations. The BOM listed higher "wins", which when coupled with the requireUpperBoundDeps enforcer rule causes thrashing as each are released independently.2.22.0
jackson-bom/pom.xml
Line 62 in 112e859
3.1.4
jackson-bom/pom.xml
Line 60 in 4085e4d
Current workarounds
Possible solution