spring-projects/spring-boot · error · MojoExecutionException
Invalid value for parameter 'outputTimestamp'
Error message
Invalid value for parameter 'outputTimestamp'
What it means
MojoExecutionException thrown by RepackageMojo.parseOutputTimestamp when MavenBuildOutputTimestamp.toFileTime throws an IllegalArgumentException — i.e., when the configured outputTimestamp is either out of the valid range (MavenBuildOutputTimestamp.java:92) or unparseable as an OffsetDateTime (line 98). This is the repackage goal's user-facing wrapper for both timestamp-validation errors.
Solutions
- Set <outputTimestamp> to an ISO-8601 offset value within the allowed window, e.g. 2024-01-01T00:00:00Z.
- Or use numeric epoch seconds to bypass the ISO parse entirely.
- Leave <outputTimestamp> unset to disable deterministic timestamp injection in the repackaged jar.
- Inspect the chained IllegalArgumentException to determine whether it was the range check or the parse that failed.
Example fix
// before: <outputTimestamp>2024/01/01</outputTimestamp> // after: <outputTimestamp>2024-01-01T00:00:00Z</outputTimestamp>
Defensive patterns
Strategy: validation
Validate before calling
// Validate outputTimestamp before repackage (covers both sub-errors):
try {
new org.springframework.boot.maven.MavenBuildOutputTimestamp(outputTimestamp).toFileTime();
} catch (IllegalArgumentException ex) {
// surface to the user: out-of-range or unparseable
throw ex;
} Try / catch
try {
// invoke repackage
} catch (MojoExecutionException ex) {
if ("Invalid value for parameter 'outputTimestamp'".equals(ex.getMessage())) {
Throwable c = ex.getCause(); // IllegalArgumentException from toFileTime
// c.getMessage() tells you range vs parse; fix and retry
}
throw ex;
} Prevention
- Use ISO-8601 offset values within the documented window.
- Or use numeric epoch seconds to skip ISO parsing.
- Leave outputTimestamp unset when reproducibility isn't required.
When it happens
Trigger: Setting <outputTimestamp> on the repackage goal (or the inherited <project.build.outputTimestamp>) to a value that fails validation: out of the [DATE_MIN, DATE_MAX] window, or non-numeric and non-ISO-8601. parseOutputTimestamp catches IllegalArgumentException and rethrows as a MojoExecutionException.
Common situations: CI injecting SOURCE_DATE_EPOCH-derived timestamps that fall outside the allowed window; misformatted reproducible-build timestamp; copy-pasted timestamp from another tool; upgrading the plugin tightened the accepted formats.
Related errors
- Can't parse ' ' to instant
- ' ' is not within the valid range to
- Source file is not available, make sure 'package' runs as…
- A jar or war file is required for building image
- Could not build classpath
AI-assisted analysis of spring-projects/spring-boot@270dfe353f (2026-08-11).
Data as JSON: /api/errors/eccdbcc533a24527.
Report an issue: GitHub.
Appendix: source
Thrown at build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java:210
"Source file is not available, make sure 'package' runs as part of the same lifecycle");
}
Repackager repackager = getRepackager(source.getFile());
Libraries libraries = getLibraries(this.requiresUnpack);
try {
repackager.repackage(target, libraries, parseOutputTimestamp());
}
catch (IOException ex) {
throw new MojoExecutionException(ex.getMessage(), ex);
}
updateArtifact(source, target, repackager.getBackupFile());
}
private @Nullable FileTime parseOutputTimestamp() throws MojoExecutionException {
try {
return new MavenBuildOutputTimestamp(this.outputTimestamp).toFileTime();
}
catch (IllegalArgumentException ex) {
throw new MojoExecutionException("Invalid value for parameter 'outputTimestamp'", ex);
}
}
private Repackager getRepackager(File source) {
return getConfiguredPackager(() -> new Repackager(source));
}
@Contract("!null -> !null")
private @Nullable String removeLineBreaks(@Nullable String description) {
return (description != null) ? WHITE_SPACE_PATTERN.matcher(description).replaceAll(" ") : null;
}
private void updateArtifact(Artifact source, File target, File original) {
if (this.attach) {
attachArtifact(source, target, original);
}
else if (source.getFile().equals(target) && original.exists()) {
String artifactId = (this.classifier != null) ? "artifact with classifier " + this.classifierView on GitHub (pinned to 270dfe353f)