Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2014-05-20 18:41:23 -0400
committerIgor Fedorenko2014-05-26 11:28:57 -0400
commitc4c5f41bdd69856cd8f1179ac6e69d8dd57457ea (patch)
tree4189baf3b29cd637bb34164e45f6d9928c8087a0
parent5454deeb09f1bb57a9b38e0fd2b23f4deff61c9b (diff)
downloadm2e-core-c4c5f41bdd69856cd8f1179ac6e69d8dd57457ea.tar.gz
m2e-core-c4c5f41bdd69856cd8f1179ac6e69d8dd57457ea.tar.xz
m2e-core-c4c5f41bdd69856cd8f1179ac6e69d8dd57457ea.zip
435800 fixed missing IResourceChangeEvent in some cases
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilderImpl.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilderImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilderImpl.java
index d2c49a25..52ed2806 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilderImpl.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilderImpl.java
@@ -245,6 +245,16 @@ public class MavenBuilderImpl {
if(resource != null) {
workaroundBug368376(resource, monitor);
resource.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ if(resource.exists()) {
+ // the resource has changed for certain, make sure resource sends IResourceChangeEvent
+
+ // eclipse uses file lastModified timestamp to detect resource changes
+ // this can result in missing IResourceChangeEvent's under certain conditions
+ // - two builds happen within filesystem resolution (1s on linux and osx, causes problems during unit tests)
+ // - maven mojo deliberately keeps lastModified (unlikely, but theoretically possible)
+ // @see org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(UnifiedTreeNode)
+ resource.touch(monitor);
+ }
}
}
}

Back to the top