首页 > 其他分享 >Maven使用package打包报错

Maven使用package打包报错

时间:2023-03-17 16:33:07浏览次数:23  
标签:INFO maven package Maven 报错 ERROR resources

问题

​ 使用Maven package 打jar包的时候报错了,如下图显示

[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ springbootdemo2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.095 s
[INFO] Finished at: 2023-03-17T16:15:09+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project springbootdemo2: 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

原因

  1. 文件编码格式有误
  2. 可能是某些资源文件没有引入

解决办法

  1. IDEA的【Setting】中找到【File Encodings】设置编码格式

  1. 引入资源文件

<resources>
        <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.yml</include>
                    <include>**/*.xml</include>
                    <include>**/*.conf</include>
                    <include>**/*.setting</include>
                </includes>
        </resource>
</resources>

标签:INFO,maven,package,Maven,报错,ERROR,resources
From: https://www.cnblogs.com/lucky-jun/p/17227249.html

相关文章