Bogus file copy for onlyIfModified=true
维护者通常 1 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 65/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- java
- 领域
- build-system
调研方向
Start with AbstractWarPackagingTask.copyFile, which the issue identifies as comparing the source and destination modification times when onlyIfModified is true. Check the existing tests for this copy behavior and reproduce the case with files whose contents differ but modification times match. Done when changed content is copied despite equal timestamps and the relevant tests pass.
由索引模型根据 Issue 内容生成。
描述
Affected version
3.5.1, possibly others
Bug description
While analysing a weird race-condition during WAR packaging, I might have discovered the responsible cause.
Symptom: On some builds, the WAR is badly packaged because modified files are not copied from the overlay to the target directory.
This seems to happen, when the overlay file has the same modify time as the target, although having been changed in the build process.
Analysis showed, that the modified overlay file is sometimes not copied, because the modification time is the same as the target file, although the file content differs.
Digging deeper revealed, that the modification timestamp has a granularity of 1 sec on the underlying filesystem (Apple HFS). So when the file modification and packaging actually run within a second, the file copy might be surpressed!
Responsible for that seems this method in AbstractWarPackagingTask:
protected boolean copyFile(
WarPackagingContext context, File source, File destination, String targetFilename, boolean onlyIfModified)
throws IOException {
context.addResource(targetFilename);
BasicFileAttributes readAttributes = Files.readAttributes(source.toPath(), BasicFileAttributes.class);
if (onlyIfModified
&& destination.lastModified()
>= readAttributes.lastModifiedTime().toMillis()) {
context.getLog().debug(" * " + targetFilename + " is up to date.");
return false;
} else {
...
Although the lastModifiedTime attribute is compared in millis, it effectively only compares in seconds, when the underlying FS hasn't that granularity. This even disregards a difference in file size.
- 主要语言
- Java
- 星标
- 48
- 派生
- 103
- 平均合并
- 11 小时 20 分钟
- 30 天内合并 PR
- 15
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/maven-war-plugin 的其他 Issue
-
help wanted maintenance
难度 2/5 1-3 小时 新手友好度 82/100
apache/maven-war-plugin#694 ·
维护者通常 1 天内回复
-
OverlayManager.compareOverlayWithArtifact() treats null classifier as literal "null" string可能已有人在做 @elharo 于 146 天前认领。 未关闭bug
难度 1/5 1 小时以内 新手友好度 88/100
apache/maven-war-plugin#621 ·
维护者通常 1 天内回复
-
DependencyInfo.hashCode() violates equals/hashCode contract可能已有人在做 @elharo 于 146 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
apache/maven-war-plugin#620 · 1 条评论 ·
维护者通常 1 天内回复
-
war:exploded should have an explicit incremental option可能已有人在做 @efegokdemir 于 64 天前认领。 未关闭enhancement
难度 2/5 半天 新手友好度 68/100
apache/maven-war-plugin#556 · 1 条评论 ·
维护者通常 1 天内回复
-
Multibyte UTF-8 character split by newline in MANIFEST. MF可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 4/5 3-5 天 新手友好度 50/100
apache/maven-war-plugin#654 · 3 条评论 ·
维护者通常 1 天内回复
查看 apache/maven-war-plugin 的全部 Issue
相似的 Issue
-
Android Bug Core Drape
难度 2/5 1-3 小时 新手友好度 77/100
organicmaps/organicmaps#14449 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
openhab/openhab-addons#22512 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
objectionary/lints#1871 ·
维护者通常 1 天内回复
-
help wanted maintenance
难度 2/5 1-3 小时 新手友好度 78/100
apache/maven-resolver-ant-tasks#219 ·
维护者通常 1 天内回复
-
help wanted maintenance
难度 2/5 1-3 小时 新手友好度 84/100
apache/maven-project-info-reports-plugin#704 ·
维护者通常 1 天内回复