GoogleContainerTools/jib · error · MojoExecutionException

<from><platforms> contains a platform configuration that is

Error message

<from><platforms> contains a platform configuration that is missing required values or has invalid values: <message>: <invalidPlatform>

What it means

When multi-platform images are configured via <from><platforms>, each platform entry must have valid required fields (architecture, os, and optionally variant, etc.). InvalidPlatformException carries a reason message and the offending platform configuration; execute() wraps it into a MojoExecutionException combining both.

Source

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

              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. Ensure every <platform> has both <architecture> (e.g. amd64) and <os> (e.g. linux).
  2. Read the reason in the message to identify the specific invalid field and correct it.
  3. Verify the XML nesting: <platforms><platform>...</platform></platforms>.

Example fix

// before
<platforms><platform><architecture>amd64</architecture></platform></platforms>
// after
<platforms><platform><architecture>amd64</architecture><os>linux</os></platform></platforms>
Defensive patterns

Strategy: validation

Validate before calling

for (Platform p : platforms) {
  if (p.getArchitecture() == null || p.getArchitecture().isEmpty() || p.getOs() == null || p.getOs().isEmpty()) {
    throw new IllegalArgumentException("Each <platform> requires non-empty <architecture> and <os>");
  }
}

Try / catch

catch (MojoExecutionException e) { if (e.getMessage().contains("platforms")) { /* fix the platform fields named in the message */ } }

Prevention

When it happens

Trigger: Declaring <platform> entries with missing <architecture> or <os>; using empty values; malformed values for optional fields like os.version or architecture variants; multiple platform blocks where one is incomplete.

Common situations: Building multi-arch images (e.g. amd64/arm64) for the first time and omitting <os>; typo'd platform fields; XML structure mistakes nesting <platform> outside <platforms>.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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