GoogleContainerTools/jib · error · MojoExecutionException

<container><filesModificationTime> should be an ISO 8601 dat

Error message

<container><filesModificationTime> should be an ISO 8601 date-time (see DateTimeFormatter.ISO_DATE_TIME) or special keyword "EPOCH_PLUS_SECOND": <invalidFilesModificationTime>

What it means

Jib validates <container><filesModificationTime>, which controls timestamps assigned to files in the image. The value must be an ISO 8601 date-time parseable by DateTimeFormatter.ISO_DATE_TIME or the special keyword "EPOCH_PLUS_SECOND". Anything else raises InvalidFilesModificationTimeException, wrapped into a MojoExecutionException with the invalid value.

Source

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

    } 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(
          "<container><creationTime> should be an ISO 8601 date-time (see "
              + "DateTimeFormatter.ISO_DATE_TIME) or a special keyword (\"EPOCH\", "
              + "\"USE_CURRENT_TIMESTAMP\"): "
              + ex.getInvalidCreationTime(),
          ex);

    } catch (JibPluginExtensionException ex) {
      String extensionName = ex.getExtensionClass().getName();
      throw new MojoExecutionException(
          "error running extension '" + extensionName + "': " + ex.getMessage(), ex);

View on GitHub (pinned to fb949e2676)

Solutions

  1. Use a full ISO 8601 date-time such as 2024-01-01T00:00:00Z.
  2. Use the keyword EPOCH_PLUS_SECOND (or EPOCH-equivalent defaults) for reproducible output.
  3. Remove the element to use the default (EPOCH_PLUS_SECOND).

Example fix

// before
<filesModificationTime>2024-01-01</filesModificationTime>
// after
<filesModificationTime>2024-01-01T00:00:00Z</filesModificationTime>
Defensive patterns

Strategy: validation

Validate before calling

String t = System.getProperty("jib.container.filesModificationTime", pomTime);
if (t != null && !t.equals("EPOCH_PLUS_SECOND")) {
  try { java.time.format.DateTimeFormatter.ISO_DATE_TIME.parse(t); }
  catch (Exception e) { throw new IllegalArgumentException("filesModificationTime must be ISO 8601 or EPOCH_PLUS_SECOND: " + t); }
}

Try / catch

catch (MojoExecutionException e) { if (e.getMessage().contains("filesModificationTime")) { /* use full ISO 8601 datetime or the keyword */ } }

Prevention

When it happens

Trigger: Setting <filesModificationTime> to a plain date like '2024-01-01', a human string like 'yesterday', an epoch number like '1700000000', or an arbitrary non-ISO string.

Common situations: Attempting reproducible builds with hand-formatted timestamps; assuming epoch seconds are accepted; forgetting the time component in the ISO string.

Related errors


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