Maven3.9.6 构建项目报错 Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources (default-resources) on project ***

在使用Maven3.9.6构建项目时,出现以下错误:

[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ service-sample ---
[INFO] Copying 18 resources from src/main/java to target/classes
[INFO] Copying 15 resources from src/main/resources to target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.123 s
[INFO] Finished at: 2024-02-02T11:08:07+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources (default-resources) on project service-sample: filtering /Workspaces/server-template/src/main/resources/license/certfile.cer to /Workspaces/server-template/target/classes/license/certfile.cer 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] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

解决方案:

指定maven-resources-plugin的版本。

<pluginManagement>
  <plugins>
    <plugin>
      <artifactId>maven-resources-plugin</artifactId>
      <version>3.1.0</version>
      <configuration>
        <useDefaultDelimiters>true</useDefaultDelimiters>
      </configuration>
    </plugin>
  </plugins>
</pluginManagement>

 

posted @ 2024-02-07 10:47  Commissar-Xia  阅读(83)  评论(0编辑  收藏  举报