Skip to content

Commit

Permalink
Don't set the mapping version on the MavenItem but rather use a map
Browse files Browse the repository at this point in the history
Otherwise building the -SNAPSHOT version gets messed up.

#11

eclipse-platform/eclipse.platform.releng#119
  • Loading branch information
merks committed Oct 9, 2022
1 parent ea7cf7b commit 25a82c4
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ public enum Type {

private Set<IInstallableUnit> aggregatedIUs;

private Map<MavenItem, Version> mavenItemVersions = new HashMap<MavenItem, Version>();

public InstallableUnitMapping(Contribution contribution, IInstallableUnit iu, List<MavenMapping> mappings,
List<MavenDependencyMapping> dependencyMappings, IQueryable<IInstallableUnit> index,
Set<IInstallableUnit> aggregatedIUs) {
Expand Down Expand Up @@ -604,6 +606,9 @@ public String getVersionRange(MavenItem mavenItem, String versionRange) {
if (matcher.find()) {
StringBuilder result = new StringBuilder();
String dependencyVersion = mavenItem.getMappedVersion();
if (dependencyVersion == null) {
dependencyVersion = mavenItemVersions.get(mavenItem).toString();
}
Matcher versionMatcher = VERSION_PATTERN.matcher(dependencyVersion);
if (!versionMatcher.matches()) {
throw new IllegalStateException("The version '" + dependencyVersion
Expand Down Expand Up @@ -767,9 +772,7 @@ private MavenItem mapIU(IInstallableUnit iu) {

usedMavenMappings.add(mapping);

if (mavenItem.getMappedVersion() == null) {
mavenItem.setMappedVersion(version.toString());
}
mavenItemVersions.put(mavenItem, version);

return mavenItem;
}
Expand Down

0 comments on commit 25a82c4

Please sign in to comment.