Skip to content

Replace the deprecated plexus-utils APIs in provider code - #976

Merged
slachiewicz merged 1 commit into
wagon-3.xfrom
agent/wagon-drop-deprecated-plexus-utils
Sep 3, 2026
Merged

Replace the deprecated plexus-utils APIs in provider code#976
slachiewicz merged 1 commit into
wagon-3.xfrom
agent/wagon-drop-deprecated-plexus-utils

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Drops the three deprecated or superseded plexus-utils APIs left in provider code, per #975:

  • wagon-ssh-common StreamKnownHostsProviderStringOutputStream and IOUtil.copy/IOUtil.close become a ByteArrayOutputStream and try-with-resources. toString() without an explicit charset keeps the platform default StringOutputStream used.
  • wagon-ssh AbstractJschWagonIOUtil.close becomes a local closeQuietly, keeping the null check and swallowed IOException.
  • wagon-http-lightweight LightweightHttpWagonplexus-utils Base64 becomes java.util.Base64. Base64 output is ASCII, so encodeToString matches the previous new String(encodeBase64(...)).

Deliberately unchanged: the Basic credentials still go through String.getBytes() with the platform default charset. That is WAGON-627 / #787 territory and needs its own decision.

Verified: mvn install on the three modules and their prerequisites → BUILD SUCCESS, wagon-http-lightweight 219/0/0 (7 skipped), wagon-ssh-common 10/0/0, wagon-ssh-common-test 19/0/0. Both changed paths are covered — FileKnownHostsProvider extends StreamKnownHostsProvider, and LightweightHttpWagonWithPreemptiveAuthenticationTest exercises the Basic header. Negative control: corrupting the encoded credentials turned that suite red (4 failures), so the passing run gates the change rather than skipping it. spotless:check passes.

This change was created with AI assistance.

StringOutputStream and IOUtil are deprecated, and plexus-utils Base64 is
superseded by java.util.Base64 now the line requires Java 8. The Basic
credentials keep using String.getBytes() with the platform default
charset -- that is WAGON-627 territory and deliberately not changed here.
@slachiewicz slachiewicz added dependencies Pull requests that update a dependency file maintenance mvn3 labels Sep 3, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 3, 2026 22:17
@slachiewicz slachiewicz removed the dependencies Pull requests that update a dependency file label Sep 3, 2026
@slachiewicz
slachiewicz merged commit 560bd27 into wagon-3.x Sep 3, 2026
13 checks passed
@slachiewicz
slachiewicz deleted the agent/wagon-drop-deprecated-plexus-utils branch September 3, 2026 23:01
@github-actions github-actions Bot added this to the 3.5.4 milestone Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant