Package org.apache.maven.cling.invoker
Class LookupInvoker<O extends Options,R extends InvokerRequest<O>,C extends LookupInvoker.LookupInvokerContext<O,R,C>>
java.lang.Object
org.apache.maven.cling.invoker.LookupInvoker<O,R,C>
- Type Parameters:
O
- the options typeR
- the request typeC
- the context type
- All Implemented Interfaces:
AutoCloseable
,Invoker<R>
- Direct Known Subclasses:
DefaultEncryptInvoker
,DefaultMavenInvoker
public abstract class LookupInvoker<O extends Options,R extends InvokerRequest<O>,C extends LookupInvoker.LookupInvokerContext<O,R,C>>
extends Object
implements Invoker<R>
Plexus invoker implementation, that boots up Plexus DI container. This class expects fully setup ClassWorld via constructor.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Exception for intentional exit: No message or anything will be displayed, just the carried exit code will be returned frominvoke(InvokerRequest)
method.static class
LookupInvoker.LookupInvokerContext<O extends Options,
R extends InvokerRequest<O>, C extends LookupInvoker.LookupInvokerContext<O, R, C>> -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
activateLogging
(C context) protected int
calculateDegreeOfConcurrency
(String threadConfiguration) protected void
configureLogging
(C context) protected void
protected ContainerCapsuleFactory
<O, R, C> protected abstract C
createContext
(R invokerRequest) protected org.jline.terminal.Terminal
createTerminal
(C context) protected void
customizeSettingsRequest
(C context, SettingsBuilderRequest settingsBuilderRequest) protected void
customizeSettingsResult
(C context, SettingsBuilderResult settingsBuilderResult) protected BuildEventListener
determineBuildEventListener
(C context) protected org.eclipse.aether.transfer.TransferListener
determineTransferListener
(C context, boolean noTransferProgress) protected void
doConfigureWithTerminal
(C context, org.jline.terminal.Terminal terminal) protected BuildEventListener
doDetermineBuildEventListener
(C context) protected int
protected abstract int
protected InvokerException
handleException
(LookupInvoker.LookupInvokerContext<O, R, C> context, Exception e) protected void
helpOrVersionAndMayExit
(C context) protected void
int
Invokes the Maven application using the providedInvokerRequest
.protected boolean
isRunningOnCI
(C context) protected Path
localRepositoryPath
(C context) protected void
protected boolean
mayDisableInteractiveMode
(C context, boolean proposedInteractive) protected void
populateRequest
(C context, MavenExecutionRequest request) protected void
populateRequestFromSettings
(MavenExecutionRequest request, Settings settings) protected void
postCommands
(C context) protected void
preCommands
(C context) protected void
protected void
pushProperties
(C context) protected void
protected void
settings
(C context, SettingsBuilder settingsBuilder) protected void
-
Field Details
-
protoLookup
-
-
Constructor Details
-
LookupInvoker
-
-
Method Details
-
invoke
Description copied from interface:Invoker
Invokes the Maven application using the providedInvokerRequest
. This method is responsible for executing the Maven command or build process based on the information contained in the request.- Specified by:
invoke
in interfaceInvoker<O extends Options>
- Parameters:
invokerRequest
- the request containing all necessary information for the invocation- Returns:
- an integer representing the exit code of the invocation (0 typically indicates success)
- Throws:
InvokerException
- if an error occurs during the invocation process
-
doInvoke
- Throws:
Exception
-
handleException
protected InvokerException handleException(LookupInvoker.LookupInvokerContext<O, R, throws InvokerExceptionC> context, Exception e) - Throws:
InvokerException
-
createContext
- Throws:
InvokerException
-
pushProperties
- Throws:
Exception
-
validate
- Throws:
Exception
-
prepare
- Throws:
Exception
-
configureLogging
- Throws:
Exception
-
createTerminal
-
doConfigureWithTerminal
-
determineBuildEventListener
-
doDetermineBuildEventListener
-
activateLogging
- Throws:
Exception
-
helpOrVersionAndMayExit
- Throws:
Exception
-
preCommands
- Throws:
Exception
-
container
- Throws:
Exception
-
createContainerCapsuleFactory
-
lookup
- Throws:
Exception
-
init
- Throws:
Exception
-
postCommands
- Throws:
Exception
-
settings
- Throws:
Exception
-
settings
- Throws:
Exception
-
customizeSettingsRequest
protected void customizeSettingsRequest(C context, SettingsBuilderRequest settingsBuilderRequest) throws Exception - Throws:
Exception
-
customizeSettingsResult
protected void customizeSettingsResult(C context, SettingsBuilderResult settingsBuilderResult) throws Exception - Throws:
Exception
-
mayDisableInteractiveMode
-
localRepositoryPath
-
populateRequest
- Throws:
Exception
-
populateRequestFromSettings
protected void populateRequestFromSettings(MavenExecutionRequest request, Settings settings) throws Exception - Throws:
Exception
-
calculateDegreeOfConcurrency
-
isRunningOnCI
-
determineTransferListener
protected org.eclipse.aether.transfer.TransferListener determineTransferListener(C context, boolean noTransferProgress) -
execute
- Throws:
Exception
-