Class ResidentMavenInvoker
java.lang.Object
org.apache.maven.cling.invoker.LookupInvoker<MavenContext>
org.apache.maven.cling.invoker.mvn.MavenInvoker
org.apache.maven.cling.invoker.mvn.resident.ResidentMavenInvoker
- All Implemented Interfaces:
AutoCloseable, org.apache.maven.api.cli.Invoker
Resident invoker implementation, specialization of Maven Invoker, but keeps Maven instance resident. This implies, that
things like environment, system properties, extensions etc. are loaded only once. It is caller duty to ensure
that subsequent call is right for the resident instance (ie no env change or different extension needed).
This implementation "pre-populates" MavenContext with pre-existing stuff (except for very first call)
and does not let DI container to be closed.
-
Field Summary
Fields inherited from class MavenInvoker
ANSI_RESET, LAST_ANSI_SEQUENCE, NEXT_LINEFields inherited from class LookupInvoker
contextConsumer, protoLookup -
Constructor Summary
ConstructorsConstructorDescriptionResidentMavenInvoker(org.apache.maven.api.services.Lookup protoLookup, Consumer<LookupContext> contextConsumer) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected MavenContextcopyIfDifferent(MavenContext mavenContext, org.apache.maven.api.cli.InvokerRequest invokerRequest) protected MavenContextcreateContext(org.apache.maven.api.cli.InvokerRequest invokerRequest) Methods inherited from class MavenInvoker
determineExecutionListener, determineGlobalChecksumPolicy, determineMakeBehavior, determinePom, determineReactorFailureBehaviour, determineTransferListener, doExecute, execute, getResumeFromSelector, logBuildResumeHint, logSummary, lookup, performProfileActivation, performProjectActivation, populateRequest, postCommands, prepareMavenExecutionRequest, toolchainsMethods inherited from class LookupInvoker
activateLogging, calculateDegreeOfConcurrency, configureLogging, container, createContainerCapsuleFactory, createCoreExtensionSelector, createTerminal, customizeSettingsRequest, customizeSettingsResult, describe, determineBuildEventListener, determineWriter, doConfigureWithTerminal, doConfigureWithTerminalWithRawStreamsDisabled, doConfigureWithTerminalWithRawStreamsEnabled, doCreateTerminal, doDetermineBuildEventListener, doDetermineWriter, doInvoke, handleException, helpOrVersionAndMayExit, init, invoke, localRepositoryPath, mayDisableInteractiveMode, populateRequestFromSettings, postContainer, preCommands, printErrors, pushCoreProperties, pushUserProperties, settings, settings, setupGuiceClassLoading, showVersion, validate
-
Constructor Details
-
ResidentMavenInvoker
public ResidentMavenInvoker(org.apache.maven.api.services.Lookup protoLookup, @Nullable Consumer<LookupContext> contextConsumer)
-
-
Method Details
-
close
public void close() throws org.apache.maven.api.cli.InvokerException- Throws:
org.apache.maven.api.cli.InvokerException
-
createContext
- Overrides:
createContextin classMavenInvoker
-
copyIfDifferent
protected MavenContext copyIfDifferent(MavenContext mavenContext, org.apache.maven.api.cli.InvokerRequest invokerRequest)
-