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


一、问题描述

在spring boot中的maven打包的时候出现下面的错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project helloword: 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

二、解决方法

在pom.xml文件中找到下面的代码:

<plugin>
	<groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

将上面的代码换成下面的代码:

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-resources-plugin</artifactId>
    <version>2.7</version>
    <dependencies>
    	<dependency>
        	<groupId>org.apache.maven.shared</groupId>
        	<artifactId>maven-filtering</artifactId>
        	<version>1.3</version>
    	</dependency>
    </dependencies>
</plugin>

然后跟新maven再打包就可以了。


文章作者: milu
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 milu !
  目录