报错
Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.2.0:clean (default-clean) on project springbootdemo: The plugin org.apache.maven.plugins:maven-clean-plugin:3.2.0 requires Maven version 3.2.5 -> [Help 1]
环境:
os: win10
maven: 3.0.5
springboot: 2.7.3 (2022.8.26最新版)
在新建springboot
项目时,使用maven
清理插件发生报错
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.2.0:clean (default-clean) on project springbootdemo: The plugin org.apache.maven.plugins:maven-clean-plugin:3.2.0 requires Maven version 3.2.5 -> [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/PluginIncompatibleException
在网上查了一圈,全是抄来超去,驴唇不对马嘴,没有丝毫帮助
我查看了一下clean
的版本3.2
之前可以运行的项目的clean
的版本是3.1
我在pom.xml
中指定clean
版本没有用
我跑去文件夹下把3.2删掉,它会重新下载,清空target
也没有用
解决办法
在pom.xml
中添加如下
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<skipTests>true</skipTests>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
<!--修改maven-resources-plugin版本-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!--修改maven-compiler-plugin版本-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
</plugin>
<!--修改maven-jar-plugin版本-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
添加后,发现clean
版本回到了3.1.0
clean
package
complie
都可以使用
原因
我换用了比较早的springboot版本,发现没有这个问题,是springboot版本太高导致的