Class MavenInvoker
java.lang.Object
org.apache.maven.cling.invoker.LookupInvoker<MavenContext>
org.apache.maven.cling.invoker.mvn.MavenInvoker
- All Implemented Interfaces:
AutoCloseable,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 org.apache.maven.cling.invoker.LookupInvoker
contextConsumer, protoLookup -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MavenContextcreateContext(InvokerRequest invokerRequest) protected ExecutionListenerdetermineExecutionListener(MavenContext context) protected Stringprotected StringdetermineMakeBehavior(MavenContext context) protected PathdeterminePom(MavenContext context, Lookup lookup) protected Stringprotected org.eclipse.aether.transfer.TransferListenerdetermineTransferListener(MavenContext context, boolean noTransferProgress) protected intdoExecute(MavenContext context, MavenExecutionRequest request) protected intexecute(MavenContext context) protected StringgetResumeFromSelector(List<MavenProject> mavenProjects, 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, ExceptionSummary summary, Map<String, String> references, String indent) protected voidlookup(MavenContext context) protected voidperformProfileActivation(MavenContext context, ProfileActivation profileActivation) protected voidperformProjectActivation(MavenContext context, ProjectActivation projectActivation) protected voidpopulateRequest(MavenContext context, Lookup lookup, MavenExecutionRequest request) protected voidpostCommands(MavenContext context) protected MavenExecutionRequestprotected voidtoolchains(MavenContext context, MavenExecutionRequest request) Methods inherited from class org.apache.maven.cling.invoker.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, showVersion, validate
-
Field Details
-
NEXT_LINE
-
LAST_ANSI_SEQUENCE
-
ANSI_RESET
- See Also:
-
-
Constructor Details
-
MavenInvoker
-
-
Method Details
-
createContext
- Specified by:
createContextin classLookupInvoker<MavenContext>
-
execute
- Specified by:
executein classLookupInvoker<MavenContext>- Throws:
Exception
-
prepareMavenExecutionRequest
- Throws:
Exception
-
lookup
- Overrides:
lookupin classLookupInvoker<MavenContext>- Throws:
Exception
-
postCommands
- Overrides:
postCommandsin classLookupInvoker<MavenContext>- Throws:
Exception
-
toolchains
- Throws:
Exception
-
populateRequest
protected void populateRequest(MavenContext context, Lookup lookup, MavenExecutionRequest request) throws Exception - Overrides:
populateRequestin classLookupInvoker<MavenContext>- Throws:
Exception
-
determinePom
-
determineReactorFailureBehaviour
-
determineGlobalChecksumPolicy
-
determineExecutionListener
-
determineTransferListener
protected org.eclipse.aether.transfer.TransferListener determineTransferListener(MavenContext context, boolean noTransferProgress) -
determineMakeBehavior
-
performProjectActivation
-
performProfileActivation
-
doExecute
- Throws:
Exception
-
logBuildResumeHint
-
getResumeFromSelector
protected String getResumeFromSelector(List<MavenProject> mavenProjects, 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, ExceptionSummary summary, Map<String, String> references, String indent)
-