问题:

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>
GitHub 加速计划 / ma / maven
36
2
下载
Maven: Apache Maven是一个开源的项目管理和构建工具,主要用于Java项目。适合需要自动化项目构建和依赖管理的开发者。特点包括约定优于配置、易于使用和社区驱动。
最近提交(Master分支:2 个月前 )
d30ce5d6 The intend is to support multi-module project where more than one artifact may be produced. 2 小时前
1eba25ef 3 小时前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐