Class DefaultMavenInvoker<O extends MavenOptions,R extends MavenInvokerRequest<O>,C extends DefaultMavenInvoker.MavenContext<O,R,C>>
java.lang.Object
org.apache.maven.cling.invoker.LookupInvoker<O,R,C>
org.apache.maven.cling.invoker.mvn.DefaultMavenInvoker<O,R,C>
- All Implemented Interfaces:
AutoCloseable
,Invoker<R>
,MavenInvoker<R>
- Direct Known Subclasses:
DefaultLocalMavenInvoker
,DefaultResidentMavenInvoker
public abstract class DefaultMavenInvoker<O extends MavenOptions,R extends MavenInvokerRequest<O>,C extends DefaultMavenInvoker.MavenContext<O,R,C>>
extends LookupInvoker<O,R,C>
implements MavenInvoker<R>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
DefaultMavenInvoker.MavenContext<O extends MavenOptions,
R extends MavenInvokerRequest<O>, C extends DefaultMavenInvoker.MavenContext<O, R, C>> Nested classes/interfaces inherited from class org.apache.maven.cling.invoker.LookupInvoker
LookupInvoker.ExitException, LookupInvoker.LookupInvokerContext<O extends Options,
R extends InvokerRequest<O>, C extends LookupInvoker.LookupInvokerContext<O, R, C>> -
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final Pattern
protected static final Pattern
Fields inherited from class org.apache.maven.cling.invoker.LookupInvoker
protoLookup
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
customizeSettingsRequest
(C context, SettingsBuilderRequest settingsBuilderRequest) protected void
customizeSettingsResult
(C context, SettingsBuilderResult settingsBuilderResult) protected ExecutionListener
determineExecutionListener
(C context) protected String
determineGlobalChecksumPolicy
(C context) protected String
determineMakeBehavior
(C context) protected Path
determinePom
(C context) protected String
determineReactorFailureBehaviour
(C context) protected org.eclipse.aether.transfer.TransferListener
determineTransferListener
(C context, boolean noTransferProgress) protected int
protected int
protected String
getResumeFromSelector
(List<MavenProject> mavenProjects, MavenProject firstFailedProject) A helper method to determine the value to resume the build with-rf
taking into account the edge case where multiple modules in the reactor have the same artifactId.protected void
protected void
logBuildResumeHint
(C context, String resumeBuildHint) protected void
logSummary
(C context, ExceptionSummary summary, Map<String, String> references, String indent) protected void
protected void
performProfileActivation
(C context, ProfileActivation profileActivation) protected void
performProjectActivation
(C context, ProjectActivation projectActivation) protected void
populateRequest
(C context, MavenExecutionRequest request) protected void
postCommands
(C context) protected void
protected void
toolchains
(C context) Methods inherited from class org.apache.maven.cling.invoker.LookupInvoker
activateLogging, calculateDegreeOfConcurrency, configureLogging, container, createContainerCapsuleFactory, createContext, createTerminal, determineBuildEventListener, doConfigureWithTerminal, doDetermineBuildEventListener, doInvoke, handleException, helpOrVersionAndMayExit, invoke, isRunningOnCI, localRepositoryPath, mayDisableInteractiveMode, populateRequestFromSettings, preCommands, pushProperties, settings, settings, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.maven.api.cli.mvn.MavenInvoker
invoke
-
Field Details
-
NEXT_LINE
-
LAST_ANSI_SEQUENCE
-
ANSI_RESET
- See Also:
-
-
Constructor Details
-
DefaultMavenInvoker
-
-
Method Details
-
execute
- Specified by:
execute
in classLookupInvoker<O extends MavenOptions,
R extends MavenInvokerRequest<O>, C extends DefaultMavenInvoker.MavenContext<O, R, C>> - Throws:
Exception
-
prepare
- Overrides:
prepare
in classLookupInvoker<O extends MavenOptions,
R extends MavenInvokerRequest<O>, C extends DefaultMavenInvoker.MavenContext<O, R, C>> - Throws:
Exception
-
lookup
- Overrides:
lookup
in classLookupInvoker<O extends MavenOptions,
R extends MavenInvokerRequest<O>, C extends DefaultMavenInvoker.MavenContext<O, R, C>> - Throws:
Exception
-
init
- Overrides:
init
in classLookupInvoker<O extends MavenOptions,
R extends MavenInvokerRequest<O>, C extends DefaultMavenInvoker.MavenContext<O, R, C>> - Throws:
Exception
-
postCommands
- Overrides:
postCommands
in classLookupInvoker<O extends MavenOptions,
R extends MavenInvokerRequest<O>, C extends DefaultMavenInvoker.MavenContext<O, R, C>> - Throws:
Exception
-
customizeSettingsRequest
- Overrides:
customizeSettingsRequest
in classLookupInvoker<O extends MavenOptions,
R extends MavenInvokerRequest<O>, C extends DefaultMavenInvoker.MavenContext<O, R, C>>
-
customizeSettingsResult
protected void customizeSettingsResult(C context, SettingsBuilderResult settingsBuilderResult) throws Exception - Overrides:
customizeSettingsResult
in classLookupInvoker<O extends MavenOptions,
R extends MavenInvokerRequest<O>, C extends DefaultMavenInvoker.MavenContext<O, R, C>> - Throws:
Exception
-
toolchains
- Throws:
Exception
-
populateRequest
- Overrides:
populateRequest
in classLookupInvoker<O extends MavenOptions,
R extends MavenInvokerRequest<O>, C extends DefaultMavenInvoker.MavenContext<O, R, C>> - Throws:
Exception
-
determinePom
-
determineReactorFailureBehaviour
-
determineGlobalChecksumPolicy
-
determineExecutionListener
-
determineTransferListener
protected org.eclipse.aether.transfer.TransferListener determineTransferListener(C context, boolean noTransferProgress) - Overrides:
determineTransferListener
in classLookupInvoker<O extends MavenOptions,
R extends MavenInvokerRequest<O>, C extends DefaultMavenInvoker.MavenContext<O, R, C>>
-
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-rf
taking into account the edge case where multiple modules in the reactor have the same artifactId.-rf :artifactId
will 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:artifactId
when there is a name clash and:artifactId
if 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 (
:artifactId
in general andgroupId:artifactId
when there is a name clash).
-
logSummary
-