From 59c91fd2a290b87118533a59f357bca308b23b86 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Sun, 10 Dec 2023 10:18:24 +0100 Subject: [PATCH] Add handling for JRE dependencies --- .../eclipse/dependencies/UpdateSite.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/support/lombok/eclipse/dependencies/UpdateSite.java b/src/support/lombok/eclipse/dependencies/UpdateSite.java index b49acdfb89..6201a8071d 100644 --- a/src/support/lombok/eclipse/dependencies/UpdateSite.java +++ b/src/support/lombok/eclipse/dependencies/UpdateSite.java @@ -90,16 +90,26 @@ private Set resolve(List dependencies, boolean withDependencies) System.out.println("Skipping unknown unit " + next); continue; } + // Remove a.jre.javase dependency + List filteredProvidedUnits = providedUnits.stream() + .filter(u -> !u.id.equals("a.jre.javase")) // Remove + .collect(Collectors.toList()); + + if (filteredProvidedUnits.size() == 0) { + // This is a JDK only dependency, skip + continue; + } + // Skip ambiguous (we could use version ranges to solve that...) - if (providedUnits.size() > 1) { - boolean alreadyResolved = providedUnits.stream().anyMatch(resolved::contains); + if (filteredProvidedUnits.size() > 1) { + boolean alreadyResolved = filteredProvidedUnits.stream().anyMatch(resolved::contains); if (!alreadyResolved) { - System.out.println("Ambiguous resolution for " + next + ": " + providedUnits.toString()); + System.out.println("Ambiguous resolution for " + next + ": " + filteredProvidedUnits.toString()); continue; } } - Unit unit = providedUnits.get(0); + Unit unit = filteredProvidedUnits.get(0); resolved.add(unit); if (withDependencies && unit.requires != null) {