问题:

Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.3:repackage (default) on project microservice-eureka: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.5.3:repackage failed: Plugin org.springframework.boot:spring-boot-maven-plugin:2.5.3 or one of its dependencies could not be resolved: Failed to collect dependencies at org.springframework.boot:spring-boot-maven-plugin:jar:2.5.3 -> org.springframework.boot:spring-boot-buildpack-platform:jar:2.5.3

原因:

由于spring-boot-maven-plugin版本不一致导致的,项目pom文件中对这个jar没有指定版本,默认使用的是最新的2.5.3版本,对于我们的项目只能是2.3.1.RELEASE这个版本。

解决办法:

在项目pom文件中指定插件的版本为2.3.1.RELEASE

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <version>2.3.1.RELEASE</version>
    <executions>
        <execution>
            <goals>
                <goal>repackage</goal>
            </goals>
        </execution>
    </executions>
</plugin>
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐