Home > Blockchain >  Missing spring-boot-buildpack-platform
Missing spring-boot-buildpack-platform

Time:07-22

I'm using gradle plugin:

    id 'org.springframework.boot' version '2.7.2'

And getting this. Am I missing something?

 Could not resolve all files for configuration ':classpath'.
   > Could not find org.springframework.boot:spring-boot-buildpack-platform:2.7.2.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-buildpack-platform/2.7.2/spring-boot-buildpack-platform-2.7.2.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.7.2 > 
org.springframework.boot:spring-boot-gradle-plugin:2.7.2
   > Could not find org.springframework.boot:spring-boot-loader-tools:2.7.2.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-loader- 
   tools/2.7.2/spring-boot-loader-tools-2.7.2.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.7.2 > 
org.springframework.boot:spring-boot-gradle-plugin:2.7.2

CodePudding user response:

When repository gradlePluginPortal() doesn't have it, try mavenCentral():

runtimeOnly 'org.springframework.boot:spring-boot-buildpack-platform:2.7.1'

But there no version 2.7.2 yet. Not sure if these versions would have to match, but in case of, downgrading to id 'org.springframework.boot' version '2.7.1' might be your best chance.
Just see for yourself, it's imply not there. Please don't ask me why they've not published it.


When versions can be mixed, one can use resolutionStrategy to change the version it will resolve:

In file settings.gradle:

pluginManagement {
    repositories {
        gradlePluginPortal()
        mavenCentral()
    }
    resolutionStrategy {
        eachPlugin {
            if (it.requested.id.getName() == 'org.springframework.boot') {
                if (it.requested.id.id == 'spring-boot-buildpack-platform') {
                    it.useModule('org.springframework.boot:spring-boot-buildpack-platform:2.7.1')
                }
                println ">> ${it.target}"
            } else {
                println ">  ${it.target}"
            }
        }
    }
}

Either with it.useModule or it.version. println ">> ${it.target}" is just there for tesing.
Option B will work while the public API of spring-boot-buildpack-platform hasn't changed.

  • Related