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

BuildTarMojo.execute throws this when a platform entry under <from><platforms> is missing required fields or has invalid values (InvalidPlatformException). The message includes the exception's detail message and the offending platform configuration. Each platform needs at least architecture and os (e.g. amd64/linux).

Source

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

              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. Provide both <architecture> and <os> in every <platform>, e.g. amd64/linux.
  2. Fix the specific invalid value named in the exception message.
  3. Remove empty or incomplete <platform> elements.

Example fix

<!-- before -->
<from><platforms><platform><architecture>arm64</architecture></platform></platforms></from>
<!-- after -->
<from><platforms><platform><architecture>arm64</architecture><os>linux</os></platform></platforms></from>
Defensive patterns

Strategy: validation

Validate before calling

String arch = "arm64", os = null; // values intended for <platform>
if (arch == null || arch.isBlank() || os == null || os.isBlank()) {
  throw new IllegalArgumentException("platform requires both <architecture> and <os>");
}

Try / catch

try { ... } catch (MojoExecutionException e) { if (e.getMessage().startsWith("<from><platforms>")) { /* add missing architecture/os fields */ } throw e; }

Prevention

When it happens

Trigger: Running 'mvn jib:buildTar' with a <platform> element missing <architecture> or <os>, or containing invalid values like an empty element or unsupported os/arch strings.

Common situations: Adding multi-arch (<platforms>) config for the first time and omitting one required field; typo like <archetecture>; empty <platform></platform> element left in the pom.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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