Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2013-01-26 20:04:43 -0500
committerIgor Fedorenko2013-02-15 08:40:00 -0500
commit293a1c09ed3ec5401093b7b3b783ea161838b6f0 (patch)
treeb8ac1c5ff9aa49131b824f0f2370865e1a3df627 /org.eclipse.m2e.refactoring
parentba5166dd3babd6668b7195c7d8e9302757aecf30 (diff)
downloadm2e-core-293a1c09ed3ec5401093b7b3b783ea161838b6f0.tar.gz
m2e-core-293a1c09ed3ec5401093b7b3b783ea161838b6f0.tar.xz
m2e-core-293a1c09ed3ec5401093b7b3b783ea161838b6f0.zip
397251,356645 introduced MavenExecutionContext
ThreadLocal is used to associate maven execution context with the current thread. The context encapsulates maven session configuration, i.e. force update, offline, etc flags, as well as repository session cache and data. This ensures consistent use of this configuration and data structures by all maven calls performed by the thread. Specicially, * solves multiple cases where forceUpdate was not honoured during project configuration update (bug 397251) * solves extremely slow performance when multiple projects reference the same missing dependency and forceUpdates=true (bug 356645) See IMavenExecutionContext javadoc for new API details Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.refactoring')
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
index 95326c19..abd4c652 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
@@ -47,11 +47,11 @@ import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
import org.eclipse.osgi.util.NLS;
-import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.project.MavenProject;
import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.ICallable;
+import org.eclipse.m2e.core.embedder.IMavenExecutionContext;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.IMavenProjectRegistry;
import org.eclipse.m2e.model.edit.pom.Model;
@@ -271,15 +271,14 @@ public abstract class AbstractPomRefactoring extends Refactoring {
return res;
}
- protected MavenProject getParentProject(IMavenProjectFacade project, MavenProject current, IProgressMonitor monitor)
- throws CoreException {
- IMaven maven = MavenPlugin.getMaven();
+ protected MavenProject getParentProject(IMavenProjectFacade project, final MavenProject current,
+ final IProgressMonitor monitor) throws CoreException {
IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
-
- MavenExecutionRequest request = projectManager.createExecutionRequest(project.getPom(),
- project.getResolverConfiguration(), monitor);
-
- return maven.resolveParentProject(request, current, monitor);
+ return projectManager.execute(project, new ICallable<MavenProject>() {
+ public MavenProject call(IMavenExecutionContext context, IProgressMonitor monitor) throws CoreException {
+ return MavenPlugin.getMaven().resolveParentProject(current, monitor);
+ }
+ }, monitor);
}
// title for a composite change

Back to the top