GoogleContainerTools/jib · error · MojoExecutionException

<message from BuildStepsExecutionException>

Error message

<message from BuildStepsExecutionException>

What it means

BuildImageMojo.execute catches BuildStepsExecutionException and rethrows its message with the root cause. This wraps any failure that occurred while jib's build steps (containerizing, layer building, registry push) executed, so the real reason is in ex.getCause().

Source

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

    } 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);

    } catch (BuildStepsExecutionException ex) {
      throw new MojoExecutionException(ex.getMessage(), ex.getCause());

    } catch (ExtraDirectoryNotFoundException ex) {
      throw new MojoExecutionException(
          "<extraDirectories><paths> contain \"from\" directory that doesn't exist locally: "
              + ex.getPath(),
          ex);
    } finally {
      tempDirectoryProvider.close();
      MojoCommon.finishUpdateChecker(projectProperties, updateCheckFuture);
      projectProperties.waitForLoggingThread();
      getLog().info("");
    }
  }
}

View on GitHub (pinned to fb949e2676)

Solutions

  1. Look at the CAUSE printed below the MojoExecutionException message; fix that underlying problem.
  2. For auth errors run 'docker login <registry>' or configure credentials in settings.xml / credential helpers.
  3. For network errors check connectivity to the registry and retry.

Example fix

// before: failing push due to missing auth
mvn jib:build
// after
docker login gcr.io
mvn jib:build
Defensive patterns

Strategy: try-catch

Try / catch

try { ... } catch (BuildStepsExecutionException e) {
  log.error("jib build failed: " + e.getMessage(), e.getCause());
  if (e.getCause() instanceof RegistryUnauthorizedException) { /* refresh docker login */ }
}

Prevention

When it happens

Trigger: Any failure inside .runBuild() during 'mvn jib:build' that is not caught by the more specific handlers above: registry authentication errors, network failures, blob push failures, etc.

Common situations: Docker Hub/GCR auth failure (wrong credentials in ~/.docker/config.json or docker login not run); network/registry outage mid-push; registry quota exceeded.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


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