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
ConstructorsConstructorDescriptionHelperImpl(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.intexecute(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 ExecutorgetExecutor(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, waitMethods 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:ExecutorHelperReturns the preferred mode of this helper.- Specified by:
getDefaultModein interfaceExecutorHelper
-
executorRequest
Description copied from interface:ExecutorHelperCreates pre-populated builder forExecutorRequest. Users of helper must use this method to create properly initialized request builder.- Specified by:
executorRequestin interfaceExecutorHelper
-
execute
public int execute(ExecutorHelper.Mode mode, ExecutorRequest executorRequest) throws ExecutorException Description copied from interface:ExecutorHelperExecutes the request with passed in mode executor.- Specified by:
executein interfaceExecutorHelper- Throws:
ExecutorException
-
mavenVersion
Description copied from interface:ExecutorHelperHigh 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:
mavenVersionin interfaceExecutorHelper- See Also:
-
dump
Description copied from interface:ExecutorToolPerforms a diagnostic dump of the environment.- Specified by:
dumpin interfaceExecutorTool- Parameters:
request- nevernull- Throws:
ExecutorException
-
localRepository
Description copied from interface:ExecutorToolReturns the location of local repository, as detected by Maven. TheuserSettingsparam may contain some override (equivalent of-s settings.xmlon CLI).- Specified by:
localRepositoryin interfaceExecutorTool- Parameters:
request- nevernull- Throws:
ExecutorException
-
artifactPath
public String artifactPath(ExecutorRequest.Builder request, String gav, String repositoryId) throws ExecutorException Description copied from interface:ExecutorToolReturns relative (toExecutorTool.localRepository(ExecutorRequest.Builder)) path of given artifact in local repository.- Specified by:
artifactPathin interfaceExecutorTool- Parameters:
request- nevernullgav- the usual resolver artifact GAV string, nevernullrepositoryId- 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:ExecutorToolReturns relative (toExecutorTool.localRepository(ExecutorRequest.Builder)) path of given metadata in local repository. The metadata coordinates in form of[G]:[A]:[V]:[type]. Absence ofAimplies absence ofVas well (in other words, it can beG,G:AorG:A:V). The absence oftypeimplies it is "maven-metadata.xml". The simplest spec string is:::.Examples:
:::is root metadata named "maven-metadata.xml":::my-metadata.xmlis root metadata named "my-metadata.xml"G:::equals toG:::maven-metadata.xmlG:A::equals toG:A::maven-metadata.xml
- Specified by:
metadataPathin interfaceExecutorTool- Parameters:
request- nevernullgav- 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
-