Affected version: 3.6.0+
Description:
parseBuildOutputTimestamp() at MavenArchiver.java:690 uses isNumeric() to detect integer epoch timestamps, but isNumeric() rejects the minus sign:
for (char c : str.toCharArray()) {
if (!Character.isDigit(c)) {
return false;
}
}
So isNumeric(-1) returns false. Execution falls through to the ISO-8601 parser at line 709, which also fails, throwing:
IllegalArgumentException("Invalid project.build.outputTimestamp value '-1'")
Negative epoch timestamps (seconds before 1970-01-01) are valid per POSIX and could reasonably appear in SOURCE_DATE_EPOCH or timestamp configuration.
Impact: Valid negative timestamps are rejected with a confusing error message.
Fix: Allow an optional leading - in the numeric check.
Affected version: 3.6.0+
Description:
parseBuildOutputTimestamp()atMavenArchiver.java:690usesisNumeric()to detect integer epoch timestamps, butisNumeric()rejects the minus sign:So
isNumeric(-1)returnsfalse. Execution falls through to the ISO-8601 parser at line 709, which also fails, throwing:Negative epoch timestamps (seconds before 1970-01-01) are valid per POSIX and could reasonably appear in
SOURCE_DATE_EPOCHor timestamp configuration.Impact: Valid negative timestamps are rejected with a confusing error message.
Fix: Allow an optional leading
-in the numeric check.