GoogleContainerTools/jib · error · MojoExecutionException

Invalid containerizing mode

Error message

Invalid containerizing mode

What it means

When validating the containerizing mode, SyncMapMojo calls ContainerizingMode.from(getContainerizingMode()), which throws InvalidContainerizingModeException for unrecognized mode strings. The mojo wraps it in this generic MojoExecutionException 'Invalid containerizing mode'. It means the configured mode string is not one of the known values (exploded, packaged).

Source

Thrown at jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/skaffold/SyncMapMojo.java:74

      throw new MojoExecutionException(
          "Skaffold sync is currently only available for 'jar' style Jib projects, but the packaging of "
              + getProject().getArtifactId()
              + " is '"
              + getProject().getPackaging()
              + "'");
    }
    // add check for exploded containerization
    try {
      if (!ContainerizingMode.EXPLODED.equals(ContainerizingMode.from(getContainerizingMode()))) {
        throw new MojoExecutionException(
            "Skaffold sync is currently only available for Jib projects in 'exploded' containerizing mode, but the containerizing mode of "
                + getProject().getArtifactId()
                + " is '"
                + getContainerizingMode()
                + "'");
      }
    } catch (InvalidContainerizingModeException ex) {
      throw new MojoExecutionException("Invalid containerizing mode", ex);
    }

    try (TempDirectoryProvider tempDirectoryProvider = new TempDirectoryProvider()) {
      MavenProjectProperties projectProperties =
          MavenProjectProperties.getForProject(
              Preconditions.checkNotNull(descriptor),
              getProject(),
              getSession(),
              getLog(),
              tempDirectoryProvider,
              getInjectedPluginExtensions());

      MavenRawConfiguration configuration = new MavenRawConfiguration(this);

      try {
        String syncMapJson =
            PluginConfigurationProcessor.getSkaffoldSyncMap(
                configuration,

View on GitHub (pinned to fb949e2676)

Solutions

  1. Correct the value to exactly 'exploded' or 'packaged' in the plugin configuration or jib.containerizeMode property.
  2. Check spelling/case against the plugin version's accepted values (run mvn jib:help -Dgoal=build or read docs for that version).
  3. Upgrade jib-maven-plugin if you need a mode value introduced in a newer release.
  4. Remove the containerizingMode setting entirely to use the default (exploded).

Example fix

// before
<containerizingMode>exploted</containerizingMode>
// after
<containerizingMode>exploded</containerizingMode>
Defensive patterns

Strategy: validation

Validate before calling

Set<String> valid = Set.of("exploded", "packaged");
String mode = System.getProperty("jib.containerizeMode", "");
if (!mode.isEmpty() && !valid.contains(mode)) throw new IllegalStateException("containerizingMode must be one of " + valid);

Try / catch

try { ... } catch (MojoExecutionException e) { if (e.getMessage().equals("Invalid containerizing mode")) { /* fix the jib.containerizeMode value to exploded|packaged */ } }

Prevention

When it happens

Trigger: jib.containerizeMode (property or <containerizingMode> config) is set to a value other than 'exploded' or 'packaged', e.g. a typo like 'exploted' or 'war'.

Common situations: Typo in pom.xml or in -Djib.containerizeMode; older plugin versions that don't recognize a newly introduced mode value; documentation copied from Gradle with different mode names.

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/4d5f3a60204efcdd. Report an issue: GitHub.