gpt4 book ai didi

java - 找不到spring-boot-2.3.0.BUILD-SNAPSHOT.jar错误

转载 作者:行者123 更新时间:2023-12-03 03:25:41 25 4
gpt4 key购买 nike

我尝试在gradle中构建spring boot项目时遇到以下错误。我从spring initilizer得到了build.gradle。

Could not resolve all artifacts for configuration ':classpath'. Could not find spring-boot-gradle-plugin-2.3.0.BUILD-SNAPSHOT.jar (org.springframework.boot:spring-boot-gradle-plugin:2.3.0.BUILD-SNAPSHOT:20200409.145011-519). Searched in the following locations: https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-gradle-plugin/2.3.0.BUILD-SNAPSHOT/spring-boot-gradle-plugin-2.3.0.BUILD-20200409.145011-519.jar



请找到我的gradle版本
plugins {
id 'org.springframework.boot' version '2.3.0.BUILD-SNAPSHOT'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
}

group = 'com.mycompany'
version = '0.0.1-SNAPSHOT' //TODO how does verioning work in this project?
sourceCompatibility = '1.8'

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-integration'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.kafka:spring-kafka'
implementation 'org.springframework.boot:spring-boot-starter-aop'

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation ('org.springframework.integration:spring-integration-test'){
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation ('org.springframework.kafka:spring-kafka-test'){
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
}

test {
useJUnitPlatform()
}

最佳答案

如果您没有特殊原因要专门使用SNAPSHOT版本,建议您使用release或Milestone。

SNAPSHOT版本非常不稳定。如果要查看Spring Boot的新2.3版本,则可能应该使用里程碑版本。今天将是2.3.0.M4

为此,请像这样更改org.springframework.boot插件版本:

id 'org.springframework.boot' version '2.3.0.M4'

关于java - 找不到spring-boot-2.3.0.BUILD-SNAPSHOT.jar错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61126186/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com