Class ForkedMavenExecutor
java.lang.Object
org.apache.maven.cling.executor.forked.ForkedMavenExecutor
- All Implemented Interfaces:
AutoCloseable, Executor
-
Field Summary
FieldsFields inherited from interface Executor
IS_WINDOWS, UNKNOWN_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes and disposes of thisExecutorinstance, releasing any resources it may hold.protected intdoExecute(ExecutorRequest executorRequest) intexecute(ExecutorRequest executorRequest) Invokes the tool application using the providedExecutorRequest.mavenVersion(ExecutorRequest executorRequest) Returns the Maven version that providedExecutorRequestpoint at (would use).protected CountDownLatchpump(Process p, ExecutorRequest executorRequest) protected voidvalidate(ExecutorRequest executorRequest)
-
Field Details
-
useMavenArgsEnv
protected final boolean useMavenArgsEnv -
closed
-
-
Constructor Details
-
ForkedMavenExecutor
public ForkedMavenExecutor() -
ForkedMavenExecutor
public ForkedMavenExecutor(boolean useMavenArgsEnv)
-
-
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:
- an integer representing the exit code of the execution (0 typically indicates success)
- Throws:
ExecutorException- if an error occurs during the execution process
-
mavenVersion
Description copied from interface:ExecutorReturns the Maven version that providedExecutorRequestpoint 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. (key can beExecutorRequest.installationDirectory().- Specified by:
mavenVersionin interfaceExecutor- Parameters:
executorRequest- the request containing all necessary information for the execution- 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
-
pump
-
close
Description copied from interface:ExecutorCloses and disposes of thisExecutorinstance, releasing any resources it may hold. This method is called automatically when using try-with-resources statements.The default implementation does nothing. Subclasses should override this method if they need to perform cleanup operations.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceExecutor- Throws:
ExecutorException- if an error occurs while closing theExecutor
-