Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources

关于spring boot 项目打包常出现的两个问题:

出现如下问题请不要随意更换修改版本。如果修改了某些版本,如下解决办法依然无法解决问题的话,请把maven仓库内容删除干净重新拉取下载,再用一下方法即可解决问题。没有配置maven的话,maven一般在  C:\Users\Administrator\.m2目录里面。

1、 Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project springboot_04_profile: Input length = 1 -> [Help 1]

具体报错:

Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources_第1张图片

 这是由于系统默认编码造成的,在  File——>Settings——>Editor——>File Encodings里面修改默认编码为UTF-8,如下:

Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources_第2张图片

如果你设置了编码还不能打包成功,那就说明你的src目录下有资源文件没有引用进去,请在pom.xml build里添加如下配置:

        
            
                src/main/resources
                
                    **/*.properties
                    **/*.yml
                    **/*.xml
                    **/*.conf
                
            
        

如图打包成功 

Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources_第3张图片


2、Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project 02-springboot-jbaby: There are test failures.

打开右侧manve 点击如下,跳过测试用例。如果你因为看了某些误导人的博客修改了maven-surefire-plugin的版本,那么请把本地maven仓库删干净,否则后续无论怎么搞都是一直报这个错误,反正我是折磨了两天都无法解决。

Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources_第4张图片

你可能感兴趣的:(maven,java,spring)