Package org.apache.maven.cli
Class MavenCli
java.lang.Object
org.apache.maven.cli.MavenCli
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private org.codehaus.plexus.classworlds.ClassWorld
private CLIManager
private Map<String,
ConfigurationProcessor> static final File
static final File
private org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher
private static final String
private EventSpyDispatcher
private MavenExecutionRequestPopulator
private static final String
private static final String
private static final Pattern
static final String
private Maven
private ModelProcessor
static final String
private static final String
private static final Pattern
private org.codehaus.plexus.logging.LoggerManager
private org.slf4j.Logger
private org.slf4j.ILoggerFactory
static final String
private ToolchainsBuilder
private static final String
static final String
static final File
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) int
calculateDegreeOfConcurrency
(String threadConfiguration) (package private) void
cli
(CliRequest cliRequest) private org.apache.commons.cli.CommandLine
cliMerge
(org.apache.commons.cli.CommandLine mavenConfig, org.apache.commons.cli.CommandLine mavenCli) private void
commands
(CliRequest cliRequest) private void
configure
(CliRequest cliRequest) (package private) org.codehaus.plexus.PlexusContainer
container
(CliRequest cliRequest) protected static org.codehaus.plexus.interpolation.StringSearchInterpolator
createInterpolator
(CliRequest cliRequest, Properties... properties) protected ModelProcessor
createModelProcessor
(org.codehaus.plexus.PlexusContainer container) protected void
customizeContainer
(org.codehaus.plexus.PlexusContainer container) int
doMain
(String[] args, String workingDirectory, PrintStream stdout, PrintStream stderr) This supports painless invocation by the Verifier during embedded execution of the core ITs.static int
int
doMain
(CliRequest cliRequest) private void
encryption
(CliRequest cliRequest) private int
execute
(CliRequest cliRequest) protected org.eclipse.aether.transfer.TransferListener
private static Path
getCanonicalPath
(Path path) protected org.eclipse.aether.transfer.TransferListener
getConsoleTransferListener
(boolean printResourceNames) private Object
getLocation
(Source source, File defaultLocation) private String
getResumeFrom
(List<MavenProject> mavenProjects, MavenProject failedProject) 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.private void
informativeCommands
(CliRequest cliRequest) (package private) void
initialize
(CliRequest cliRequest) protected boolean
private List<CoreExtensionEntry>
loadCoreExtensions
(CliRequest cliRequest, org.codehaus.plexus.classworlds.realm.ClassRealm containerRealm, Set<String> providedArtifacts) (package private) void
logging
(CliRequest cliRequest) configure loggingprivate void
logSummary
(ExceptionSummary summary, Map<String, String> references, String indent, boolean showErrors) static void
static int
parseExtClasspath
(CliRequest cliRequest) (package private) static void
populateProperties
(CliRequest cliRequest, Properties systemProperties, Properties userProperties) private MavenExecutionRequest
populateRequest
(CliRequest cliRequest) private MavenExecutionRequest
populateRequest
(CliRequest cliRequest, MavenExecutionRequest request) (package private) void
properties
(CliRequest cliRequest) private List<CoreExtension>
readCoreExtensionsDescriptor
(File extensionsFile) private static <T> List<T>
protected Path
private org.codehaus.plexus.classworlds.realm.ClassRealm
setupContainerRealm
(org.codehaus.plexus.classworlds.ClassWorld classWorld, org.codehaus.plexus.classworlds.realm.ClassRealm coreRealm, List<File> extClassPath, List<CoreExtensionEntry> extensions) (package private) void
toolchains
(CliRequest cliRequest) private void
version
(CliRequest cliRequest)
-
Field Details
-
LOCAL_REPO_PROPERTY
- See Also:
-
MULTIMODULE_PROJECT_DIRECTORY
- See Also:
-
USER_HOME
-
USER_MAVEN_CONFIGURATION_HOME
-
DEFAULT_USER_TOOLCHAINS_FILE
-
DEFAULT_GLOBAL_TOOLCHAINS_FILE
-
EXT_CLASS_PATH
- See Also:
-
DOT_MVN
- See Also:
-
UNABLE_TO_FIND_ROOT_PROJECT_MESSAGE
- See Also:
-
EXTENSIONS_FILENAME
- See Also:
-
MVN_MAVEN_CONFIG
- See Also:
-
STYLE_COLOR_PROPERTY
- See Also:
-
classWorld
private org.codehaus.plexus.classworlds.ClassWorld classWorld -
plexusLoggerManager
private org.codehaus.plexus.logging.LoggerManager plexusLoggerManager -
slf4jLoggerFactory
private org.slf4j.ILoggerFactory slf4jLoggerFactory -
slf4jLogger
private org.slf4j.Logger slf4jLogger -
eventSpyDispatcher
-
modelProcessor
-
maven
-
executionRequestPopulator
-
toolchainsBuilder
-
dispatcher
private org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher dispatcher -
configurationProcessors
-
cliManager
-
NEXT_LINE
-
LAST_ANSI_SEQUENCE
-
ANSI_RESET
- See Also:
-
-
Constructor Details
-
MavenCli
public MavenCli() -
MavenCli
public MavenCli(org.codehaus.plexus.classworlds.ClassWorld classWorld)
-
-
Method Details
-
main
-
main
-
doMain
-
doMain
This supports painless invocation by the Verifier during embedded execution of the core ITs. SeeEmbedded3xLauncher
inmaven-verifier
-
doMain
-
initialize
- Throws:
MavenCli.ExitException
-
cli
- Throws:
Exception
-
informativeCommands
- Throws:
MavenCli.ExitException
-
cliMerge
private org.apache.commons.cli.CommandLine cliMerge(org.apache.commons.cli.CommandLine mavenConfig, org.apache.commons.cli.CommandLine mavenCli) -
logging
configure logging -
version
-
commands
-
properties
- Throws:
MavenCli.ExitException
-
container
- Throws:
Exception
-
loadCoreExtensions
private List<CoreExtensionEntry> loadCoreExtensions(CliRequest cliRequest, org.codehaus.plexus.classworlds.realm.ClassRealm containerRealm, Set<String> providedArtifacts) throws Exception - Throws:
Exception
-
readCoreExtensionsDescriptor
private List<CoreExtension> readCoreExtensionsDescriptor(File extensionsFile) throws IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException - Throws:
IOException
org.codehaus.plexus.util.xml.pull.XmlPullParserException
-
setupContainerRealm
private org.codehaus.plexus.classworlds.realm.ClassRealm setupContainerRealm(org.codehaus.plexus.classworlds.ClassWorld classWorld, org.codehaus.plexus.classworlds.realm.ClassRealm coreRealm, List<File> extClassPath, List<CoreExtensionEntry> extensions) throws Exception - Throws:
Exception
-
reverse
-
parseExtClasspath
-
encryption
- Throws:
Exception
-
execute
-
getResumeFrom
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.- Parameters:
mavenProjects
- Maven projects which are part of build execution.failedProject
- 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
private void logSummary(ExceptionSummary summary, Map<String, String> references, String indent, boolean showErrors) -
configure
- Throws:
Exception
-
toolchains
- Throws:
Exception
-
getLocation
-
populateRequest
-
populateRequest
-
calculateDegreeOfConcurrency
-
populateProperties
static void populateProperties(CliRequest cliRequest, Properties systemProperties, Properties userProperties) throws org.codehaus.plexus.interpolation.InterpolationException - Throws:
org.codehaus.plexus.interpolation.InterpolationException
-
isAcceptableRootDirectory
-
searchAcceptableRootDirectory
-
createInterpolator
protected static org.codehaus.plexus.interpolation.StringSearchInterpolator createInterpolator(CliRequest cliRequest, Properties... properties) -
getCanonicalPath
-
getConsoleTransferListener
protected org.eclipse.aether.transfer.TransferListener getConsoleTransferListener(boolean printResourceNames) -
getBatchTransferListener
protected org.eclipse.aether.transfer.TransferListener getBatchTransferListener() -
customizeContainer
protected void customizeContainer(org.codehaus.plexus.PlexusContainer container) -
createModelProcessor
protected ModelProcessor createModelProcessor(org.codehaus.plexus.PlexusContainer container) throws org.codehaus.plexus.component.repository.exception.ComponentLookupException - Throws:
org.codehaus.plexus.component.repository.exception.ComponentLookupException
-