Class MavenInvoker<C extends MavenContext>
java.lang.Object
org.apache.maven.cling.invoker.LookupInvoker<C>
org.apache.maven.cling.invoker.mvn.MavenInvoker<C>
- Type Parameters:
C- The context type.
- All Implemented Interfaces:
AutoCloseable,Invoker
- Direct Known Subclasses:
LocalMavenInvoker,ResidentMavenInvoker
The "local" 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
protoLookup -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcustomizeSettingsRequest(C context, org.apache.maven.api.services.SettingsBuilderRequest settingsBuilderRequest) protected voidcustomizeSettingsResult(C context, org.apache.maven.api.services.SettingsBuilderResult settingsBuilderResult) protected ExecutionListenerdetermineExecutionListener(C context) protected StringdetermineGlobalChecksumPolicy(C context) protected StringdetermineMakeBehavior(C context) protected PathdeterminePom(C context, org.apache.maven.api.services.Lookup lookup) protected StringdetermineReactorFailureBehaviour(C context) protected org.eclipse.aether.transfer.TransferListenerdetermineTransferListener(C context, boolean noTransferProgress) protected intdoExecute(C context, MavenExecutionRequest request) protected intprotected 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 voidprotected voidlogBuildResumeHint(C context, String resumeBuildHint) protected voidlogSummary(C context, ExceptionSummary summary, Map<String, String> references, String indent) protected voidprotected voidperformProfileActivation(C context, ProfileActivation profileActivation) protected voidperformProjectActivation(C context, ProjectActivation projectActivation) protected voidpopulateRequest(C context, org.apache.maven.api.services.Lookup lookup, MavenExecutionRequest request) protected voidpostCommands(C context) protected MavenExecutionRequestprotected voidtoolchains(C context, MavenExecutionRequest request) Methods inherited from class org.apache.maven.cling.invoker.LookupInvoker
activateLogging, calculateDegreeOfConcurrency, configureLogging, container, createContainerCapsuleFactory, createContext, createTerminal, describe, determineBuildEventListener, determineWriter, doConfigureWithTerminal, doDetermineBuildEventListener, doDetermineWriter, doInvoke, handleException, helpOrVersionAndMayExit, invoke, isRunningOnCI, localRepositoryPath, mayDisableInteractiveMode, populateRequestFromSettings, postContainer, preCommands, prepare, pushCoreProperties, pushUserProperties, settings, settings, showVersion, validate
-
Field Details
-
NEXT_LINE
-
LAST_ANSI_SEQUENCE
-
ANSI_RESET
- See Also:
-
-
Constructor Details
-
MavenInvoker
-
-
Method Details
-
execute
- Specified by:
executein classLookupInvoker<C extends MavenContext>- Throws:
Exception
-
prepareMavenExecutionRequest
- Throws:
Exception
-
lookup
- Overrides:
lookupin classLookupInvoker<C extends MavenContext>- Throws:
Exception
-
init
- Overrides:
initin classLookupInvoker<C extends MavenContext>- Throws:
Exception
-
postCommands
- Overrides:
postCommandsin classLookupInvoker<C extends MavenContext>- Throws:
Exception
-
customizeSettingsRequest
protected void customizeSettingsRequest(C context, org.apache.maven.api.services.SettingsBuilderRequest settingsBuilderRequest) throws Exception - Overrides:
customizeSettingsRequestin classLookupInvoker<C extends MavenContext>- Throws:
Exception
-
customizeSettingsResult
protected void customizeSettingsResult(C context, org.apache.maven.api.services.SettingsBuilderResult settingsBuilderResult) throws Exception - Overrides:
customizeSettingsResultin classLookupInvoker<C extends MavenContext>- Throws:
Exception
-
toolchains
- Throws:
Exception
-
populateRequest
protected void populateRequest(C context, org.apache.maven.api.services.Lookup lookup, MavenExecutionRequest request) throws Exception - Overrides:
populateRequestin classLookupInvoker<C extends MavenContext>- Throws:
Exception
-
determinePom
-
determineReactorFailureBehaviour
-
determineGlobalChecksumPolicy
-
determineExecutionListener
-
determineTransferListener
protected org.eclipse.aether.transfer.TransferListener determineTransferListener(C 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
-