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 String
protected static final Pattern
protected static final Pattern
Fields inherited from class org.apache.maven.cling.invoker.LookupInvoker
contextConsumer, protoLookup
-
Constructor Summary
ConstructorsConstructorDescriptionMavenInvoker
(Lookup protoLookup) MavenInvoker
(Lookup protoLookup, Consumer<LookupContext> contextConsumer) -
Method Summary
Modifier and TypeMethodDescriptionprotected MavenContext
createContext
(InvokerRequest invokerRequest) protected ExecutionListener
determineExecutionListener
(MavenContext context) protected String
protected String
determineMakeBehavior
(MavenContext context) protected Path
determinePom
(MavenContext context, Lookup lookup) protected String
protected org.eclipse.aether.transfer.TransferListener
determineTransferListener
(MavenContext context, boolean noTransferProgress) protected int
doExecute
(MavenContext context, MavenExecutionRequest request) protected int
execute
(MavenContext context) 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
logBuildResumeHint
(MavenContext context, String resumeBuildHint) protected void
logSummary
(MavenContext context, ExceptionSummary summary, Map<String, String> references, String indent) protected void
lookup
(MavenContext context) protected void
performProfileActivation
(MavenContext context, ProfileActivation profileActivation) protected void
performProjectActivation
(MavenContext context, ProjectActivation projectActivation) protected void
populateRequest
(MavenContext context, Lookup lookup, MavenExecutionRequest request) protected void
postCommands
(MavenContext context) protected MavenExecutionRequest
protected void
toolchains
(MavenContext context, MavenExecutionRequest request) Methods inherited from class org.apache.maven.cling.invoker.LookupInvoker
activateLogging, calculateDegreeOfConcurrency, configureLogging, container, createContainerCapsuleFactory, createTerminal, customizeSettingsRequest, customizeSettingsResult, describe, determineBuildEventListener, determineWriter, doConfigureWithTerminal, doConfigureWithTerminalWithRawStreamsDisabled, doConfigureWithTerminalWithRawStreamsEnabled, doCreateTerminal, doDetermineBuildEventListener, doDetermineWriter, doInvoke, handleException, helpOrVersionAndMayExit, init, invoke, isRunningOnCI, 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
-
MavenInvoker
-
-
Method Details
-
createContext
- Specified by:
createContext
in classLookupInvoker<MavenContext>
-
execute
- Specified by:
execute
in classLookupInvoker<MavenContext>
- Throws:
Exception
-
prepareMavenExecutionRequest
- Throws:
Exception
-
lookup
- Overrides:
lookup
in classLookupInvoker<MavenContext>
- Throws:
Exception
-
postCommands
- Overrides:
postCommands
in classLookupInvoker<MavenContext>
- Throws:
Exception
-
toolchains
- Throws:
Exception
-
populateRequest
protected void populateRequest(MavenContext context, Lookup lookup, MavenExecutionRequest request) throws Exception - Overrides:
populateRequest
in 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-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
protected void logSummary(MavenContext context, ExceptionSummary summary, Map<String, String> references, String indent)
-