java Gradle:更改为springboot版本导致错误
具有以下渐变(从start.spring.io生成的基本渐变)。这很好
id 'org.springframework.boot' version '2.2.6.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
}
group = 'com.svadhyayanetworks'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
ext {
set('springCloudVersion', "Hoxton.SR3")
}
dependencies {
implementation 'org.springframework.cloud:spring-cloud-config-server'
implementation 'org.springframework.boot:spring-boot-starter'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
test {
useJUnitPlatform()
}
但一旦我从版本'2.2.6更改。发布“到”2.3.0。M4'。构建错误如下所示。 许多解决方案指出了imo似乎正确的存储库。 非常感谢您的帮助。 我的期望是gradle删除旧版本的jar并下载新版本
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'org.springframework.boot', version: '2.3.0.M4'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.springframework.boot:org.springframework.boot.gradle.plugin:2.3.0.M4')
Searched in the following repositories:
Gradle Central Plugin Repository```
# 1 楼答案
您需要使用以下内容更新
settings.gradle
:默认情况下,Gradle只查看官方的Gradle Maven存储库。Spring将里程碑/预发布发布发布到自己的存储库中