报错

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版本太高导致的

分类: java

站点统计

  • 文章总数:309 篇
  • 分类总数:19 个
  • 标签总数:191 个
  • 运行天数:1009 天
  • 访问总数:129682 人次

浙公网安备33011302000604

辽ICP备20003309号