diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 4000f8c4..4c09c8a7 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -7,6 +7,6 @@ jobs: update_release_draft: runs-on: ubuntu-latest steps: - - uses: release-drafter/release-drafter@v5 + - uses: release-drafter/release-drafter@v6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index a956a58a..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) @@ -14,4 +15,6 @@ For publishing [the site](https://codehaus-plexus.github.io/plexus-utils/) do th mvn -Preporting verify site site:stage scm-publish:publish-scm ``` -Starting with version 4, XML classes (in `org.codehaus.plexus.util.xml` and `org.codehaus.plexus.util.xml.pull`) have been extracted to a separate [`plexus-xml`](https://github.com/codehaus-plexus/plexus-xml/) 4: if you need them, just use this new artifact. +Starting with version 4, XML classes (in `org.codehaus.plexus.util.xml` and `org.codehaus.plexus.util.xml.pull`) have been extracted to a separate [`plexus-xml`](https://github.com/codehaus-plexus/plexus-xml/) library: if you need them, just use this new artifact. + +`plexus-utils` 4 keeps an optional dependency on `plexus-xml` 3 to keep compatibility with the few XML-oriented methods of `ReaderFactory` and `WriterFactory`: these classes are deprecated, you should migrate as explained in javadoc. And keep `plexus-xml` to 3 if you want Maven 3 compatibility, as `plexus-xml` 4 works only in Maven 4. diff --git a/pom.xml b/pom.xml index 2e45695f..c934e16b 100644 --- a/pom.xml +++ b/pom.xml @@ -20,25 +20,26 @@ limitations under the License. org.codehaus.plexus plexus - 13 + 18 plexus-utils - 4.0.0 + 4.0.2 Plexus Common Utilities A collection of various utility classes to ease working with strings, files, command lines and more. + https://codehaus-plexus.github.io/plexus-utils/ scm:git:https://github.com/codehaus-plexus/plexus-utils.git ${project.scm.connection} - plexus-utils-4.0.0 - https://github.com/codehaus-plexus/plexus-utils/tree/master/ + plexus-utils-4.0.2 + https://github.com/codehaus-plexus/plexus-utils/tree/${project.scm.tag}/ github - http://github.com/codehaus-plexus/plexus-utils/issues + https://github.com/codehaus-plexus/plexus-utils/issues @@ -48,63 +49,26 @@ limitations under the License. - 2023-05-22T15:13:56Z + 2024-09-23T19:00:34Z org.codehaus.plexus plexus-xml - 4.0.0 + 3.0.1 + true org.junit.jupiter - junit-jupiter - 5.9.2 + junit-jupiter-api test - - - - false - - - true - - oss.snapshots - https://oss.sonatype.org/content/repositories/plexus-snapshots/ - - - - - - - org.apache.maven.plugins - maven-resources-plugin - 3.3.1 - - - - - maven-compiler-plugin - - - default-compile - - compile - - - 1.8 - 1.8 - - - - org.apache.maven.plugins maven-scm-publish-plugin diff --git a/src/main/java/org/codehaus/plexus/util/AbstractScanner.java b/src/main/java/org/codehaus/plexus/util/AbstractScanner.java index a10f43c7..d650c6df 100644 --- a/src/main/java/org/codehaus/plexus/util/AbstractScanner.java +++ b/src/main/java/org/codehaus/plexus/util/AbstractScanner.java @@ -41,7 +41,7 @@ public abstract class AbstractScanner implements Scanner { *
  • Mac: **/.DS_Store
  • *
  • Serena Dimension: **/.metadata, **/.metadata/**
  • *
  • Mercurial: **/.hg, **/.hg/**
  • - *
  • Git: **/.git, **/.git/**
  • + *
  • Git: **/.git, **/.git/**, **/.gitignore
  • *
  • Bitkeeper: **/BitKeeper, **/BitKeeper/**, **/ChangeSet, * **/ChangeSet/**
  • *
  • Darcs: **/_darcs, **/_darcs/**, **/.darcsrepo, @@ -106,6 +106,7 @@ public abstract class AbstractScanner implements Scanner { // git "**/.git", "**/.git/**", + "**/.gitignore", // BitKeeper "**/BitKeeper", 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/site/markdown/index.md b/src/site/markdown/index.md new file mode 100644 index 00000000..d8eff619 --- /dev/null +++ b/src/site/markdown/index.md @@ -0,0 +1,7 @@ +## Plexus Common Utilities + +A collection of various utility classes to ease working with strings, files, command lines and more. + +Starting with version 4, XML classes (in `org.codehaus.plexus.util.xml` and `org.codehaus.plexus.util.xml.pull`) have been extracted to a separate [`plexus-xml`](../plexus-xml/) library: if you need them, just use this new artifact. + +`plexus-utils` 4 keeps an optional dependency on `plexus-xml` 3 to keep compatibility with the few XML-oriented methods of [`ReaderFactory`](./apidocs/org/codehaus/plexus/util/ReaderFactory.html) and [`WriterFactory`](./apidocs/org/codehaus/plexus/util/WriterFactory.html): these classes are deprecated, you should migrate as explained in javadoc. And keep `plexus-xml` to 3 if you want Maven 3 compatibility, as `plexus-xml` 4 works only in Maven 4.. diff --git a/src/site/site.xml b/src/site/site.xml index 38cbad8a..0d5a3d79 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -4,6 +4,14 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd"> + + + + + + + + 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]); } /**