Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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