Package org.apache.maven.executor
Interface ExecutorHelper
- All Superinterfaces:
AutoCloseable,Executor
- All Known Implementing Classes:
ExecutorHelperImpl
Helper class for routing Maven execution based on preferences and/or issued execution requests.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.apache.maven.executor.Executor
IS_WINDOWS, UNKNOWN_VERSION -
Method Summary
Modifier and TypeMethodDescriptionexecute(ExecutorHelper.Mode mode, ExecutorRequest executorRequest) Executes the request with passed in mode executor.default ExecutorResultexecute(ExecutorRequest executorRequest) Executes the request with preferred mode executor.static ExecutorHelperforExecutors(ExecutorHelper.Mode defaultMode, EmbeddedMavenExecutor embedded, ForkedMavenExecutor forked) CreatesExecutorHelperinstance with provided default mode and provided executors.static ExecutorHelperforMavenInstallation(Path installationDirectory, ExecutorHelper.Mode defaultMode) CreatesExecutorHelperalong with needed executors using provided installation directory.Returns the preferred mode of this helper.Methods inherited from interface org.apache.maven.executor.Executor
close, mavenVersion
-
Method Details
-
forMavenInstallation
static ExecutorHelper forMavenInstallation(Path installationDirectory, ExecutorHelper.Mode defaultMode) CreatesExecutorHelperalong with needed executors using provided installation directory. Created instance will assume that provided executors are managed by itself, and on close will close them as well.- Parameters:
installationDirectory- The Maven Home (installation) directory.defaultMode- The default mode of helper.- Returns:
- New instance of helper that will create executors, and close them when is closed.
-
forExecutors
static ExecutorHelper forExecutors(ExecutorHelper.Mode defaultMode, EmbeddedMavenExecutor embedded, ForkedMavenExecutor forked) CreatesExecutorHelperinstance with provided default mode and provided executors. Created instance will assume that provided executors are managed by caller, and on close will not close them.- Parameters:
defaultMode- The default mode of helper.embedded- The embedded executor to use.forked- The forked executor to use.- Returns:
- New instance of helper that will not close provided executors when is closed.
-
getDefaultMode
ExecutorHelper.Mode getDefaultMode()Returns the preferred mode of this helper. -
execute
Executes the request with preferred mode executor.- Specified by:
executein interfaceExecutor- Parameters:
executorRequest- the request containing all necessary information for the execution- Returns:
- ExecutorResult carrying the result of the execution
- Throws:
ExecutorException- if an error occurs during the execution process
-
execute
ExecutorResult execute(ExecutorHelper.Mode mode, ExecutorRequest executorRequest) throws ExecutorException Executes the request with passed in mode executor.- Throws:
ExecutorException
-