GoogleContainerTools/jib · error · MojoExecutionException

error running extension '<extensionClassName>': <message>

Error message

error running extension '<extensionClassName>': <message>

What it means

Jib plugin extensions (classes implementing JibPluginExtension) run as part of the build. When an extension throws or fails, it is wrapped in JibPluginExtensionException, and execute() rethrows it as a MojoExecutionException naming the extension's fully-qualified class name and the underlying message.

Source

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

    } catch (InvalidFilesModificationTimeException ex) {
      throw new MojoExecutionException(
          "<container><filesModificationTime> should be an ISO 8601 date-time (see "
              + "DateTimeFormatter.ISO_DATE_TIME) or special keyword \"EPOCH_PLUS_SECOND\": "
              + ex.getInvalidFilesModificationTime(),
          ex);

    } catch (InvalidCreationTimeException ex) {
      throw new MojoExecutionException(
          "<container><creationTime> should be an ISO 8601 date-time (see "
              + "DateTimeFormatter.ISO_DATE_TIME) or a special keyword (\"EPOCH\", "
              + "\"USE_CURRENT_TIMESTAMP\"): "
              + ex.getInvalidCreationTime(),
          ex);

    } catch (JibPluginExtensionException ex) {
      String extensionName = ex.getExtensionClass().getName();
      throw new MojoExecutionException(
          "error running extension '" + extensionName + "': " + ex.getMessage(), ex);

    } catch (IncompatibleBaseImageJavaVersionException ex) {
      throw new MojoExecutionException(
          HelpfulSuggestions.forIncompatibleBaseImageJavaVersionForMaven(
              ex.getBaseImageMajorJavaVersion(), ex.getProjectMajorJavaVersion()),
          ex);

    } catch (InvalidImageReferenceException ex) {
      throw new MojoExecutionException(
          HelpfulSuggestions.forInvalidImageReference(ex.getInvalidReference()), ex);

    } catch (IOException
        | CacheDirectoryCreationException
        | MainClassInferenceException
        | InvalidGlobalConfigException ex) {
      throw new MojoExecutionException(ex.getMessage(), ex);

View on GitHub (pinned to fb949e2676)

Solutions

  1. Read the extension class name and inner message to identify which extension failed and why.
  2. Fix the root cause in the extension's input (project layout, files) or update the extension to a compatible version.
  3. Disable the <extensions> configuration temporarily to confirm the base build works, then re-enable incrementally.

Example fix

// before
<extensions>
  <extension><implementation>com.example.BrokenExt</implementation></extension>
</extensions>
// after
<!-- fix or remove the failing extension implementation -->
<extensions>
  <extension><implementation>com.google.cloud.tools.jib.maven.extension.springboot.JibSpringBootExtension</implementation></extension>
</extensions>
Defensive patterns

Strategy: try-catch

Try / catch

catch (MojoExecutionException e) {
  if (e.getMessage().startsWith("error running extension")) {
    System.err.println("Extension failed: " + e.getMessage() + "; cause: " + e.getCause());
    e.getCause().printStackTrace();
  }
}

Prevention

When it happens

Trigger: Running a build with jib.extensions configured (e.g. jib-spring-boot or jib-quarkus) where the extension class throws an exception, cannot find expected project files, or fails its own internal logic.

Common situations: jib-spring-boot extension failing on a non-standard Spring Boot project layout; extension/Jib version mismatch; custom extension code throwing during onExecute; snapshot/provided classes not found.

Related errors


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