GoogleContainerTools / jib-extensions

Apache License 2.0
117 stars 35 forks source link

jib-native-image-extension-gradle not released #133

Closed asheshsaraf closed 2 years ago

asheshsaraf commented 2 years ago

Hi,

Please release the submodule jib-native-image-extension-gradle as it is not yet released.

Thanks, Ashesh Saraf

elefeint commented 2 years ago

We are planning a release of all Jib modules in the next two weeks.

asheshsaraf commented 2 years ago

Thanks for the prompt reply. I do have some counter questions though:

  1. Since it is not released yet, is any testing been done for these extensions?
  2. Do we foresee any changes in these extensions before they are released?
elefeint commented 2 years ago

Yes, we've tested when accepting the contribution. No, the extension won't change unless bugs are found.

asheshsaraf commented 2 years ago

Getting the below error while using jib-native-image-extension-gradle library and running ./gradlew jib command. Any idea on the issue?

error running extension 'com.google.cloud.tools.jib.plugins.extension.NullExtension': extension configured but not discovered on Jib runtime classpath: com.google.cloud.tools.jib.gradle.extension.nativeimage.JibNativeImageExtension

Note: I have published the library locally. Here are the changes done in build.gradle.kts file:

buildscript {
    dependencies {
        classpath("com.google.cloud.tools:jib-native-image-extension-gradle:0.1.0-SNAPSHOT")
    }
}

plugins {
  ....
  id("org.springframework.experimental.aot") version "0.12.1"
  id("org.graalvm.buildtools.native") version "0.9.13"
}

tasks.withType<BootBuildImage> {
    builder = "paketobuildpacks/builder:tiny"
    environment = mapOf(
        "BP_NATIVE_IMAGE" to "true")
    buildpacks = listOf("gcr.io/paketo-buildpacks/graalvm:7.5.1","gcr.io/paketo-buildpacks/java-native-image:7.26.0")
    imageName = ***
}

jib {
    .....
    pluginExtensions {
        pluginExtension {
            implementation = "com.google.cloud.tools.jib.gradle.extension.nativeimage.JibNativeImageExtension"
            properties = mapOf("imageName" to imageName)
        }
    }
}
chanseokoh commented 2 years ago

Can you verify if the class is available in the build script, e.g., like the folloiwng?

buildscript {
    dependencies {
        classpath("com.google.cloud.tools:jib-native-image-extension-gradle:0.1.0-SNAPSHOT")
    }
}

plugins {
  ...
}

import com.google.cloud.tools.jib.gradle.extension.nativeimage.JibNativeImageExtension
println(JibNativeImageExtension::class.toString())

...
asheshsaraf commented 2 years ago

Yes, the full class name is getting printed. "class com.google.cloud.tools.jib.gradle.extension.nativeimage.JibNativeImageExtension"

But still getting the same error: error running extension 'com.google.cloud.tools.jib.plugins.extension.NullExtension': extension configured but not discovered on Jib runtime classpath: com.google.cloud.tools.jib.gradle.extension.nativeimage.JibNativeImageExtension

chanseokoh commented 2 years ago

The only explanation I can think of is that your SNAPSHOT jar has a missing/old/incorrect service provider configuration. I'd manually open the jar file published to ~/.m2/repository and check if the file is on the correct path and there's no typo.

haroldlbrown commented 2 years ago

From what I can see jib-native-image-extension-gradle has still not been released yet. Or am I mistaken?

elefeint commented 2 years ago

You are correct; we are looking to release it this week.

zhumin8 commented 2 years ago

jib-native-image-extension-gradle is released now! It should show up in maven repository in a few hours.