GoogleContainerTools/jib · error · IllegalArgumentException

extension ${extension.getClass().getSimpleName()} does not e

Error message

extension ${extension.getClass().getSimpleName()} does not expect extension-specific configuration; remove the inapplicable 'pluginExtension.configuration' from Gradle build script

What it means

runPluginExtension throws IllegalArgumentException when an extension-specific configuration block ('pluginExtension.configuration') is provided in the Gradle build script but the configured extension declares no extra configuration type (extraConfigType is empty). Extensions that do not accept configuration cannot receive one, so Jib fails fast.

Source

Thrown at jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java:503

          ex);
    }
  }

  // Unchecked casting: "getExtraConfiguration().get()" (Object) to Action<T> and "extension"
  // (JibGradlePluginExtension<?>) to JibGradlePluginExtension<T> where T is the extension-defined
  // config type (as requested by "JibGradlePluginExtension.getExtraConfigType()").
  @SuppressWarnings({"unchecked"})
  private <T> ContainerBuildPlan runPluginExtension(
      Optional<Class<T>> extraConfigType,
      JibGradlePluginExtension<?> extension,
      ExtensionConfiguration config,
      ContainerBuildPlan buildPlan)
      throws JibPluginExtensionException {
    T extraConfig = null;
    Optional<Object> configs = config.getExtraConfiguration();
    if (configs.isPresent()) {
      if (!extraConfigType.isPresent()) {
        throw new IllegalArgumentException(
            "extension "
                + extension.getClass().getSimpleName()
                + " does not expect extension-specific configuration; remove the inapplicable "
                + "'pluginExtension.configuration' from Gradle build script");
      } else {
        // configs.get() is of type Action, so this cast always succeeds.
        // (Note generic <T> is erased at runtime.)
        Action<T> action = (Action<T>) configs.get();
        extraConfig = project.getObjects().newInstance(extraConfigType.get(), project);
        action.execute(extraConfig);
      }
    }

    try {
      return ((JibGradlePluginExtension<T>) extension)
          .extendContainerBuildPlan(
              buildPlan,
              config.getProperties(),

View on GitHub (pinned to fb949e2676)

Solutions

  1. Remove the 'configuration { ... }' block from the pluginExtension declaration
  2. If configuration is needed, verify the extension actually supports extra configuration and you are using its documented configuration type
  3. Check the extension's class name in 'implementation' matches the one the documentation shows for the configuration example

Example fix

// before
jib { pluginExtensions { pluginExtension {
  implementation = 'com.google.cloud.tools.jib.gradle.extension.springboot.JibSpringBootExtension'
  configuration { someOption = true } // not supported
} } }
// after: drop the configuration block
jib { pluginExtensions { pluginExtension {
  implementation = 'com.google.cloud.tools.jib.gradle.extension.springboot.JibSpringBootExtension'
} } }
Defensive patterns

Strategy: validation

Validate before calling

// only add a configuration block if the extension documents one
// quick check in build.gradle:
def ext = project.extensions.getByType(com.google.cloud.tools.jib.gradle.JibExtension)
assert !jib.pluginExtensions.collect { it.configuration }.contains(null) || true // review declarations manually

Prevention

When it happens

Trigger: In build.gradle: jib { pluginExtensions { pluginExtension { implementation = '...'; configuration { ... } } } } where the extension class does not implement JibGradlePluginExtension with an extra configuration type.

Common situations: Copying a configuration block from documentation for a different extension; adding a configuration closure to a built-in extension like jib-spring-boot that takes none; leftover config after switching extension implementations.

Related errors


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