Class DockerExeExecutor
java.lang.Object
org.apache.maven.executor.support.ProcessBuilderExecutorSupport
org.apache.maven.executor.providers.dockerexe.DockerExeExecutor
- All Implemented Interfaces:
AutoCloseable,Executor
Executor that spawns a process with
docker CLI to execute request.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConcurrentHashMap<String, String> protected final Stringprotected final StringFields inherited from class org.apache.maven.executor.support.ProcessBuilderExecutorSupport
closedFields inherited from interface org.apache.maven.executor.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 intexecute(ExecutorRequest request) Invokes the tool application using the providedExecutorRequest.Returns the Maven version that this executor points at (would use).static DockerExeExecutorMethod to create executor that will use given Docker image with optionally provided tag.static DockerExeExecutorwithMavenImageVersion(String mavenVersion) Method to create executor that will use Maven Docker image with given tag (Maven version).Methods inherited from class org.apache.maven.executor.support.ProcessBuilderExecutorSupport
doClose, doExecuteProcess, pump
-
Field Details
-
imageName
-
imageTag
-
cache
-
-
Constructor Details
-
DockerExeExecutor
-
-
Method Details
-
withMavenImageVersion
Method to create executor that will use Maven Docker image with given tag (Maven version).- Parameters:
mavenVersion- required param, the Maven version, notnull.
-
withImage
Method to create executor that will use given Docker image with optionally provided tag.- Parameters:
imageName- required param, the image name to use, notnull.imageTag- optional param, the image tag, may benull.
-
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:
request- 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
-
detectUid
- Throws:
IOException
-
close
public void 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- Overrides:
closein classProcessBuilderExecutorSupport
-