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
- Use a full ISO 8601 date-time such as 2024-01-01T00:00:00Z.
- Use the keyword EPOCH_PLUS_SECOND (or EPOCH-equivalent defaults) for reproducible output.
- 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
- Use full ISO 8601 including time and zone: 2024-01-01T00:00:00Z
- Use the EPOCH_PLUS_SECOND keyword for reproducible builds
- Parse-test the value locally with DateTimeFormatter.ISO_DATE_TIME before adding it
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
- <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
- <container><filesModificationTime> should be an ISO 8601 dat
- <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/2af6ccd891ae1b93.
Report an issue: GitHub.