Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

failed with MalformedInputException: Input length = 1 when building java application with maven 3.9.0

Tags:

java

maven

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?

like image 244
Dray56 Avatar asked Jul 10 '26 17:07

Dray56


2 Answers

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

like image 170
theckler Avatar answered Jul 12 '26 07:07

theckler


The first response helped me, but it still resulted in a 'Warning'. I resolved it by making the following configuration:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.1.0</version>
    <configuration>
        <encoding>UTF-8</encoding>
    </configuration>
</plugin>
like image 36
Emmanuel Orozco Lopez Avatar answered Jul 12 '26 08:07

Emmanuel Orozco Lopez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!