'Plugin [id: 'org.springframework.boot', version: '2.2.4.RELEASE'] was not found in any of the following sources:

I have just downloaded the springboot project from http://start.spring.io/. After running it I got this error.

* What went wrong:
Plugin [id: 'org.springframework.boot', version: '2.2.4.RELEASE'] 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.2.4.RELEASE')
  Searched in the following repositories:
    Gradle Central Plugin Repository

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Can any one please suggest what is root cause.



Solution 1:[1]

I would recommend you to run gradle build command in your terminal. After this, do a gradle sync.

Must be some problem with your IDE.

Hope this solves your issue.

Solution 2:[2]

In my case I had configured a proxy from my job in the gradle.properties file, but I wasn't through their VPN.

If this is also your case, you can just comment the lines in that file, or just connect to the VPN if it is possible.

Solution 3:[3]

Accepted answer didn't work for me. I am able to resolve this after adding settings.gradle file in project root with,

settings.gradle:

pluginManagement {
    repositories {
        maven { url "<Repo_URL>" }
    }
}

Solution 4:[4]

I could solve it as follows:
In the build.gradle file add the following lines:

Add these lines to build.gradle

Then you must open a command window and enter the folder where you have the project and execute the following order:
gradle build

That's it, with this your error must be solved ... Greetings !!!

Solution 5:[5]

None of the answers above worked for me, what fixed it was removing '.RELEASE' from the version (see here)

id("org.springframework.boot") version "2.5.4.RELEASE"

to

id("org.springframework.boot") version "2.5.4"

Solution 6:[6]

I had this problem, too. I used the OpenJDK 1.8 in my Spring Boot Project which for whatever reason created these complications, so I changed it to Amazon Corretto JDK 11 and the sync and build ran without errors.

If you use IntelliJ I would recommend you to change your SDK in the Project Structure/Project, Project Structure/Modules and Project Structure/SDKs and finally change the Gradle JVM to the new JDK version in Settings/Build, Execution, Deployment/Build Tools/Gradle/GradleJVM.

Solution 7:[7]

I had this issue too, after trying out all the above it wasn't resolved. Then by trying gradle with other versions and other version of JDK, then I figured out that it was due to SSL authentication issue. In my case I have to add the security certificates from my local nexus repository to the JDK used by Gradle and the problem was resolved.

You can download the SSL certificates by browsing to the nexus repository manager and downloading it from the browser.

Solution 8:[8]

Guys for me was just old Gradle version, I updated following this link https://gradle.org/install/. For Ubuntu:

$ mkdir /opt/gradle
$ unzip -d /opt/gradle gradle-7.0.2-bin.zip
$ ls /opt/gradle/gradle-7.0.2
LICENSE  NOTICE  bin  getting-started.html  init.d  lib  media

Solution 9:[9]

Team adding below in build.gradle will help solve the issue:

allprojects  {
    apply plugin: 'maven'
    apply plugin: "io.spring.dependency-management"

    group = 'com.wnp'
    version = '6.5.0-SNAPSHOT'
}

Solution 10:[10]

I had the same error. The reason was in my Windows machine path to the java certs in gradle.properties file having in correct format (i.e / instead of \ ) systemProp.javax.net.ssl.trustStore=<JAVA_HOME>\\lib\\security\\cacerts

Solution 11:[11]

The default build.gradle file generated by spring.io only includes mavenCentral in repositories. Not sure why, but once in a while, this error shows up. Add jcenter as well in there, it should work. To be more clear repositories could look like following after change

repositories {
    jcenter()
    mavenCentral()
} 

Solution 12:[12]

First of all you need to understand the problem. Why did this error occur ? The lines in build.gradle file

plugins {
       id 'org.springframework.boot' version '2.2.4.RELEASE'
       id 'io.spring.dependency-management' version '1.0.9.RELEASE'
       id 'java'
}

tells gradle that "spring" and "java" are required for you project to build. Plugins are task in gradle.

Now for compiling the project the gradle has to bring these plugins specified. for that it will look in the repositories that you have specified. in

repositories {
            mavenCentral()
}

So There must not be any problem with the Code. Refreshing must solve