Skip to content

Commit

Permalink
Fix eclipse-tycho#806 - Improve debug output in case of failing equin…
Browse files Browse the repository at this point in the history
…ox resolver

Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
  • Loading branch information
laeubi committed Mar 26, 2022
1 parent 1815355 commit d7abc4f
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.StringJoiner;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
Expand Down Expand Up @@ -162,8 +163,32 @@ public ModuleContainer newResolvedState(ReactorProject project, MavenSession mav
report = container.refresh(null);
}
}
if (logger.isDebugEnabled()) {
Set<Module> unresolvedModules = container.getModules().stream()
.filter(m -> m.getState() != State.RESOLVED).collect(Collectors.toSet());
if (!unresolvedModules.isEmpty()) {
logger.warn("OSGi state has " + unresolvedModules.size() + " unresolved module(s):");
logger.debug("The following modules are used to build the current state:");
for (Module m : container.getModules()) {
State state = m.getState();
ModuleRevision revision = m.getCurrentRevision();
boolean unresolved = unresolvedModules.contains(m);
String message = "| " + state + " | " + revision.getSymbolicName() + " ("
+ revision.getVersion() + ") @ " + m.getLocation();
if (unresolved) {
logger.warn(message);
String reportMessage = report.getResolutionReportMessage(revision);
String[] lines = reportMessage.split("\r?\n");
for (int i = 1; i < lines.length; i++) {
logger.warn(" " + lines[i]);
}
} else {
logger.debug(" " + message);
}
}
}
}
assertResolved(report, moduleRevision);

return container;
} finally {
executorService.shutdownNow();
Expand Down

0 comments on commit d7abc4f

Please sign in to comment.