2
votes

I am running into the following error when i try to build my spring boot project in gradle. I got the build.gradle from the spring initilizer.

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

Please find my 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()
}
1

1 Answers

0
votes

If you do not have a special reason to use specifically the SNAPSHOT version I suggest using release or milestone.

SNAPSHOT builds are quite unstable. If you want to take a look at the new 2.3 version of the Spring Boot you should probably use the milestone version. For today it would be 2.3.0.M4.

For that, change org.springframework.boot plugin version like this:

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