首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >失踪弹簧-启动-内置包-平台

失踪弹簧-启动-内置包-平台
EN

Stack Overflow用户
提问于 2022-07-21 11:07:00
回答 1查看 193关注 0票数 0

我正在使用gradle插件:

代码语言:javascript
复制
    id 'org.springframework.boot' version '2.7.2'

拿着这个。我是不是遗漏了什么?

代码语言:javascript
复制
 Could not resolve all files for configuration ':classpath'.
   > Could not find org.springframework.boot:spring-boot-buildpack-platform:2.7.2.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-buildpack-platform/2.7.2/spring-boot-buildpack-platform-2.7.2.pom
     If the artifact you are trying to retrieve can be found in the repository but 
without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... 
}' of the repository declaration.
     Required by:
         project : > 
org.springframework.boot:org.springframework.boot.gradle.plugin:2.7.2 > 
org.springframework.boot:spring-boot-gradle-plugin:2.7.2
   > Could not find org.springframework.boot:spring-boot-loader-tools:2.7.2.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-loader- 
   tools/2.7.2/spring-boot-loader-tools-2.7.2.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
 Required by:
     project : > 
org.springframework.boot:org.springframework.boot.gradle.plugin:2.7.2 > 
org.springframework.boot:spring-boot-gradle-plugin:2.7.2
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-07-21 11:21:34

当存储库gradlePluginPortal()没有它时,请尝试mavenCentral()

代码语言:javascript
复制
runtimeOnly 'org.springframework.boot:spring-boot-buildpack-platform:2.7.1'

但目前还没有2.7.2版本。不确定这些版本是否必须匹配,但万一,降级为id 'org.springframework.boot' version '2.7.1'可能是您的最佳机会。

只是亲眼目睹,这意味着不存在。请不要问我他们为什么没有出版它。

当可以混合版本时,可以使用resolutionStrategy来更改它将解析的版本:

文件中的settings.gradle

代码语言:javascript
复制
pluginManagement {
    repositories {
        gradlePluginPortal()
        mavenCentral()
    }
    resolutionStrategy {
        eachPlugin {
            if (it.requested.id.getName() == 'org.springframework.boot') {
                if (it.requested.id.id == 'spring-boot-buildpack-platform') {
                    it.useModule('org.springframework.boot:spring-boot-buildpack-platform:2.7.1')
                }
                println ">> ${it.target}"
            } else {
                println ">  ${it.target}"
            }
        }
    }
}

无论是it.useModule还是it.versionprintln ">> ${it.target}"只是来做测试的。

选项B将在spring-boot-buildpack-platform的公共API没有改变的情况下工作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73065110

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档