Skip to content

Improve error message for MalformedInputException during resource fil…#328

Open
ban-xiu wants to merge 2 commits intoapache:maven-filtering-3.xfrom
ban-xiu:improve-malformed-input-error-msg
Open

Improve error message for MalformedInputException during resource fil…#328
ban-xiu wants to merge 2 commits intoapache:maven-filtering-3.xfrom
ban-xiu:improve-malformed-input-error-msg

Conversation

@ban-xiu
Copy link

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

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
Copy link
Author

ban-xiu commented Mar 8, 2026

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.

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.

1 participant