arturobernalg commented on code in PR #690:
URL: https://github.com/apache/maven-war-plugin/pull/690#discussion_r4667797692
##########
src/main/java/org/apache/maven/plugins/war/packaging/AbstractWarPackagingTask.java:
##########
@@ -329,9 +329,12 @@ protected boolean copyFile(
context.addResource(targetFilename);
BasicFileAttributes readAttributes =
Files.readAttributes(source.toPath(), BasicFileAttributes.class);
+ // A directory source is archived into destination below, so its own
filesystem size has no
+ // relation to the resulting jar's size; only compare sizes for a
plain file source.
if (onlyIfModified
&& destination.lastModified()
- >= readAttributes.lastModifiedTime().toMillis()) {
+ >= readAttributes.lastModifiedTime().toMillis()
+ && (readAttributes.isDirectory() || destination.length() ==
readAttributes.size())) {
Review Comment:
Replaced the size check with an actual content comparison
(`FileUtils.contentEquals`) in ad27570, so a same-size edit no longer looks up
to date. Directories still use mtime-only, unchanged.
--
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]