2

The java application is building perfectly fine with maven 3.6.0-3.8.x . However with maven 3.9.0 it is giving this strange error for html or xml files.

Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources (default-resources) on project {project_name}: filtering {path1}/30168019.html to {path2}/30168019.html failed with MalformedInputException: Input length = 1 -> [Help 1]

First I thought might be some encoding issue wrt maven but in the pom file it is mentioned utf-8 itself. Does anyobody have any idea what might be causing this error?

Dray56
  • 37
  • 1
  • Get maven to give you the stacktraces for the errors; e.g. `mvn -e ...`. The problem >is< most likely something to do with encoding. Maybe some of the HTML files it is copying are NOT properly encoded UTF-8. Maybe Maven is trying to read them as UTF-8 and that is failing. – Stephen C Mar 09 '23 at 13:51

1 Answers1

0

I had this issue and fixed it by adding the below plugin to my pom.xml:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.1.0</version>
</plugin>

This is a workaround, and the proper fix is to make sure your files are properly encoded. More details in the selected answer here: Maven clean install: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources

theckler
  • 21
  • 3