5
votes

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.

8
check your internet connectionToerktumlare

8 Answers

7
votes

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.

4
votes

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.

1
votes

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>" }
    }
}
0
votes

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.

0
votes

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 !!!

0
votes

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
-1
votes

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

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