Skip to content

Commit d0109ca

Browse files
committed
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.
1 parent d20eae1 commit d0109ca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tycho-baseline-plugin/src/main/java/org/eclipse/tycho/baseline/DependencyCheckMojo.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ public void execute() throws MojoExecutionException, MojoFailureException {
165165
IInstallableUnit unit = packageProvidingUnit.get();
166166
Optional<org.eclipse.equinox.p2.metadata.Version> matchedPackageVersion = ArtifactMatcher
167167
.getPackageVersion(unit, packageName);
168+
if (matchedPackageVersion.isEmpty()
169+
|| matchedPackageVersion.get().equals(org.eclipse.equinox.p2.metadata.Version.emptyVersion)) {
170+
log.warn("Package " + packageName
171+
+ " has no version exported and can not be checked for compatibility");
172+
continue;
173+
}
168174
matchedPackageVersion.filter(v -> v.isOSGiCompatible()).ifPresent(v -> {
169175
Version current = new Version(v.toString());
170176
allPackageVersion.computeIfAbsent(packageName, nil -> new TreeSet<>()).add(current);

0 commit comments

Comments
 (0)