desruisseaux commented on code in PR #599:
URL: https://github.com/apache/maven-jar-plugin/pull/599#discussion_r4045413245


##########
src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java:
##########
@@ -50,6 +50,12 @@
  * @author Martin Desruisseaux
  */
 public abstract class AbstractJarMojo implements 
org.apache.maven.api.plugin.Mojo {
+    /**
+     * Minimum timestamp accepted by the {@code jar} tool (ZIP format 
constraint: entries must be ≥ 1980-01-01).
+     * Timestamps before this value are automatically clamped to this minimum 
with a warning.
+     */
+    static final Instant DATE_MIN = Instant.parse("1980-01-01T00:00:02Z");
+

Review Comment:
   Could be replaced by `static final long EPOCH_MIN = 315532800;` for avoiding 
the cost of parsing a date which will never be used in many cases. It would 
replace the 315532800 value currently hard-coded in the error message. A JUnit 
test can verify that `DATE_MIN == 
Instant.parse("1980-01-01T00:00:00Z").getEpochSecond()`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to