Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2014-08-18 00:24:40 -0400
committerIgor Fedorenko2014-08-18 00:24:40 -0400
commitd4cb56da64054930c176bffc6eb0308fcb843d13 (patch)
treefcd572b232b5f3228ec9af23034ff97fb797e897
parent08d98da9544e4567d2b4496c6e9d68158bccc762 (diff)
downloadm2e-core-d4cb56da64054930c176bffc6eb0308fcb843d13.tar.gz
m2e-core-d4cb56da64054930c176bffc6eb0308fcb843d13.tar.xz
m2e-core-d4cb56da64054930c176bffc6eb0308fcb843d13.zip
441257 fixed maven caches are flushed too frequently during forced update
Change-Id: I9cabb666df1880a36556c7d4b4ac6640528089a0 Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectCachePlunger.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectCachePlunger.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectCachePlunger.java
index 59f20f3b..69d18c4b 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectCachePlunger.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectCachePlunger.java
@@ -15,6 +15,9 @@ import java.io.File;
import java.util.HashSet;
import java.util.Set;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
@@ -35,6 +38,8 @@ import org.eclipse.m2e.core.internal.embedder.MavenExecutionContext;
*/
abstract class ProjectCachePlunger<Key> {
+ private final Logger log = LoggerFactory.getLogger(getClass());
+
final Multimap<File, Key> projectKeys = HashMultimap.create();
final Multimap<Key, File> keyProjects = HashMultimap.create();
@@ -58,6 +63,7 @@ abstract class ProjectCachePlunger<Key> {
keyProjects.remove(cacheKey, pom);
if(forceDependencyUpdate && RepositoryPolicy.UPDATE_POLICY_ALWAYS.equals(session.getUpdatePolicy())
&& sessionCache.get(session, cacheKey) == null) {
+ sessionCache.put(session, cacheKey, Boolean.TRUE);
for(File affectedPom : keyProjects.removeAll(cacheKey)) {
affectedProjects.add(affectedPom);
projectKeys.remove(affectedPom, cacheKey);
@@ -65,6 +71,7 @@ abstract class ProjectCachePlunger<Key> {
}
if(!keyProjects.containsKey(cacheKey)) {
flush(cacheKey);
+ log.debug("Flushed cache entry for {}", cacheKey);
}
}

Back to the top