I'm aware that similiar questions have been asked before, but I specifically included the maven
tag on this question for a reason. Scenario:
- Project
P
has two dependencies,D1-1.2.3
andD2-2.0.0
D1-1.2.3
hasD2-1.0.0
as a dependency- A class
C
inD1
uses (but does not expose) a class fromD2
that has had a breaking change from version1.0.0
to2.0.0
P
usesC
The maven dependency model dictates that since P
's pom.xml
explicitly states the D2
dependency, the version from the pom will be used. This causes P
to break with a linkage error because of the incompatible change of the transitive dependency.
The semver FAQ states that this is a compatible change. It does say "since it does not affect the public API", yet with the scenario I outlined, every update to a dependency implicitly holds a risk of breaking consumers with linkage errors.
Should D1
increase major version? Is this bit of the semver specification simply not apt for maven projects because of its dependency model?