diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java index 7bdd5916efa..fdd4cf68abc 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java @@ -704,9 +704,9 @@ public class Main // Process dependencies Modules modules = args.getAllModules(); Module module=modules.get(name); - - for (String parent:module.getParentNames()) - enable(args,parent,false); + if (module!=null) + for (String parent:module.getParentNames()) + enable(args,parent,false); } private void disable(StartArgs args, String name, boolean verbose) throws IOException 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 7f0ae9c5d36..70a2861caa2 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 @@ -103,7 +103,12 @@ public class Modules implements Iterable for (String parentName : module.getParentNames()) { Module parent = get(parentName); - if (parent != null) + + if (parent == null) + { + System.err.printf("WARNING: module not found [%s]%n",parentName); + } + else { module.addParentEdge(parent); parent.addChildEdge(module); @@ -113,8 +118,11 @@ public class Modules implements Iterable for (String optionalParentName : module.getOptionalParentNames()) { Module optional = get(optionalParentName); - - if ((optional != null) && optional.isEnabled()) + if (optional==null) + { + System.err.printf("WARNING: module not found [%s]%n",optionalParentName); + } + else if (optional.isEnabled()) { module.addParentEdge(optional); optional.addChildEdge(module); @@ -301,12 +309,7 @@ public class Modules implements Iterable public Module get(String name) { - Module module = modules.get(name); - if (module == null) - { - System.err.printf("WARNING: module not found [%s]%n",name); - } - return module; + return modules.get(name); } @Override