public class MavenExecutionContext extends java.lang.Object implements IMavenExecutionContext
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.Object> |
context |
private static java.lang.String |
CTX_LOCALREPOSITORY |
private static java.lang.String |
CTX_MAVENSESSION |
private static java.lang.String |
CTX_PREFIX |
private static java.lang.String |
CTX_REPOSITORYSESSION |
private MavenImpl |
maven |
private org.apache.maven.execution.MavenExecutionRequest |
request |
private static java.lang.ThreadLocal<java.util.Deque<MavenExecutionContext>> |
threadLocal |
Constructor and Description |
---|
MavenExecutionContext(MavenImpl maven) |
Modifier and Type | Method and Description |
---|---|
<V> V |
execute(ICallable<V> callable,
org.eclipse.core.runtime.IProgressMonitor monitor) |
<V> V |
execute(org.apache.maven.project.MavenProject project,
ICallable<V> callable,
org.eclipse.core.runtime.IProgressMonitor monitor) |
private <V> V |
executeBare(org.apache.maven.project.MavenProject project,
ICallable<V> callable,
org.eclipse.core.runtime.IProgressMonitor monitor) |
org.apache.maven.execution.MavenExecutionRequest |
getExecutionRequest()
Can be called outside of
IMavenExecutionContext.execute(ICallable, IProgressMonitor) to configure Maven session parameters. |
org.apache.maven.artifact.repository.ArtifactRepository |
getLocalRepository() |
FilterRepositorySystemSession |
getRepositorySession() |
org.apache.maven.execution.MavenSession |
getSession() |
static MavenExecutionContext |
getThreadContext() |
static MavenExecutionContext |
getThreadContext(boolean innermost) |
<T> T |
getValue(java.lang.String key) |
protected org.apache.maven.execution.MavenExecutionRequest |
newExecutionRequest() |
org.apache.maven.project.ProjectBuildingRequest |
newProjectBuildingRequest() |
static void |
populateSystemProperties(org.apache.maven.execution.MavenExecutionRequest request) |
static void |
resume(java.util.Deque<MavenExecutionContext> queue)
Resumes Maven execution context suspended with
suspend() . |
<T> void |
setValue(java.lang.String key,
T value) |
static java.util.Deque<MavenExecutionContext> |
suspend()
Suspends current Maven execution context, if any.
|
private static final java.lang.String CTX_PREFIX
private static final java.lang.String CTX_LOCALREPOSITORY
private static final java.lang.String CTX_MAVENSESSION
private static final java.lang.String CTX_REPOSITORYSESSION
private static final java.lang.ThreadLocal<java.util.Deque<MavenExecutionContext>> threadLocal
private final MavenImpl maven
private org.apache.maven.execution.MavenExecutionRequest request
private java.util.Map<java.lang.String,java.lang.Object> context
public MavenExecutionContext(MavenImpl maven)
public org.apache.maven.execution.MavenExecutionRequest getExecutionRequest() throws org.eclipse.core.runtime.CoreException
IMavenExecutionContext
IMavenExecutionContext.execute(ICallable, IProgressMonitor)
to configure Maven session parameters. For
nested contexts, invocation of this method triggers creation of new nested session. When called during
IMavenExecutionContext.execute(MavenProject, ICallable, IProgressMonitor)
, only getter request methods are allowed and all
request setter or modifier will through IllegalStateException
.getExecutionRequest
in interface IMavenExecutionContext
org.eclipse.core.runtime.CoreException
protected org.apache.maven.execution.MavenExecutionRequest newExecutionRequest() throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public <V> V execute(ICallable<V> callable, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
execute
in interface IMavenExecutionContext
org.eclipse.core.runtime.CoreException
public <V> V execute(org.apache.maven.project.MavenProject project, ICallable<V> callable, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
execute
in interface IMavenExecutionContext
org.eclipse.core.runtime.CoreException
private <V> V executeBare(org.apache.maven.project.MavenProject project, ICallable<V> callable, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public org.apache.maven.execution.MavenSession getSession()
getSession
in interface IMavenExecutionContext
public org.apache.maven.artifact.repository.ArtifactRepository getLocalRepository()
getLocalRepository
in interface IMavenExecutionContext
public FilterRepositorySystemSession getRepositorySession()
getRepositorySession
in interface IMavenExecutionContext
public static MavenExecutionContext getThreadContext()
public static MavenExecutionContext getThreadContext(boolean innermost)
public static void populateSystemProperties(org.apache.maven.execution.MavenExecutionRequest request)
public org.apache.maven.project.ProjectBuildingRequest newProjectBuildingRequest()
newProjectBuildingRequest
in interface IMavenExecutionContext
public static java.util.Deque<MavenExecutionContext> suspend()
null
if there was no context
associated with the current thread.resume(Deque)
public static void resume(java.util.Deque<MavenExecutionContext> queue)
suspend()
.resume(Deque)
public <T> T getValue(java.lang.String key)
public <T> void setValue(java.lang.String key, T value)