question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Quarkus define jib extension error

See original GitHub issue

Environment:

  • Jib version: 3.2.1
  • Build tool: Gradle 7.4.2
  • OS: windows 11

Description of the issue: I get the following error when I run the jib plugin. Seems to be some kind of error that the jib kit is not found.

A problem occurred evaluating root project 'kafka-demo'.
> No signature of method: build_13fywf16j0dbj94mdj0di8vmt.jib() is applicable for argument types: (build_13fywf16j0dbj94mdj0di8vmt$_run_closure6) values: [build_13fywf16j0dbj94mdj0di8vmt$_run_closure6@6aedf396]
  Possible solutions: is(java.lang.Object), wait(), run(), run(), find(), any()

Expected behavior: Can build image.

Steps to reproduce:

  1. import id 'com.google.cloud.tools.jib' version '3.2.1'
  2. config jib plugin
  3. run jib plugin

jib-gradle-plugin Configuration:

buildscript {
    dependencies {
        classpath('com.google.cloud.tools:jib-quarkus-extension-gradle:0.1.1')
    }
}
plugins {
    id 'java'
    id 'io.quarkus'
    id 'com.google.cloud.tools.jib' version '3.2.1'
}

repositories {
    mavenCentral()
    mavenLocal()
}

dependencies {
    implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
    implementation enforcedPlatform("${quarkusPlatformGroupId}:quarkus-camel-bom:${quarkusPlatformVersion}")
    implementation 'org.apache.camel.quarkus:camel-quarkus-core'
    implementation 'org.apache.camel.quarkus:camel-quarkus-kafka'
    implementation 'io.quarkus:quarkus-arc'
    implementation 'org.apache.camel.quarkus:camel-quarkus-timer:2.9.0'
    implementation 'org.apache.camel.quarkus:camel-quarkus-jackson:2.9.0'
    testImplementation 'io.quarkus:quarkus-junit5'
}

group 'org.cch'
version '1.0.0-SNAPSHOT'

java {
    sourceCompatibility = JavaVersion.VERSION_11
    targetCompatibility = JavaVersion.VERSION_11
}

compileJava {
    options.encoding = 'UTF-8'
    options.compilerArgs << '-parameters'
}

compileTestJava {
    options.encoding = 'UTF-8'
}

jib {
   from {
       image = 'registry.access.redhat.com/ubi8/openjdk-11:1.11'
   }
   to {
       image = "registry.hub.docker.com/xxx/${project.getName()}"
       tags = of(version.toString(), "latest")
   }
   container {
       jvmFlags = ['-Dquarkus.http.host=0.0.0.0','-Duser.timezone=UTC','-Xms128m', '-Xmx1g']
       creationTime = Instant.now().toString()
       format = 'OCI'
       args = []
       ports = ['8080/tcp']
       labels = [maintainer: 'cch', app: 'kafka-producer']
       user = '1001'
   }
   pluginExtensions {
       pluginExtension {
           implementation = 'com.google.cloud.tools.jib.gradle.extension.quarkus.JibQuarkusExtension'
       }
   }
}

Log output:

A problem occurred evaluating root project 'kafka-demo'.
> No signature of method: build_13fywf16j0dbj94mdj0di8vmt.jib() is applicable for argument types: (build_13fywf16j0dbj94mdj0di8vmt$_run_closure6) values: [build_13fywf16j0dbj94mdj0di8vmt$_run_closure6@6aedf396]
  Possible solutions: is(java.lang.Object), wait(), run(), run(), find(), any()

Additional Information: I wish there was a Quarkus example using jib.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mpeddada1commented, Jun 29, 2022

Hey @CCH0124 Sometimes this unauthorized error can be caused by credential misconfiguration. As mentioned in the error message, a good starting point could be to verify with this FAQ section if your setup matches any of these scenarios. Also make sure that the same credentials work with docker push after logging in with docker login.

1reaction
chanseokohcommented, Jun 13, 2022

It’s a Gradle usage issue. This should work:

    to {
        image = "registry.hub.docker.com/xxx/${project.getName()}"
-       tags = of(version.toString(), "latest")
+       tags = [version]
    }

Note tags mean additional tags (yes, we regret the current naming choice) and registry.hub.docker.com/xxx/${project.getName()} implies registry.hub.docker.com/xxx/${project.getName()}:latest, so no need to put "latest" in tags.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Container Images - Quarkus
The extension quarkus-container-image-jib is powered by Jib for performing ... When multiple container image extensions are present, an error will be raised ...
Read more >
Kubernetes extension - Quarkus
The name of the image is controlled by the Jib extension and can be customized using the usual application.properties . For example with...
Read more >
All configuration options - Quarkus
AWS Lambda Type Default AWS Lambda Common Type Default AWS Lambda Gateway REST API Type Default Agroal ‑ Database connection pool Type Default
Read more >
Building a Native Executable - Quarkus
If you see the following invalid path error for your application JAR when trying to create a native executable using a container build,...
Read more >
Testing Your Application - Quarkus
Now we have defined our profile we need to include it on our test class. ... the quarkus-container-image-jib or quarkus-container-image-docker extensions ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found