Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2014-06-28 10:43:14 -0400
committerIgor Fedorenko2014-06-28 10:43:14 -0400
commitdc8bf3bfa170f3197426d4e5ea2ce03fc03bc19c (patch)
tree500bc596593a7abb1774099517fba532dc60c643 /org.eclipse.m2e.core
parent0f4dc86b631490d125d8a3be3412ccc830954f26 (diff)
downloadm2e-core-dc8bf3bfa170f3197426d4e5ea2ce03fc03bc19c.tar.gz
m2e-core-dc8bf3bfa170f3197426d4e5ea2ce03fc03bc19c.tar.xz
m2e-core-dc8bf3bfa170f3197426d4e5ea2ce03fc03bc19c.zip
438454 manage SessionScope
Change-Id: I707f37437a4d9ada5725f10d612d81a3a9d9fe44 Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.core')
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExecutionContext.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExecutionContext.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExecutionContext.java
index 5ebbc5a7..426f7cc1 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExecutionContext.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExecutionContext.java
@@ -23,6 +23,7 @@ import org.eclipse.aether.transfer.TransferListener;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.apache.maven.SessionScope;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.execution.DefaultMavenExecutionRequest;
import org.apache.maven.execution.DefaultMavenExecutionResult;
@@ -137,10 +138,17 @@ public class MavenExecutionContext implements IMavenExecutionContext {
final MavenSession origLegacySession = legacySupport.getSession(); // TODO validate == origSession
stack.push(this);
- legacySupport.setSession(getSession());
+
+ final MavenSession session = getSession();
+ legacySupport.setSession(session);
+ final SessionScope sessionScope = maven.lookup(SessionScope.class);
+ sessionScope.enter();
+ sessionScope.seed(MavenSession.class, session);
+
try {
return executeBare(project, callable, monitor);
} finally {
+ sessionScope.exit();
stack.pop();
if(stack.isEmpty()) {
threadLocal.set(null); // TODO decide if this is useful

Back to the top