From 9a476e2c0c1ae6194a3e711f1512b4d5bf52c3a6 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Fri, 14 Jul 2023 18:09:35 +0200 Subject: [PATCH] Small changes from #10090. Signed-off-by: Simone Bordet --- .../src/main/java/org/eclipse/jetty/start/StartArgs.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jetty-core/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java b/jetty-core/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java index 6dcadddb57a3..8e6e255c1713 100644 --- a/jetty-core/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java +++ b/jetty-core/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java @@ -554,9 +554,10 @@ public CommandLineBuilder getMainArgs(Set parts) throws IOException if (parts.contains("path")) { + Classpath classpath = jettyEnvironment.getClasspath(); if (isJPMS()) { - Map> dirsAndFiles = StreamSupport.stream(jettyEnvironment.getClasspath().spliterator(), false) + Map> dirsAndFiles = StreamSupport.stream(classpath.spliterator(), false) .collect(Collectors.groupingBy(Files::isDirectory)); List paths = dirsAndFiles.get(false); @@ -605,10 +606,10 @@ public CommandLineBuilder getMainArgs(Set parts) throws IOException generateJpmsArgs(cmd); } - else + else if (!classpath.isEmpty()) { cmd.addOption("--class-path"); - cmd.addArg(jettyEnvironment.getClasspath().toString()); + cmd.addArg(classpath.toString()); } } @@ -685,7 +686,7 @@ else if (properties.size() > 0) // TODO module path for (Prop property : environment.getProperties()) - cmd.addArg(property.key + "=" + property.value); + cmd.addArg(property.key, property.value); for (Path xmlFile : environment.getXmlFiles()) cmd.addArg(xmlFile.toAbsolutePath().toString());