From 907eb6b03be3fabcce583900f4d0259416437af3 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 6 Jan 2014 10:16:43 -0700 Subject: [PATCH] 424598 - Module [npn] downloads wrong npn jar + Cleanup of --list-config output --- .../java/org/eclipse/jetty/start/Module.java | 6 +-- .../java/org/eclipse/jetty/start/Modules.java | 42 +++++++++++++++++-- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java index 293d3de63e2..892f11a86f6 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java @@ -84,9 +84,9 @@ public class Module private String logicalName; /** The depth of the module in the tree */ private int depth = 0; - /** List of Modules, by name, that this Module depends on */ + /** Set of Modules, by name, that this Module depends on */ private Set parentNames; - /** List of Modules, by name, that this Module optionally depend on */ + /** Set of Modules, by name, that this Module optionally depend on */ private Set optionalParentNames; /** The Edges to parent modules */ private Set parentEdges; @@ -239,7 +239,7 @@ public class Module { return parentNames; } - + public Set getSources() { return Collections.unmodifiableSet(sources); diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java index e2602a46fec..d8004f57654 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java @@ -164,9 +164,33 @@ public class Modules implements Iterable ordered.addAll(modules.values()); Collections.sort(ordered,new Module.NameComparator()); + List active = resolveEnabled(); + for (Module module : ordered) { - System.out.printf("%nModule: %s%n",module.getName()); + boolean activated = active.contains(module); + boolean enabled = module.isEnabled(); + boolean transitive = activated && !enabled; + + char status = '-'; + if (enabled) + { + status = '*'; + } + else if (transitive) + { + status = '+'; + } + + System.out.printf("%n %s Module: %s%n",status,module.getName()); + if (!module.getName().equals(module.getFilesystemRef())) + { + System.out.printf(" Ref: %s%n",module.getFilesystemRef()); + } + for (String parent : module.getParentNames()) + { + System.out.printf(" Parent: %s%n",parent); + } for (String lib : module.getLibs()) { System.out.printf(" LIB: %s%n",lib); @@ -175,14 +199,24 @@ public class Modules implements Iterable { System.out.printf(" XML: %s%n",xml); } - System.out.printf(" depends: [%s]%n",Main.join(module.getParentNames(),", ")); if (StartLog.isDebugEnabled()) { System.out.printf(" depth: %d%n",module.getDepth()); } - for (String source : module.getSources()) + if (activated) { - System.out.printf(" enabled: %s%n",source); + for (String source : module.getSources()) + { + System.out.printf(" Enabled: %s%n",source); + } + if (transitive) + { + System.out.printf(" Enabled: %n"); + } + } + else + { + System.out.printf(" Enabled: %n"); } } }