diff --git a/README.md b/README.md index 8877b7ef..4173746c 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ Plexus-Utils [![Build Status](https://github.com/codehaus-plexus/plexus-utils/actions/workflows/maven.yml/badge.svg)](https://github.com/codehaus-plexus/plexus-utils/actions) [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-utils.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-utils) +[![Reproducible Builds](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/org/codehaus/plexus/plexus-utils/badge.json)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/codehaus/plexus/plexus-utils/README.md) This library is historically used by the Apache Maven project so it's developed and maintained by the same [`bad guys`](http://maven.apache.org/team.html) diff --git a/pom.xml b/pom.xml index c8904ebb..c934e16b 100644 --- a/pom.xml +++ b/pom.xml @@ -20,11 +20,11 @@ limitations under the License. org.codehaus.plexus plexus - 17 + 18 plexus-utils - 4.0.1 + 4.0.2 Plexus Common Utilities A collection of various utility classes to ease working with strings, files, command lines and @@ -34,7 +34,7 @@ limitations under the License. scm:git:https://github.com/codehaus-plexus/plexus-utils.git ${project.scm.connection} - plexus-utils-4.0.1 + plexus-utils-4.0.2 https://github.com/codehaus-plexus/plexus-utils/tree/${project.scm.tag}/ @@ -49,14 +49,14 @@ limitations under the License. - 2024-04-13T09:06:44Z + 2024-09-23T19:00:34Z org.codehaus.plexus plexus-xml - 3.0.0 + 3.0.1 true diff --git a/src/main/java/org/codehaus/plexus/util/cli/shell/CmdShell.java b/src/main/java/org/codehaus/plexus/util/cli/shell/CmdShell.java index 47cc5154..2ce59c23 100644 --- a/src/main/java/org/codehaus/plexus/util/cli/shell/CmdShell.java +++ b/src/main/java/org/codehaus/plexus/util/cli/shell/CmdShell.java @@ -32,7 +32,7 @@ public class CmdShell extends Shell { public CmdShell() { setShellCommand("cmd.exe"); setQuotedExecutableEnabled(true); - setShellArgs(new String[] {"/X", "/C"}); + setShellArgs(new String[] {"/X", "/D", "/C"}); } /** diff --git a/src/test/java/org/codehaus/plexus/util/cli/CommandlineTest.java b/src/test/java/org/codehaus/plexus/util/cli/CommandlineTest.java index dffead1c..6518c950 100644 --- a/src/test/java/org/codehaus/plexus/util/cli/CommandlineTest.java +++ b/src/test/java/org/codehaus/plexus/util/cli/CommandlineTest.java @@ -182,14 +182,15 @@ public void testGetShellCommandLineWindows() throws Exception { cmd.addArguments(new String[] {"a", "b"}); String[] shellCommandline = cmd.getShellCommandline(); - assertEquals(4, shellCommandline.length, "Command line size"); + assertEquals(5, shellCommandline.length, "Command line size"); assertEquals("cmd.exe", shellCommandline[0]); assertEquals("/X", shellCommandline[1]); - assertEquals("/C", shellCommandline[2]); + assertEquals("/D", shellCommandline[2]); + assertEquals("/C", shellCommandline[3]); String expectedShellCmd = "\"c:" + File.separator + "Program Files" + File.separator + "xxx\" a b"; expectedShellCmd = "\"" + expectedShellCmd + "\""; - assertEquals(expectedShellCmd, shellCommandline[3]); + assertEquals(expectedShellCmd, shellCommandline[4]); } /** @@ -204,15 +205,16 @@ public void testGetShellCommandLineWindowsWithSeveralQuotes() throws Exception { cmd.addArguments(new String[] {"c:\\Documents and Settings\\whatever", "b"}); String[] shellCommandline = cmd.getShellCommandline(); - assertEquals(4, shellCommandline.length, "Command line size"); + assertEquals(5, shellCommandline.length, "Command line size"); assertEquals("cmd.exe", shellCommandline[0]); assertEquals("/X", shellCommandline[1]); - assertEquals("/C", shellCommandline[2]); + assertEquals("/D", shellCommandline[2]); + assertEquals("/C", shellCommandline[3]); String expectedShellCmd = "\"c:" + File.separator + "Program Files" + File.separator + "xxx\" \"c:\\Documents and Settings\\whatever\" b"; expectedShellCmd = "\"" + expectedShellCmd + "\""; - assertEquals(expectedShellCmd, shellCommandline[3]); + assertEquals(expectedShellCmd, shellCommandline[4]); } /** diff --git a/src/test/java/org/codehaus/plexus/util/cli/shell/BourneShellTest.java b/src/test/java/org/codehaus/plexus/util/cli/shell/BourneShellTest.java index 945b0bda..c00d6471 100644 --- a/src/test/java/org/codehaus/plexus/util/cli/shell/BourneShellTest.java +++ b/src/test/java/org/codehaus/plexus/util/cli/shell/BourneShellTest.java @@ -205,8 +205,9 @@ public void testArgumentsWithsemicolon() { assertEquals("cmd.exe", lines[0]); assertEquals("/X", lines[1]); - assertEquals("/C", lines[2]); - assertEquals("\"--password ;password\"", lines[3]); + assertEquals("/D", lines[2]); + assertEquals("/C", lines[3]); + assertEquals("\"--password ;password\"", lines[4]); } /**