Class HelperImpl
java.lang.Object
org.apache.maven.cling.executor.internal.HelperImpl
- All Implemented Interfaces:
ExecutorHelper
,ExecutorTool
Simple router to executors, and delegate to executor tool.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.maven.cling.executor.ExecutorHelper
ExecutorHelper.Mode
-
Constructor Summary
ConstructorDescriptionHelperImpl
(ExecutorHelper.Mode defaultMode, Path installationDirectory, Executor embedded, Executor forked) -
Method Summary
Modifier and TypeMethodDescriptionartifactPath
(ExecutorRequest.Builder request, String gav, String repositoryId) Returns relative (toExecutorTool.localRepository(ExecutorRequest.Builder)
) path of given artifact in local repository.dump
(ExecutorRequest.Builder request) Performs a diagnostic dump of the environment.int
execute
(ExecutorHelper.Mode mode, ExecutorRequest executorRequest) Executes the request with passed in mode executor.Creates pre-populated builder forExecutorRequest
.Returns the preferred mode of this helper.protected Executor
getExecutor
(ExecutorHelper.Mode mode, ExecutorRequest request) localRepository
(ExecutorRequest.Builder request) Returns the location of local repository, as detected by Maven.High level operation, returns the version of the Maven covered by this helper.metadataPath
(ExecutorRequest.Builder request, String gav, String repositoryId) Returns relative (toExecutorTool.localRepository(ExecutorRequest.Builder)
) path of given metadata in local repository.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.maven.cling.executor.ExecutorHelper
execute
-
Constructor Details
-
HelperImpl
public HelperImpl(ExecutorHelper.Mode defaultMode, @Nullable Path installationDirectory, Executor embedded, Executor forked)
-
-
Method Details
-
getDefaultMode
Description copied from interface:ExecutorHelper
Returns the preferred mode of this helper.- Specified by:
getDefaultMode
in interfaceExecutorHelper
-
executorRequest
Description copied from interface:ExecutorHelper
Creates pre-populated builder forExecutorRequest
. Users of helper must use this method to create properly initialized request builder.- Specified by:
executorRequest
in interfaceExecutorHelper
-
execute
public int execute(ExecutorHelper.Mode mode, ExecutorRequest executorRequest) throws ExecutorException Description copied from interface:ExecutorHelper
Executes the request with passed in mode executor.- Specified by:
execute
in interfaceExecutorHelper
- Throws:
ExecutorException
-
mavenVersion
Description copied from interface:ExecutorHelper
High level operation, returns the version of the Maven covered by this helper. This method call caches underlying operation, and is safe to invoke as many times needed.- Specified by:
mavenVersion
in interfaceExecutorHelper
- See Also:
-
dump
Description copied from interface:ExecutorTool
Performs a diagnostic dump of the environment.- Specified by:
dump
in interfaceExecutorTool
- Parameters:
request
- nevernull
- Throws:
ExecutorException
-
localRepository
Description copied from interface:ExecutorTool
Returns the location of local repository, as detected by Maven. TheuserSettings
param may contain some override (equivalent of-s settings.xml
on CLI).- Specified by:
localRepository
in interfaceExecutorTool
- Parameters:
request
- nevernull
- Throws:
ExecutorException
-
artifactPath
public String artifactPath(ExecutorRequest.Builder request, String gav, String repositoryId) throws ExecutorException Description copied from interface:ExecutorTool
Returns relative (toExecutorTool.localRepository(ExecutorRequest.Builder)
) path of given artifact in local repository.- Specified by:
artifactPath
in interfaceExecutorTool
- Parameters:
request
- nevernull
gav
- the usual resolver artifact GAV string, nevernull
repositoryId
- the remote repository ID in case "remote artifact" is asked for- Throws:
ExecutorException
-
metadataPath
public String metadataPath(ExecutorRequest.Builder request, String gav, String repositoryId) throws ExecutorException Description copied from interface:ExecutorTool
Returns relative (toExecutorTool.localRepository(ExecutorRequest.Builder)
) path of given metadata in local repository. The metadata coordinates in form of[G]:[A]:[V]:[type]
. Absence ofA
implies absence ofV
as well (in other words, it can beG
,G:A
orG:A:V
). The absence oftype
implies it is "maven-metadata.xml". The simplest spec string is:::
.Examples:
:::
is root metadata named "maven-metadata.xml":::my-metadata.xml
is root metadata named "my-metadata.xml"G:::
equals toG:::maven-metadata.xml
G:A::
equals toG:A::maven-metadata.xml
- Specified by:
metadataPath
in interfaceExecutorTool
- Parameters:
request
- nevernull
gav
- the resolver metadata GAV stringrepositoryId
- the remote repository ID in case "remote metadata" is asked for- Throws:
ExecutorException
-
getExecutor
protected Executor getExecutor(ExecutorHelper.Mode mode, ExecutorRequest request) throws ExecutorException - Throws:
ExecutorException
-