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 type
R - the request type
C - 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.
  • Field Details

    • protoLookup

      protected final ProtoLookup protoLookup
  • Constructor Details

    • LookupInvoker

      public LookupInvoker(ProtoLookup protoLookup)
  • Method Details

    • invoke

      public int invoke(R invokerRequest) throws InvokerException
      Description copied from interface: Invoker
      Invokes the Maven application using the provided InvokerRequest. This method is responsible for executing the Maven command or build process based on the information contained in the request.
      Specified by:
      invoke in interface Invoker<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

      protected int doInvoke(C context) throws Exception
      Throws:
      Exception
    • handleException

      protected InvokerException handleException(LookupInvoker.LookupInvokerContext<O,R,C> context, Exception e) throws InvokerException
      Throws:
      InvokerException
    • createContext

      protected abstract C createContext(R invokerRequest) throws InvokerException
      Throws:
      InvokerException
    • pushProperties

      protected void pushProperties(C context) throws Exception
      Throws:
      Exception
    • validate

      protected void validate(C context) throws Exception
      Throws:
      Exception
    • prepare

      protected void prepare(C context) throws Exception
      Throws:
      Exception
    • configureLogging

      protected void configureLogging(C context) throws Exception
      Throws:
      Exception
    • createTerminal

      protected org.jline.terminal.Terminal createTerminal(C context)
    • doConfigureWithTerminal

      protected void doConfigureWithTerminal(C context, org.jline.terminal.Terminal terminal)
    • determineBuildEventListener

      protected BuildEventListener determineBuildEventListener(C context)
    • doDetermineBuildEventListener

      protected BuildEventListener doDetermineBuildEventListener(C context)
    • activateLogging

      protected void activateLogging(C context) throws Exception
      Throws:
      Exception
    • helpOrVersionAndMayExit

      protected void helpOrVersionAndMayExit(C context) throws Exception
      Throws:
      Exception
    • preCommands

      protected void preCommands(C context) throws Exception
      Throws:
      Exception
    • container

      protected void container(C context) throws Exception
      Throws:
      Exception
    • createContainerCapsuleFactory

      protected ContainerCapsuleFactory<O,R,C> createContainerCapsuleFactory()
    • lookup

      protected void lookup(C context) throws Exception
      Throws:
      Exception
    • init

      protected void init(C context) throws Exception
      Throws:
      Exception
    • postCommands

      protected void postCommands(C context) throws Exception
      Throws:
      Exception
    • settings

      protected void settings(C context) throws Exception
      Throws:
      Exception
    • settings

      protected void settings(C context, SettingsBuilder settingsBuilder) throws Exception
      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

      protected boolean mayDisableInteractiveMode(C context, boolean proposedInteractive)
    • localRepositoryPath

      protected Path localRepositoryPath(C context)
    • populateRequest

      protected void populateRequest(C context, MavenExecutionRequest request) throws Exception
      Throws:
      Exception
    • populateRequestFromSettings

      protected void populateRequestFromSettings(MavenExecutionRequest request, Settings settings) throws Exception
      Throws:
      Exception
    • calculateDegreeOfConcurrency

      protected int calculateDegreeOfConcurrency(String threadConfiguration)
    • isRunningOnCI

      protected boolean isRunningOnCI(C context)
    • determineTransferListener

      protected org.eclipse.aether.transfer.TransferListener determineTransferListener(C context, boolean noTransferProgress)
    • execute

      protected abstract int execute(C context) throws Exception
      Throws:
      Exception