Class MavenInvoker
java.lang.Object
org.apache.maven.cling.invoker.LookupInvoker<MavenContext>
org.apache.maven.cling.invoker.mvn.MavenInvoker
- All Implemented Interfaces:
AutoCloseable, org.apache.maven.api.cli.Invoker
- Direct Known Subclasses:
ResidentMavenInvoker
The Maven invoker, that expects whole Maven on classpath and invokes it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Patternprotected static final PatternFields inherited from class LookupInvoker
contextConsumer, protoLookup -
Constructor Summary
ConstructorsConstructorDescriptionMavenInvoker(org.apache.maven.api.services.Lookup protoLookup, Consumer<LookupContext> contextConsumer) -
Method Summary
Modifier and TypeMethodDescriptionprotected MavenContextcreateContext(org.apache.maven.api.cli.InvokerRequest invokerRequest) protected org.apache.maven.execution.ExecutionListenerdetermineExecutionListener(MavenContext context) protected Stringprotected StringdetermineMakeBehavior(MavenContext context) protected PathdeterminePom(MavenContext context, org.apache.maven.api.services.Lookup lookup) protected Stringprotected org.eclipse.aether.transfer.TransferListenerdetermineTransferListener(MavenContext context, boolean noTransferProgress) protected intdoExecute(MavenContext context, org.apache.maven.execution.MavenExecutionRequest request) protected intexecute(MavenContext context) protected StringgetResumeFromSelector(List<org.apache.maven.project.MavenProject> mavenProjects, org.apache.maven.project.MavenProject firstFailedProject) A helper method to determine the value to resume the build with-rftaking into account the edge case where multiple modules in the reactor have the same artifactId.protected voidlogBuildResumeHint(MavenContext context, String resumeBuildHint) protected voidlogSummary(MavenContext context, org.apache.maven.exception.ExceptionSummary summary, Map<String, String> references, String indent) protected voidlookup(MavenContext context) protected voidperformProfileActivation(MavenContext context, org.apache.maven.execution.ProfileActivation profileActivation) protected voidperformProjectActivation(MavenContext context, org.apache.maven.execution.ProjectActivation projectActivation) protected voidpopulateRequest(MavenContext context, org.apache.maven.api.services.Lookup lookup, org.apache.maven.execution.MavenExecutionRequest request) protected voidpostCommands(MavenContext context) protected org.apache.maven.execution.MavenExecutionRequestprotected voidtoolchains(MavenContext context, org.apache.maven.execution.MavenExecutionRequest request) Methods 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, validateMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.api.cli.Invoker
close
-
Field Details
-
NEXT_LINE
-
LAST_ANSI_SEQUENCE
-
ANSI_RESET
- See Also:
-
-
Constructor Details
-
MavenInvoker
public MavenInvoker(org.apache.maven.api.services.Lookup protoLookup, @Nullable Consumer<LookupContext> contextConsumer)
-
-
Method Details
-
createContext
- Specified by:
createContextin classLookupInvoker<MavenContext>
-
execute
- Specified by:
executein classLookupInvoker<MavenContext>- Throws:
Exception
-
prepareMavenExecutionRequest
-
lookup
- Overrides:
lookupin classLookupInvoker<MavenContext>- Throws:
Exception
-
postCommands
- Overrides:
postCommandsin classLookupInvoker<MavenContext>- Throws:
Exception
-
toolchains
protected void toolchains(MavenContext context, org.apache.maven.execution.MavenExecutionRequest request) throws Exception - Throws:
Exception
-
populateRequest
protected void populateRequest(MavenContext context, org.apache.maven.api.services.Lookup lookup, org.apache.maven.execution.MavenExecutionRequest request) throws Exception - Overrides:
populateRequestin classLookupInvoker<MavenContext>- Throws:
Exception
-
determinePom
-
determineReactorFailureBehaviour
-
determineGlobalChecksumPolicy
-
determineExecutionListener
protected org.apache.maven.execution.ExecutionListener determineExecutionListener(MavenContext context) -
determineTransferListener
protected org.eclipse.aether.transfer.TransferListener determineTransferListener(MavenContext context, boolean noTransferProgress) -
determineMakeBehavior
-
performProjectActivation
protected void performProjectActivation(MavenContext context, org.apache.maven.execution.ProjectActivation projectActivation) -
performProfileActivation
protected void performProfileActivation(MavenContext context, org.apache.maven.execution.ProfileActivation profileActivation) -
doExecute
protected int doExecute(MavenContext context, org.apache.maven.execution.MavenExecutionRequest request) throws Exception - Throws:
Exception
-
logBuildResumeHint
-
getResumeFromSelector
protected String getResumeFromSelector(List<org.apache.maven.project.MavenProject> mavenProjects, org.apache.maven.project.MavenProject firstFailedProject) A helper method to determine the value to resume the build with-rftaking into account the edge case where multiple modules in the reactor have the same artifactId.-rf :artifactIdwill pick up the first module which matches, but when multiple modules in the reactor have the same artifactId, effective failed module might be later in build reactor. This means that developer will either have to type groupId or wait for build execution of all modules which were fine, but they are still before one which reported errors.Then the returned value is
groupId:artifactIdwhen there is a name clash and:artifactIdif there is no conflict. This method is made package-private for testing purposes.- Parameters:
mavenProjects- Maven projects which are part of build execution.firstFailedProject- The first project which has failed.- Returns:
- Value for -rf flag to resume build exactly from place where it failed (
:artifactIdin general andgroupId:artifactIdwhen there is a name clash).
-
logSummary
protected void logSummary(MavenContext context, org.apache.maven.exception.ExceptionSummary summary, Map<String, String> references, String indent)
-