Skip to content

Replace deprecated Plexus WriterFactory usage in MavenProjectInput#444

Open
anukalp2804 wants to merge 6 commits intoapache:masterfrom
anukalp2804:replace-deprecated-plexus-writer
Open

Replace deprecated Plexus WriterFactory usage in MavenProjectInput#444
anukalp2804 wants to merge 6 commits intoapache:masterfrom
anukalp2804:replace-deprecated-plexus-writer

Conversation

@anukalp2804
Copy link
Copy Markdown

This PR addresses one of the deprecations reported in #436 by replacing the deprecated plexus-utils WriterFactory.newXmlWriter(...) usage in MavenProjectInput with an equivalent JDK-based writer.

The change is intentionally small and self-contained, and does not alter behavior.

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@anukalp2804
Copy link
Copy Markdown
Author

@elharo ,
This PR addresses the deprecated WriterFactory usage mentioned in #436.
I’ve kept the change intentionally small and limited to that single deprecation.

try (Writer writer = new OutputStreamWriter(output, StandardCharsets.UTF_8)) {
new MavenXpp3Writer().write(writer, prototype);

// normalize env specifics
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should really get rid of MavenXpp3Writer in the same PR since they're tied together

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review.

I’ve updated the code to write directly to the output stream and replaced MavenXpp3Writer, so both deprecations are addressed together as suggested.

@anukalp2804 anukalp2804 force-pushed the replace-deprecated-plexus-writer branch from 00b4c01 to d9637f1 Compare January 25, 2026 16:31
@anukalp2804 anukalp2804 requested a review from elharo February 17, 2026 14:52
Copy link
Copy Markdown
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might need to push, I don't see these changes made

@anukalp2804
Copy link
Copy Markdown
Author

Thank you — I’ve pushed the updated changes now.

Please let me know if any further changes are needed.

Comment thread src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java Outdated
@anukalp2804
Copy link
Copy Markdown
Author

Hi, just checking in — this PR was approved earlier. Please let me know if anything else is needed from my side before it can be merged. Thanks!

1 similar comment
@anukalp2804
Copy link
Copy Markdown
Author

Hi, just checking in — this PR was approved earlier. Please let me know if anything else is needed from my side before it can be merged. Thanks!

@elharo
Copy link
Copy Markdown
Contributor

elharo commented Apr 13, 2026

tests are failing on JDK 17

Copy link
Copy Markdown
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests need to pass

@anukalp2804
Copy link
Copy Markdown
Author

tests need to pass

Thanks for the feedback — I’m investigating the JDK 17 test failures and will update shortly.

@anukalp2804 anukalp2804 force-pushed the replace-deprecated-plexus-writer branch from eb8d6e9 to 1a02f83 Compare April 13, 2026 16:17
@anukalp2804
Copy link
Copy Markdown
Author

Updated to use UTF-8 encoding via charset name to ensure consistent behavior and fix JDK 17 test failures.

@anukalp2804
Copy link
Copy Markdown
Author

Hi, I have updated the JDK 17 test failures. Please let me know if anything else is needed from my side

Thank you

@anukalp2804
Copy link
Copy Markdown
Author

Solve the format violations. I hope this will correct.

@anukalp2804 anukalp2804 force-pushed the replace-deprecated-plexus-writer branch from e056988 to f489889 Compare April 19, 2026 13:44
@anukalp2804
Copy link
Copy Markdown
Author

updated code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants