Skip to content

Commit

Permalink
Skip packages without a version
Browse files Browse the repository at this point in the history
If the current matched dependency has no version on the package export
we can't really do anything useful in checking a package version range
as it will result in a minimal import version of [0,1).

This now skip packages that have no version range currently present.
  • Loading branch information
laeubi committed Jan 18, 2025
1 parent d20eae1 commit 0bfb3b1
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ public void execute() throws MojoExecutionException, MojoFailureException {
IInstallableUnit unit = packageProvidingUnit.get();
Optional<org.eclipse.equinox.p2.metadata.Version> matchedPackageVersion = ArtifactMatcher
.getPackageVersion(unit, packageName);
if (matchedPackageVersion.isEmpty()
|| matchedPackageVersion.get().equals(org.eclipse.equinox.p2.metadata.Version.emptyVersion)) {
log.warn("Package " + packageName
+ " has no version exported and can not be checked for compatibility");
continue;
}
matchedPackageVersion.filter(v -> v.isOSGiCompatible()).ifPresent(v -> {
Version current = new Version(v.toString());
allPackageVersion.computeIfAbsent(packageName, nil -> new TreeSet<>()).add(current);
Expand Down

0 comments on commit 0bfb3b1

Please sign in to comment.