我正在使用gradle插件:
id 'org.springframework.boot' version '2.7.2'拿着这个。我是不是遗漏了什么?
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发布于 2022-07-21 11:21:34
当存储库gradlePluginPortal()没有它时,请尝试mavenCentral()
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
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.version。println ">> ${it.target}"只是来做测试的。
选项B将在spring-boot-buildpack-platform的公共API没有改变的情况下工作。
https://stackoverflow.com/questions/73065110
复制相似问题