{"record":{"id":"c0531f58bee5c561","repo":"GoogleContainerTools/jib","slug":"extension-configured-but-not-discovered-on-jib-run-c0531f","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":"validation","errorClass":"JibPluginExtensionException","httpStatus":null,"severity":"error","filePath":"jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java","lineNumber":699,"sourceCode":"              config.getProperties(),\n              extraConfig,\n              new MavenExtensionData(project, session),\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 JibMavenPluginExtension<?> findConfiguredExtension(\n      List<JibMavenPluginExtension<?>> extensions, ExtensionConfiguration config)\n      throws JibPluginExtensionException {\n    Predicate<JibMavenPluginExtension<?>> matchesClassName =\n        extension -> extension.getClass().getName().equals(config.getExtensionClass());\n    Optional<JibMavenPluginExtension<?>> 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 boolean isPackageErrorMessage(ContainerizingMode containerizingMode) {\n    return containerizingMode == ContainerizingMode.PACKAGED || isWarProject();\n  }\n}\n","sourceCodeStart":681,"sourceCodeEnd":711,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java#L681-L711","documentation":"An extension was configured in pom.xml via <pluginExtension><implementation>class name</implementation>, but no extension instance with that class name was discovered on the Jib runtime classpath. MavenProjectProperties.findConfiguredExtension filters the discovered JibMavenPluginExtension services and throws when the configured class name matches none of them.","triggerScenarios":"The extension dependency (jar containing META-INF/services registration of JibMavenPluginExtension) is missing from the jib-maven-plugin's <dependencies> in pom.xml; a typo or wrong fully-qualified class name in <implementation>; extension jar on compile classpath but not the plugin classpath.","commonSituations":"Adding the extension as a regular project dependency instead of inside the jib-maven-plugin <dependencies> block; renaming/refactoring the extension class without updating pom.xml; shading or relocation changing the runtime class name.","solutions":["Add the extension artifact as a <dependency> of jib-maven-plugin in pom.xml so it lands on Jib's runtime classpath.","Verify the <implementation> class name exactly matches the extension class's fully-qualified name (package included).","Check the extension jar contains META-INF/services/com.google.cloud.tools.jib.api.JibMavenPluginExtension registration.","Run 'mvn dependency:tree' scoped to the jib plugin (mvn help:effective-pom) to confirm the extension jar resolves at the right version."],"exampleFix":"<!-- before -->\n<plugin>\n  <groupId>com.google.cloud.tools</groupId>\n  <artifactId>jib-maven-plugin</artifactId>\n  <!-- no dependencies: extension not on plugin classpath -->\n</plugin>\n\n<!-- after -->\n<plugin>\n  <groupId>com.google.cloud.tools</groupId>\n  <artifactId>jib-maven-plugin</artifactId>\n  <dependencies>\n    <dependency>\n      <groupId>com.example</groupId>\n      <artifactId>my-jib-extension</artifactId>\n      <version>1.0.0</version>\n    </dependency>\n  </dependencies>\n</plugin>","handlingStrategy":"validation","validationCode":"// Verify extension jar is on the jib plugin classpath before building:\n// mvn com.google.cloud.tools:jib-maven-plugin:help -Ddetail\n// or: mvn help:effective-pom | grep my-jib-extension\n// Also confirm the <implementation> name equals the service class:\n// unzip -p my-jib-extension.jar META-INF/services/com.google.cloud.tools.jib.api.JibMavenPluginExtension","typeGuard":null,"tryCatchPattern":"try {\n  // mvn jib:build with extensions\n} catch (JibPluginExtensionException e) {\n  if (e.getMessage().contains(\"not discovered on Jib runtime classpath\")) {\n    // add the extension as a <dependency> of jib-maven-plugin or fix the class name\n  }\n  throw e;\n}","preventionTips":["Declare extensions under the jib-maven-plugin's <dependencies>, not the project's compile dependencies.","Copy the fully-qualified class name exactly (watch package renames after refactors).","Confirm the jar's META-INF/services registration exists when using custom extensions.","After moving/renaming extension classes, update both <implementation> and the services file."],"tags":["jib","maven","classpath","plugin-extension","dependency"],"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-14T00:17:10.932Z"}