Search code examples
javaspring-bootgradlebuild

Issue while setting up the spring boot with gradle


I am trying to setting up a Spring boot gradle project in intelliJ. If I am trying with reload button on the gradle pane, it's giving me error for setting.gradle

enter image description here

but setting.gradle file is already there is the root directory.

enter image description here

When I tried ./gradlew clean build on terminal getting the below error:

enter image description here

build.gradle

plugins {
    id 'java'
    id 'org.springframework.boot' version '3.0.0'
}

group 'com'
version '1.0'


repositories {
    mavenCentral()
}

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
    implementation 'org.springframework.boot:spring-boot-starter'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
    useJUnitPlatform()
}

java {
    sourceCompatibility = JavaVersion.toVersion('11')
    targetCompatibility = JavaVersion.toVersion('11')
}

I tried but couldn't figure out what I am missing. Please suggest.

Update: I tried to delete gradle installation from the system and executed one another application which was working fine earlier but not even after downloading the gradle version, getting the same error as mentioned above.

I tried Maven project with spring initializr and it successfully build so It seems to be an issue regarding gradle setup on my machine but not sure what to check.**

Regards


Solution

  • Not Sure why error message was not that clear. It was related to certificate issue. I added some organization specific certificate in java cacerts keystore and it resolved the gradle issue with plugin download.

    Thanks to All who tried to help.