spring-boot-buildpack-platform/2.6.5/ files missing in the Gradle repo

Repro: Go to https://start.spring.io/ and create a project with Spring 2.6.5 and Gradle. It will fail because the files here are missing: https://repo.gradle.org/ui/native/jcenter/org/springframework/boot/spring-boot-buildpack-platform/2.6.5/

Comment From: zromano

It works now, looks like it was probably an issue on the Jfrog side.

Not sure what you all can do about this, but Gradle didn't work for a couple hours after your release. We track your releases and make sure we are on the latest, so this was frustrating this morning.

Comment From: bclozel

This artifact is still resolving intermittently from my side. I guess the 404 response is being cached by Gradle's JCenter mirror's CDN. The status website looks fine.

Comment From: zromano

Yeah, the POM is resolving for me now so I'm unblocked. Looks like some of the files are still missing though when I load that page.

Just for documentation, here is the error I got:

$ ./gradlew --build-cache --gradle-user-home cache/ clean build jacocoTestReport sonarqube -Dsonar.qualitygate.wait=true
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'service-user'.
> Could not resolve all files for configuration ':classpath'.
   > Could not find org.springframework.boot:spring-boot-buildpack-platform:2.6.5.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-buildpack-platform/2.6.5/spring-boot-buildpack-platform-2.6.5.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > org.springframework.boot:org.springframework.boot.gradle.plugin:2.6.5 > org.springframework.boot:spring-boot-gradle-plugin:2.6.5
   > Could not find org.springframework.boot:spring-boot-loader-tools:2.6.5.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-loader-tools/2.6.5/spring-boot-loader-tools-2.6.5.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > org.springframework.boot:org.springframework.boot.gradle.plugin:2.6.5 > org.springframework.boot:spring-boot-gradle-plugin:2.6.5
* 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.
* Get more help at https://help.gradle.org/
BUILD FAILED in 10s

and here is an image of JFrog with missing files (I didn't screenshot with the required POM was missing) SpringBoot Dependencies of a newly published Gradle plugin may not be available from the Plugin Portal/JCenter

Comment From: zromano

Not sure if you can upload the JFrog artifacts prior to release, but would be great if they were available when the Maven update comes out  🙂

Comment From: bclozel

We are publishing our Gradle plugin as part of our release pipeline. In this case the Gradle JCenter mirror (which goal is to mirror Maven Central if I'm not mistaken) is out of sync, or failures are cached for a while by the CDN (and this can depend on your location).

I don't know if we can improve the process here.

Comment From: wilkinsona

Not sure if you can upload the JFrog artifacts prior to release

We can't as we don't have write access to that repository.

One thing that we could do in the meantime is to encourage users to configure mavenCentral() as a plugin repository. This would allow the plugin's dependencies (and the plugin itself) to be downloaded from their canonical source, even when the Plugin Portal or JCenter is down.

Another option would be to shadow all of the Gradle plugin's dependencies into its jar so that the artifact in the Plugin Portal contains everything that's needed.

We could also update the release checklist to include the generation of a Gradle-based project as we already do for Maven.

Comment From: wilkinsona

I've discussed this with the Gradle team and they have recommended that we don't do anything at this time. They are looking into improving things on their side. We can reconsider if this causes problems with the next release. Closing for now at least.

Comment From: antoniolucasnobar

Just for you guys to know, I am having the same problem with version 2.6.6 (important because of spring4shell vulnerability). I really do not know what to do. Sit and wait does not seem to be cool...

Comment From: mxab

put this at the top of your settings.gradle


pluginManagement {
    repositories {
        mavenCentral()
        gradlePluginPortal()
    }
}

Comment From: antoniolucasnobar

Thank you very much @mxab !

This solved my urgent problem. But we use a private nexus in our company and I do not know if I can keep this configuration.

Your suggestion is a one-time solution? Or everytime we need to update SpringBoot right after their release I have to do that?

One more time, thank you!

Comment From: YeonCheolGit

@mxab This works for me. Thanks:)

Comment From: mxab

@antoniolucasnobar you can configure any maven repository you like here see https://docs.gradle.org/current/userguide/plugins.html#sec:custom_plugin_repositories

Assuming your private nexus mirros maven central anyways I guess you should be fine replacing mavenCentral() with you private nexus settings as you do it in the repository part in your regular build.gradle

Comment From: Archsx

put this at the top of your settings.gradle

groovy pluginManagement { repositories { mavenCentral() gradlePluginPortal() } }

Hi, what if I use IDEA to create a project with kotlin, the settings.gradle.kts have only one line :

rootProject.name = "myProjectName"

what code should I put here ?

Comment From: wilkinsona

@Archsx I believe the Kotlin syntax is identical in this case:

settings.gradle.kts:

pluginManagement {
    repositories {
        mavenCentral()
        gradlePluginPortal()
    }
}

rootProject.name = "myProjectName"

Comment From: Archsx

@Archsx I believe the Kotlin syntax is identical in this case:

settings.gradle.kts:

``` pluginManagement { repositories { mavenCentral() gradlePluginPortal() } }

rootProject.name = "myProjectName" ```

thank you ! I'm new to kotlin so I asked the question, it works. but the code looks like diffrent sytle.

Comment From: sungmin69355

@Archsx I believe the Kotlin syntax is identical in this case:

settings.gradle.kts:

``` pluginManagement { repositories { mavenCentral() gradlePluginPortal() } }

rootProject.name = "myProjectName" ```

How does the code above work on a multi-module?

Comment From: wilkinsona

settings.gradle and settings.gradle.kts apply to all modules in the build.