arturobernalg commented on code in PR #690:
URL: https://github.com/apache/maven-war-plugin/pull/690#discussion_r4662304746


##########
src/main/java/org/apache/maven/plugins/war/packaging/AbstractWarPackagingTask.java:
##########
@@ -331,7 +331,8 @@ protected boolean copyFile(
         BasicFileAttributes readAttributes = 
Files.readAttributes(source.toPath(), BasicFileAttributes.class);
         if (onlyIfModified
                 && destination.lastModified()
-                        >= readAttributes.lastModifiedTime().toMillis()) {
+                        >= readAttributes.lastModifiedTime().toMillis()
+                && destination.length() == readAttributes.size()) {

Review Comment:
   You're right — when source is a directory it gets archived into a jar below, 
so its own filesystem size has nothing to do with the destination jar's size. 
Fixed in f053472: the size check now only applies to a plain file source; a 
directory falls back to the original mtime-only check. Added a test that 
reproduces the NPE this caused (getJarArchiver() called unnecessarily) and 
confirms the fix.



-- 
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