5

Hello guys I'm new to GraalVM and was trying to start a spring native project following the guide https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#getting-started-buildpacks.

When I tried to sync after I added plugins { id 'org.springframework.experimental.aot' version '0.11.0' } to my build.gradle file, it just failed with the error:

Plugin [id: 'io.spring.dependency-management', version: '1.0.11.RELEASE'] was not found in any of the following sources:

* Try:
Run with --scan to get full insights.

* Exception is:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'io.spring.dependency-management', version: '1.0.11.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 'io.spring.dependency-management:io.spring.dependency-management.gradle.plugin:1.0.11.RELEASE')
Searched in the following repositories:
MavenRepo
maven(https://repo.spring.io/release)

And here is my build.gradle

plugins {
    id 'org.springframework.boot' version '2.6.1'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
    id 'org.springframework.experimental.aot' version '0.11.0'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

repositories {
    mavenCentral()
    maven { url 'https://repo.spring.io/release' }
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    testImplementation('org.springframework.boot:spring-boot-starter-test')
}

test {
    useJUnitPlatform()
}

bootBuildImage {
    builder = "paketobuildpacks/builder:tiny"
    environment = [
            "BP_NATIVE_IMAGE" : "true"
    ]
    buildpacks = ["gcr.io/paketo-buildpacks/java-native-image:7.1.0"]
}

and setting.gradle:

pluginManagement {
    repositories {
        // ...
        mavenCentral()
        maven { url 'https://repo.spring.io/release' }
    }
}

rootProject.name = 'demo'

I'm wondering whether id 'io.spring.dependency-management' version '1.0.11.RELEASE' is incompatible with id 'org.springframework.experimental.aot' version '0.11.0'

So thankful if anyone can help me with that!!


nvm I solved it myself, that's a silly mistake lol

I was missing gradlePluginPortal() in my settings.gradle and it should be

pluginManagement {
    repositories {
        maven { url 'https://repo.spring.io/release' }
        mavenCentral()
        gradlePluginPortal()
    }
}
eve
  • 51
  • 1
  • 3
  • Thanks for answering! BTW, you should add as an answer below what you did to solve, so it's easier for other people to find it! – Leonardo Jul 14 '22 at 01:04

0 Answers0