英文:
failed with MalformedInputException: Input length = 1 when building java application with maven 3.9.0
问题
Java应用程序在使用Maven 3.6.0-3.8.x构建时完全正常。然而,使用Maven 3.9.0构建时,对于HTML或XML文件出现了这个奇怪的错误。
在项目{project_name}上执行org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources(默认资源)目标失败:将{path1}/30168019.html过滤为{path2}/30168019.html时出现MalformedInputException:输入长度=1 -> [帮助 1]
起初,我认为可能与Maven的编码问题有关,但在POM文件中已经指定了UTF-8。是否有人知道是什么导致了这个错误?
英文:
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?
答案1
得分: 1
我通过将以下插件添加到我的pom.xml中来解决了这个问题:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
这只是一个临时解决方法,正确的解决方法是确保你的文件正确编码。更多细节在此选定答案中:https://stackoverflow.com/questions/65910112/maven-clean-install-failed-to-execute-goal-org-apache-maven-pluginsmaven-resou
英文:
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: https://stackoverflow.com/questions/65910112/maven-clean-install-failed-to-execute-goal-org-apache-maven-pluginsmaven-resou
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论