【问题标题】:Could not find spring-boot-2.3.0.BUILD-SNAPSHOT.jar Error找不到 spring-boot-2.3.0.BUILD-SNAPSHOT.jar 错误
【发布时间】:2020-07-22 08:52:36
【问题描述】:

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

无法解析配置“:classpath”的所有工件。 找不到 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)。 在以下位置搜索: 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 build

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()
}

【问题讨论】:

    标签: java spring spring-boot gradle


    【解决方案1】:

    如果您没有特殊原因专门使用SNAPSHOT 版本,我建议使用releasemilestone

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

    为此,更改org.springframework.boot 插件版本如下:

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-08
    • 1970-01-01
    • 1970-01-01
    • 2020-09-11
    • 2017-02-18
    • 2020-08-03
    • 2023-03-09
    相关资源
    最近更新 更多