GoogleContainerTools/jib · error · MojoExecutionException

<container><creationTime> should be an ISO 8601 date-time (s

Error message

<container><creationTime> should be an ISO 8601 date-time (see DateTimeFormatter.ISO_DATE_TIME) or a special keyword ("EPOCH", "USE_CURRENT_TIMESTAMP"): <invalidCreationTime>

What it means

<container><creationTime> must be an ISO 8601 date-time or one of the special keywords "EPOCH" or "USE_CURRENT_TIMESTAMP". Any other value raises InvalidCreationTimeException, converted by BuildDockerMojo.execute() into a MojoExecutionException that echoes the invalid value.

Source

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

              + "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);

    } catch (IncompatibleBaseImageJavaVersionException ex) {
      throw new MojoExecutionException(
          HelpfulSuggestions.forIncompatibleBaseImageJavaVersionForMaven(
              ex.getBaseImageMajorJavaVersion(), ex.getProjectMajorJavaVersion()),
          ex);

    } catch (InvalidImageReferenceException ex) {
      throw new MojoExecutionException(
          HelpfulSuggestions.forInvalidImageReference(ex.getInvalidReference()), ex);

    } catch (IOException
        | CacheDirectoryCreationException
        | MainClassInferenceException
        | InvalidGlobalConfigException ex) {
      throw new MojoExecutionException(ex.getMessage(), ex);

    } catch (BuildStepsExecutionException ex) {
      throw new MojoExecutionException(ex.getMessage(), ex.getCause());

    } catch (ExtraDirectoryNotFoundException ex) {

View on GitHub (pinned to fb949e2676)

Solutions

  1. Use an ISO 8601 date-time (e.g. 2024-01-15T10:00:00Z) or exactly EPOCH or USE_CURRENT_TIMESTAMP.
  2. Check keyword spelling and case; keywords are case-sensitive uppercase with underscores.
  3. If a timestamp comes from an environment variable or property, format it with DateTimeFormatter.ISO_DATE_TIME before it reaches the pom.
  4. Use USE_CURRENT_TIMESTAMP only when reproducibility is not required, since it embeds build time.

Example fix

<!-- before -->
<container><creationTime>now</creationTime></container>
<!-- after -->
<container><creationTime>USE_CURRENT_TIMESTAMP</creationTime></container>
Defensive patterns

Strategy: validation

Validate before calling

String t = pomCreationTime;
boolean ok = t == null || t.equals("EPOCH") || t.equals("USE_CURRENT_TIMESTAMP");
if (!ok) { java.time.format.DateTimeFormatter.ISO_DATE_TIME.parse(t); }

Type guard

boolean isValidCreationTime(String t) {
  return t == null || t.equals("EPOCH") || t.equals("USE_CURRENT_TIMESTAMP") || tryParseIso(t);
}

Prevention

When it happens

Trigger: Configuring <creationTime> with values like 'now', a locale-formatted date, an empty string, a misspelled keyword ('use_current_timestamp'), or using EPOCH_PLUS_SECOND (a filesModificationTime-only keyword) here.

Common situations: Attempting reproducible builds with hand-written timestamps; mixing up the keyword sets of creationTime vs filesModificationTime; injecting the value via CI variables in the wrong format; upgrading from older Jib versions where fewer keywords existed.

Related errors


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