GoogleContainerTools/jib · error · JibPluginExtensionException

extension configured but not discovered on Jib runtime class

Error message

extension configured but not discovered on Jib runtime classpath: ${config.getExtensionClass()}

What it means

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.

Source

Thrown at jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java:699

              config.getProperties(),
              extraConfig,
              new MavenExtensionData(project, session),
              new PluginExtensionLogger(this::log));
    } catch (RuntimeException ex) {
      throw new JibPluginExtensionException(
          extension.getClass(), "extension crashed: " + ex.getMessage(), ex);
    }
  }

  private JibMavenPluginExtension<?> findConfiguredExtension(
      List<JibMavenPluginExtension<?>> extensions, ExtensionConfiguration config)
      throws JibPluginExtensionException {
    Predicate<JibMavenPluginExtension<?>> matchesClassName =
        extension -> extension.getClass().getName().equals(config.getExtensionClass());
    Optional<JibMavenPluginExtension<?>> found =
        extensions.stream().filter(matchesClassName).findFirst();
    if (!found.isPresent()) {
      throw new JibPluginExtensionException(
          NullExtension.class,
          "extension configured but not discovered on Jib runtime classpath: "
              + config.getExtensionClass());
    }
    return found.get();
  }

  private boolean isPackageErrorMessage(ContainerizingMode containerizingMode) {
    return containerizingMode == ContainerizingMode.PACKAGED || isWarProject();
  }
}

View on GitHub (pinned to fb949e2676)

Solutions

  1. Add the extension artifact as a <dependency> of jib-maven-plugin in pom.xml so it lands on Jib's runtime classpath.
  2. Verify the <implementation> class name exactly matches the extension class's fully-qualified name (package included).
  3. Check the extension jar contains META-INF/services/com.google.cloud.tools.jib.api.JibMavenPluginExtension registration.
  4. Run 'mvn dependency:tree' scoped to the jib plugin (mvn help:effective-pom) to confirm the extension jar resolves at the right version.

Example fix

<!-- before -->
<plugin>
  <groupId>com.google.cloud.tools</groupId>
  <artifactId>jib-maven-plugin</artifactId>
  <!-- no dependencies: extension not on plugin classpath -->
</plugin>

<!-- after -->
<plugin>
  <groupId>com.google.cloud.tools</groupId>
  <artifactId>jib-maven-plugin</artifactId>
  <dependencies>
    <dependency>
      <groupId>com.example</groupId>
      <artifactId>my-jib-extension</artifactId>
      <version>1.0.0</version>
    </dependency>
  </dependencies>
</plugin>
Defensive patterns

Strategy: validation

Validate before calling

// Verify extension jar is on the jib plugin classpath before building:
// mvn com.google.cloud.tools:jib-maven-plugin:help -Ddetail
// or: mvn help:effective-pom | grep my-jib-extension
// Also confirm the <implementation> name equals the service class:
// unzip -p my-jib-extension.jar META-INF/services/com.google.cloud.tools.jib.api.JibMavenPluginExtension

Try / catch

try {
  // mvn jib:build with extensions
} catch (JibPluginExtensionException e) {
  if (e.getMessage().contains("not discovered on Jib runtime classpath")) {
    // add the extension as a <dependency> of jib-maven-plugin or fix the class name
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06). Data as JSON: /api/errors/c0531f58bee5c561. Report an issue: GitHub.