GoogleContainerTools/jib · error · MojoExecutionException

invalid value for <containerizingMode>: <invalidContainerizi

Error message

invalid value for <containerizingMode>: <invalidContainerizingMode>

What it means

The jib-maven-plugin dockerBuild goal rejects the <containerizingMode> configuration value because it is not one of the accepted modes (e.g. 'exploded' or 'packaged'). PluginConfigurationProcessor throws InvalidContainerizingModeException during configuration parsing, and BuildDockerMojo.execute() wraps it in a MojoExecutionException with the offending value echoed back. The build fails before any image is built.

Source

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

              new MavenHelpfulSuggestions(HELPFUL_SUGGESTIONS_PREFIX))
          .runBuild();

    } catch (InvalidAppRootException ex) {
      throw new MojoExecutionException(
          "<container><appRoot> is not an absolute Unix-style path: " + ex.getInvalidPathValue(),
          ex);

    } catch (InvalidContainerizingModeException ex) {
      throw new MojoExecutionException(
          "invalid value for <containerizingMode>: " + ex.getInvalidContainerizingMode(), ex);

    } catch (InvalidWorkingDirectoryException ex) {
      throw new MojoExecutionException(
          "<container><workingDirectory> is not an absolute Unix-style path: "
              + ex.getInvalidPathValue(),
          ex);
    } catch (InvalidPlatformException ex) {
      throw new MojoExecutionException(
          "<from><platforms> contains a platform configuration that is missing required values or has invalid values: "
              + ex.getMessage()
              + ": "
              + ex.getInvalidPlatform(),
          ex);
    } catch (InvalidContainerVolumeException ex) {
      throw new MojoExecutionException(
          "<container><volumes> is not an absolute Unix-style path: " + ex.getInvalidVolume(), ex);

    } 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(

View on GitHub (pinned to fb949e2676)

Solutions

  1. Set <containerizingMode> to exactly 'packaged' or 'exploded' in the pom or -Djib.containerizingMode=... on the command line.
  2. Check for typos, whitespace, or case differences in the configured value (the message echoes the exact invalid string).
  3. Remove the <containerizingMode> element entirely to fall back to the default ('exploded' for jar projects).
  4. Run 'mvn help:describe -Dplugin=com.google.cloud.tools:jib-maven-plugin' or check Jib docs to confirm valid values for your plugin version.

Example fix

// before (pom.xml)
<containerizingMode>invalidContainerizingMode</containerizingMode>
// after
<containerizingMode>exploded</containerizingMode>
Defensive patterns

Strategy: validation

Validate before calling

String mode = System.getProperty("jib.containerizingMode", pomContainerizingMode);
if (mode != null && !mode.equals("packaged") && !mode.equals("exploded")) {
  throw new IllegalArgumentException("containerizingMode must be 'packaged' or 'exploded', got: " + mode);
}

Type guard

boolean isValidContainerizingMode(String m) { return m == null || m.equals("packaged") || m.equals("exploded"); }

Prevention

When it happens

Trigger: Running 'mvn jib:dockerBuild' (or another jib goal) with <containerizingMode>invalidContainerizingMode</containerizingMode> in the pom's <configuration> block, or passing -Djib.containerizingMode=invalidContainerizingMode on the command line with a value not in {packaged, exploded}.

Common situations: Typo in the mode name (e.g. 'explode', 'packaged ' with a trailing space); copying a value from an old blog post; upgrading Jib and forgetting the only two valid values; setting the property via a parent pom or CI env var with a wrong string.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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