Package org.apache.maven.executor.forked
Class ForkedMavenExecutor
java.lang.Object
org.apache.maven.executor.support.ProcessBuilderExecutorSupport
org.apache.maven.executor.forked.ForkedMavenExecutor
- All Implemented Interfaces:
AutoCloseable,Executor
Forked executor implementation, that spawns a subprocess with Maven from the installation directory. Very costly
but provides the best isolation.
-
Field Summary
FieldsFields inherited from class org.apache.maven.executor.support.ProcessBuilderExecutorSupport
closedFields inherited from interface org.apache.maven.executor.Executor
IS_WINDOWS, UNKNOWN_VERSION -
Constructor Summary
ConstructorsConstructorDescriptionForkedMavenExecutor(Path installationDirectory) ForkedMavenExecutor(Path installationDirectory, boolean useMavenArgsEnv) -
Method Summary
Modifier and TypeMethodDescriptionprotected ExecutorResultdoExecute(ExecutorRequest executorRequest) execute(ExecutorRequest executorRequest) Invokes the tool application using the providedExecutorRequest.Returns the Maven version that this executor points at (would use).protected voidvalidate(ExecutorRequest executorRequest) Methods inherited from class org.apache.maven.executor.support.ProcessBuilderExecutorSupport
close, doClose, doExecuteProcess, pump
-
Field Details
-
installationDirectory
-
useMavenArgsEnv
protected final boolean useMavenArgsEnv
-
-
Constructor Details
-
ForkedMavenExecutor
-
ForkedMavenExecutor
-
-
Method Details
-
execute
Description copied from interface:ExecutorInvokes the tool application using the providedExecutorRequest. This method is responsible for executing the command or build process based on the information contained in the request.- 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
-
mavenVersion
Description copied from interface:ExecutorReturns the Maven version that this executor points at (would use). This operation, depending on the underlying implementation, can be costly. If a caller uses this method often, it is the caller's responsibility to properly cache returned values.- Specified by:
mavenVersionin interfaceExecutor- Returns:
- a string representing the Maven version or
Executor.UNKNOWN_VERSION - Throws:
ExecutorException- if an error occurs during the execution process
-
validate
- Throws:
ExecutorException
-
doExecute
- Throws:
ExecutorException
-