gitlab上的build err: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3.1
1.err内容
[INFO] Copying 2 resources from src/main/resources to target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.750 s
[INFO] Finished at: 2025-07-04T03:43:29Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources (default-resources) on project demo: filtering /builds/sitingwu9647-group/spring-boot-vue-samples/backend/src/main/resources/application.properties to /builds/sitingwu9647-group/spring-boot-vue-samples/backend/target/classes/application.properties failed with MalformedInputException: Input length = 1 -> [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] MojoExecutionException - Apache Maven - Apache Software Foundation
Cleaning up project directory and file based variables00:01
ERROR: Job failed: exit code 1
2.解决方法
这个错误是由于 Maven 在处理资源文件(特别是 application.properties)时遇到了 字符编码问题,导致 MalformedInputException: Input length = 1。这通常表示文件中存在非 UTF-8 编码的字符,而 Maven 默认使用 UTF-8 来读取资源文件。
解决方法如下:
检查资源文件编码
• 打开 src/main/resources/application.properties 文件。
• 确保它是 UTF-8 编码。你可以使用 IDE(如 IntelliJ IDEA 或 VS Code)查看并转换编码。
更多推荐



所有评论(0)