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
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, Lookup lookup) protected String
determineReactorFailureBehaviour
(C context) protected org.eclipse.aether.transfer.TransferListener
determineTransferListener
(C context, boolean noTransferProgress) protected int
doExecute
(C context, MavenExecutionRequest request) 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, Lookup lookup, MavenExecutionRequest request) protected void
postCommands
(C context) protected MavenExecutionRequest
protected void
toolchains
(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:
execute
in classLookupInvoker<C extends MavenContext>
- Throws:
Exception
-
prepareMavenExecutionRequest
- Throws:
Exception
-
lookup
- Overrides:
lookup
in classLookupInvoker<C extends MavenContext>
- Throws:
Exception
-
init
- Overrides:
init
in classLookupInvoker<C extends MavenContext>
- Throws:
Exception
-
postCommands
- Overrides:
postCommands
in classLookupInvoker<C extends MavenContext>
- Throws:
Exception
-
customizeSettingsRequest
protected void customizeSettingsRequest(C context, SettingsBuilderRequest settingsBuilderRequest) throws Exception - Overrides:
customizeSettingsRequest
in classLookupInvoker<C extends MavenContext>
- Throws:
Exception
-
customizeSettingsResult
protected void customizeSettingsResult(C context, SettingsBuilderResult settingsBuilderResult) throws Exception - Overrides:
customizeSettingsResult
in classLookupInvoker<C extends MavenContext>
- Throws:
Exception
-
toolchains
- Throws:
Exception
-
populateRequest
protected void populateRequest(C context, Lookup lookup, MavenExecutionRequest request) throws Exception - Overrides:
populateRequest
in 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-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
-