From 0bfb3b1c832827511667ddcf541a7375f3fae910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Sat, 18 Jan 2025 17:59:48 +0100 Subject: [PATCH] Skip packages without a version 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. --- .../org/eclipse/tycho/baseline/DependencyCheckMojo.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tycho-baseline-plugin/src/main/java/org/eclipse/tycho/baseline/DependencyCheckMojo.java b/tycho-baseline-plugin/src/main/java/org/eclipse/tycho/baseline/DependencyCheckMojo.java index 65c780dcc2..1e85c65047 100644 --- a/tycho-baseline-plugin/src/main/java/org/eclipse/tycho/baseline/DependencyCheckMojo.java +++ b/tycho-baseline-plugin/src/main/java/org/eclipse/tycho/baseline/DependencyCheckMojo.java @@ -165,6 +165,12 @@ public void execute() throws MojoExecutionException, MojoFailureException { IInstallableUnit unit = packageProvidingUnit.get(); Optional 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);