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 6b88fda390..a86e5cabcd 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 @@ -209,6 +209,10 @@ private boolean hasRelevantDelta(IMavenProjectFacade projectFacade, IResourceDel if(project == null || buildOutputLocation == null) { return true; } + + IPath outputLocation = projectFacade.getOutputLocation(); + IPath testOutputLocation = projectFacade.getTestOutputLocation(); + IPath projectPath = project.getFullPath(); List moduleLocations = projectFacade.getMavenProjectModules().stream() .map(module -> projectPath.append(module)).toList(); @@ -219,7 +223,12 @@ private boolean hasRelevantDelta(IMavenProjectFacade projectFacade, IResourceDel IPath fullPath = delta.getFullPath(); if(buildOutputLocation.isPrefixOf(fullPath)) { //anything in the build output is not interesting for a change as it is produced by the build - //lets see if there are more interesting parts... + // ... unless a classpath resource that existed before has been deleted, possibly by another builder + if(!resource.exists() && ((outputLocation != null && outputLocation.isPrefixOf(fullPath)) + || (testOutputLocation != null && testOutputLocation.isPrefixOf(fullPath)))) { + hasRelevantDelta.set(true); + return false; + } return true; } for(IPath modulePath : moduleLocations) {