Skip to content

Improve error message for MalformedInputException during resource fil… - #328

Merged
slawekjaranowski merged 4 commits into
apache:maven-filtering-3.xfrom
ban-xiu:improve-malformed-input-error-msg
Jun 12, 2026
Merged

Improve error message for MalformedInputException during resource fil…#328
slawekjaranowski merged 4 commits into
apache:maven-filtering-3.xfrom
ban-xiu:improve-malformed-input-error-msg

Conversation

@ban-xiu

@ban-xiu ban-xiu commented Mar 8, 2026

Copy link
Copy Markdown

Close #327

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.

@ban-xiu

ban-xiu commented Mar 8, 2026

Copy link
Copy Markdown
Author

Modified log is:

[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< com.example:encoding-test >----------------------
[INFO] Building encoding-test 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ encoding-test ---
[INFO] Deleting D:\JavaProjects\maven-filtering-coding-test\target
[INFO] 
[INFO] --- resources:3.5.0:resources (default-cli) @ encoding-test ---
[INFO] Copying 2 resources from src\main\resources to target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.192 s
[INFO] Finished at: 2026-03-08T17:25:48+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.5.0:resources (default-cli) on project encoding-test: filtering D:\JavaProjects\
maven-filtering-coding-test\src\main\resources\test.txt to D:\JavaProjects\maven-filtering-coding-test\target\classes\test.txt failed with IOException: using encoding UTF-8. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Then using mvn -X allows you to see the original exception message.

Comment thread src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java Outdated
@slachiewicz slachiewicz added the bug Something isn't working label May 10, 2026
@ban-xiu
ban-xiu requested a review from slawekjaranowski June 1, 2026 12:21
@ban-xiu

ban-xiu commented Jun 2, 2026

Copy link
Copy Markdown
Author
image

@slawekjaranowski
slawekjaranowski merged commit 2107ec4 into apache:maven-filtering-3.x Jun 12, 2026
27 of 34 checks passed
@github-actions github-actions Bot added this to the 3.5.1 milestone Jun 12, 2026
@slawekjaranowski

Copy link
Copy Markdown
Member

@ban-xiu please also cherry pick to master branch

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error message for MalformedInputException during resource filtering

3 participants