{"record":{"id":"bea67e1919a177ba","repo":"GoogleContainerTools/jib","slug":"extension-configured-but-not-discovered-on-jib-run","errorCode":null,"errorMessage":"extension configured but not discovered on Jib runtime classpath: ${config.getExtensionClass()}","messagePattern":"extension configured but not discovered on Jib runtime classpath: (.+?)","errorType":"exception","errorClass":"JibPluginExtensionException","httpStatus":null,"severity":"error","filePath":"jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java","lineNumber":539,"sourceCode":"              config.getProperties(),\n              Optional.ofNullable(extraConfig),\n              () -> project,\n              new PluginExtensionLogger(this::log));\n    } catch (RuntimeException ex) {\n      throw new JibPluginExtensionException(\n          extension.getClass(), \"extension crashed: \" + ex.getMessage(), ex);\n    }\n  }\n\n  private JibGradlePluginExtension<?> findConfiguredExtension(\n      List<JibGradlePluginExtension<?>> extensions, ExtensionConfiguration config)\n      throws JibPluginExtensionException {\n    Predicate<JibGradlePluginExtension<?>> matchesClassName =\n        extension -> extension.getClass().getName().equals(config.getExtensionClass());\n    Optional<JibGradlePluginExtension<?>> found =\n        extensions.stream().filter(matchesClassName).findFirst();\n    if (!found.isPresent()) {\n      throw new JibPluginExtensionException(\n          NullExtension.class,\n          \"extension configured but not discovered on Jib runtime classpath: \"\n              + config.getExtensionClass());\n    }\n    return found.get();\n  }\n\n  private SourceSet getMainSourceSet() {\n    SourceSetContainer sourceSetContainer =\n        project.getExtensions().getByType(SourceSetContainer.class);\n    return sourceSetContainer.getByName(MAIN_SOURCE_SET_NAME);\n  }\n}\n","sourceCodeStart":521,"sourceCodeEnd":553,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java#L521-L553","documentation":"Jib throws JibPluginExtensionException when a plugin extension configured via the `jib.extensions` block (with a fully-qualified class name) cannot be found among the JibGradlePluginExtension implementations available on Jib's runtime classpath. This means the configuration references an extension class that was never loaded/resolved, typically because the extension artifact is not a dependency of the build or the class name is misspelled.","triggerScenarios":"Running a Jib task with `jib.extensions.<name>.implementation = 'com.example.SomeExtension'` (or the plugins-style extension config) where no class with that exact FQCN implementing JibGradlePluginExtension exists on the Jib runtime classpath; findConfiguredExtension streams the discovered extensions, filters by class name equality, and throws when findFirst() is empty.","commonSituations":"Adding an extension config entry without adding the extension JAR/dependency to the buildscript classpath; typo in the fully-qualified class name; the extension artifact version was changed and the class was renamed/moved; using a Maven extension class name in the Gradle build.","solutions":["Add the Jib extension artifact (e.g. buildJibConfiguration / buildscript dependency) so its class is on the Jib plugin's runtime classpath","Verify the configured class name exactly matches the extension class's getName(), including package","Confirm the extension class implements JibGradlePluginExtension and is loadable (not shaded/renamed in a newer version)","Temporarily list discovered extensions (or debug the classpath) to see which extensions Jib actually found"],"exampleFix":"// before\njib.extensions {\n  myext {\n    implementation = 'com.example.JibMyExt'   // not on classpath\n  }\n}\n// after\ndependencies {\n  jibExt 'com.example:jib-my-extension:1.0.0' // or buildscript classpath dep\n}\njib.extensions {\n  myext {\n    implementation = 'com.example.jib.JibMyExt' // exact FQCN, now discoverable\n  }\n}","handlingStrategy":"validation","validationCode":"def expected = 'com.example.JibMyExt'\ndef discovered = project.extensions.findByType(JibExtension)?.extensions\nif (discovered?.configuration?.implementation != expected) {\n  throw new IllegalStateException(\"Extension ${expected} not configured or not on classpath\")\n}","typeGuard":null,"tryCatchPattern":"try {\n  jibTask.exec()\n} catch (JibPluginExtensionException e) {\n  if (e.message.contains('not discovered on Jib runtime classpath')) {\n    logger.error('Add the extension artifact to the build classpath and verify the FQCN: ' + e.message)\n  } else { throw e }\n}","preventionTips":["Add every jib extension artifact as an explicit build dependency","Copy the extension class's exact FQCN from its source/javadoc","Pin extension artifact versions alongside the Jib plugin version","Smoke-test extension config in a minimal build before CI"],"tags":["gradle","jib-plugin-extension","classpath","configuration"],"backgroundTag":"class-not-found","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}