{"record":{"id":"eccdbcc533a24527","repo":"spring-projects/spring-boot","slug":"invalid-value-for-parameter-outputtimestamp","errorCode":null,"errorMessage":"Invalid value for parameter 'outputTimestamp'","messagePattern":"Invalid value for parameter 'outputTimestamp'","errorType":"validation","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java","lineNumber":210,"sourceCode":"\t\t\t\t\t\"Source file is not available, make sure 'package' runs as part of the same lifecycle\");\n\t\t}\n\t\tRepackager repackager = getRepackager(source.getFile());\n\t\tLibraries libraries = getLibraries(this.requiresUnpack);\n\t\ttry {\n\t\t\trepackager.repackage(target, libraries, parseOutputTimestamp());\n\t\t}\n\t\tcatch (IOException ex) {\n\t\t\tthrow new MojoExecutionException(ex.getMessage(), ex);\n\t\t}\n\t\tupdateArtifact(source, target, repackager.getBackupFile());\n\t}\n\n\tprivate @Nullable FileTime parseOutputTimestamp() throws MojoExecutionException {\n\t\ttry {\n\t\t\treturn new MavenBuildOutputTimestamp(this.outputTimestamp).toFileTime();\n\t\t}\n\t\tcatch (IllegalArgumentException ex) {\n\t\t\tthrow new MojoExecutionException(\"Invalid value for parameter 'outputTimestamp'\", ex);\n\t\t}\n\t}\n\n\tprivate Repackager getRepackager(File source) {\n\t\treturn getConfiguredPackager(() -> new Repackager(source));\n\t}\n\n\t@Contract(\"!null -> !null\")\n\tprivate @Nullable String removeLineBreaks(@Nullable String description) {\n\t\treturn (description != null) ? WHITE_SPACE_PATTERN.matcher(description).replaceAll(\" \") : null;\n\t}\n\n\tprivate void updateArtifact(Artifact source, File target, File original) {\n\t\tif (this.attach) {\n\t\t\tattachArtifact(source, target, original);\n\t\t}\n\t\telse if (source.getFile().equals(target) && original.exists()) {\n\t\t\tString artifactId = (this.classifier != null) ? \"artifact with classifier \" + this.classifier","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/spring-projects/spring-boot/blob/270dfe353fb830fd69b823a8a859287ff103854b/build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java#L192-L228","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before: <outputTimestamp>2024/01/01</outputTimestamp>\n// after:  <outputTimestamp>2024-01-01T00:00:00Z</outputTimestamp>","handlingStrategy":"validation","validationCode":"// Validate outputTimestamp before repackage (covers both sub-errors):\ntry {\n    new org.springframework.boot.maven.MavenBuildOutputTimestamp(outputTimestamp).toFileTime();\n} catch (IllegalArgumentException ex) {\n    // surface to the user: out-of-range or unparseable\n    throw ex;\n}","typeGuard":null,"tryCatchPattern":"try {\n    // invoke repackage\n} catch (MojoExecutionException ex) {\n    if (\"Invalid value for parameter 'outputTimestamp'\".equals(ex.getMessage())) {\n        Throwable c = ex.getCause(); // IllegalArgumentException from toFileTime\n        // c.getMessage() tells you range vs parse; fix and retry\n    }\n    throw ex;\n}","preventionTips":["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."],"tags":["spring-boot","maven-plugin","repackage","timestamp","reproducible-builds"],"backgroundTag":null,"analyzedSha":"270dfe353fb830fd69b823a8a859287ff103854b","analyzedAt":"2026-08-11T19:42:06.541Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}