Skip to content

Commit

Permalink
Accept versions without major version passed to m-enforcer-p
Browse files Browse the repository at this point in the history
This closes eclipse-m2e#1120
  • Loading branch information
kwin committed Dec 9, 2022
1 parent f9551f4 commit 553aaa9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,10 @@ private static List<Restriction> getVersionRangeRestrictionsIgnoringMicroAndQual
}

private static ArtifactVersion getMajorMinorOnlyVersion(ArtifactVersion lower) {
if(lower.getMajorVersion() == 0) {
// not every version constraint has a major version, in case it doesn't just rely on compareTo semantics as is
return lower;
}
return new DefaultArtifactVersion(lower.getMajorVersion() + "." + lower.getMinorVersion());
}

Expand Down

0 comments on commit 553aaa9

Please sign in to comment.