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
Thrown as a MojoExecutionException from BuildTarMojo.execute when the <container><filesModificationTime> configuration value (or its jib.container.filesModificationTime property) is neither a valid ISO 8601 date-time parseable by DateTimeFormatter.ISO_DATE_TIME nor the special keyword EPOCH_PLUS_SECOND. Jib validates this value when building the container's file timestamps and fails fast with the invalid value included in the message.
Source
Thrown at jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildTarMojo.java:123
} 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
- Change <filesModificationTime> to an ISO 8601 date-time such as 2021-07-28T10:15:30Z or 2021-07-28T10:15:30+02:00.
- If reproducible epoch timestamps are wanted, use the literal keyword EPOCH_PLUS_SECOND exactly (no quotes/extra spaces in the XML value).
- If overriding via a Maven property (-Djib.container.filesModificationTime=...), check the value for typos, surrounding whitespace, or shell-added quotes.
- If the value is generated dynamically (e.g. ${maven.build.timestamp}), ensure the timestamp format property is ISO 8601, e.g. -Dmaven.build.timestamp.format=yyyy-MM-dd'T'HH:mm:ss'Z'.
Example fix
<!-- before --> <filesModificationTime>07/28/2021 10:15</filesModificationTime> <!-- after --> <filesModificationTime>2021-07-28T10:15:30Z</filesModificationTime>
Defensive patterns
Strategy: validation
Validate before calling
// before running mvn, verify the configured value
String t = System.getProperty("jib.container.filesModificationTime", pomValue);
if (t != null && !t.equals("EPOCH_PLUS_SECOND")) {
java.time.format.DateTimeFormatter.ISO_DATE_TIME.parse(t); // throws if invalid
} Prevention
- Always use ISO 8601 (yyyy-MM-dd'T'HH:mm:ss[.SSS]Z) for filesModificationTime.
- Use EPOCH_PLUS_SECOND keyword for reproducible builds instead of hand-written dates.
- If injecting via ${maven.build.timestamp}, set maven.build.timestamp.format=yyyy-MM-dd'T'HH:mm:ss'Z'.
- Avoid shell/CI quoting that adds whitespace or quotes around the value.
When it happens
Trigger: Running `mvn jib:buildTar` (or any goal sharing this mojo error handling) with <filesModificationTime> set to a string like '2021/07/28', 'yesterday', '2021-13-45T00:00:00Z', or a typo'd keyword such as 'EPOCH_PLUS_SECOND ' with trailing whitespace/typo variants like 'EPOCH_PLUS_SEC'.
Common situations: Developers copy a human-readable date format from other tools, use a locale-dependent format, or try relative-time expressions that Jib does not support; also common when property overrides via -Djib.container.filesModificationTime carry stray whitespace or quotes.
Related errors
- <container><filesModificationTime> should be an ISO 8601 dat
- <container><creationTime> should be an ISO 8601 date-time (s
- <container><filesModificationTime> should be an ISO 8601 dat
- <container><creationTime> should be an ISO 8601 date-time (s
- <container><creationTime> should be an ISO 8601 date-time (s
AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06).
Data as JSON: /api/errors/c444d39e6499675f.
Report an issue: GitHub.