Bogus file copy for onlyIfModified=true
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- java
- Ambito
- build-system
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Java
- Stelle
- 48
- Fork
- 103
- Merge medio
- 11h 20m
- PR unite (30g)
- 15
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/maven-war-plugin
-
help wanted maintenance
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/maven-war-plugin#694 ·
I maintainer di solito rispondono entro 1 giorno
-
OverlayManager.compareOverlayWithArtifact() treats null classifier as literal "null" stringForse già presa @elharo l’ha presa 146 giorni fa. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
apache/maven-war-plugin#621 ·
I maintainer di solito rispondono entro 1 giorno
-
DependencyInfo.hashCode() violates equals/hashCode contractForse già presa @elharo l’ha presa 146 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/maven-war-plugin#620 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
war:exploded should have an explicit incremental optionForse già presa @efegokdemir l’ha presa 64 giorni fa. Apertaenhancement
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
apache/maven-war-plugin#556 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Multibyte UTF-8 character split by newline in MANIFEST. MFForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 50/100
apache/maven-war-plugin#654 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/maven-war-plugin
Issue simili
-
Android Bug Core Drape
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
organicmaps/organicmaps#14449 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
openhab/openhab-addons#22512 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
objectionary/lints#1871 ·
I maintainer di solito rispondono entro 1 giorno
-
help wanted maintenance
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/maven-resolver-ant-tasks#219 ·
I maintainer di solito rispondono entro 1 giorno
-
help wanted maintenance
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
apache/maven-project-info-reports-plugin#704 ·
I maintainer di solito rispondono entro 1 giorno