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 Stringprivate org.codehaus.plexus.classworlds.ClassWorldprivate CLIManagerprivate Map<String, ConfigurationProcessor> static final Filestatic final Fileprivate org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcherprivate static final Stringprivate EventSpyDispatcherprivate MavenExecutionRequestPopulatorprivate static final Stringprivate static final Stringprivate static final Patternstatic final Stringprivate Mavenprivate ModelProcessorstatic final Stringprivate static final Stringprivate static final Patternprivate org.codehaus.plexus.logging.LoggerManagerprivate org.slf4j.Loggerprivate org.slf4j.ILoggerFactorystatic final Stringprivate ToolchainsBuilderprivate static final Stringstatic final Stringstatic final File -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) intcalculateDegreeOfConcurrency(String threadConfiguration) (package private) voidcli(CliRequest cliRequest) private org.apache.commons.cli.CommandLinecliMerge(org.apache.commons.cli.CommandLine mavenConfig, org.apache.commons.cli.CommandLine mavenCli) private voidcommands(CliRequest cliRequest) private voidconfigure(CliRequest cliRequest) (package private) org.codehaus.plexus.PlexusContainercontainer(CliRequest cliRequest) protected static org.codehaus.plexus.interpolation.StringSearchInterpolatorcreateInterpolator(CliRequest cliRequest, Properties... properties) protected ModelProcessorcreateModelProcessor(org.codehaus.plexus.PlexusContainer container) protected voidcustomizeContainer(org.codehaus.plexus.PlexusContainer container) intdoMain(String[] args, String workingDirectory, PrintStream stdout, PrintStream stderr) This supports painless invocation by the Verifier during embedded execution of the core ITs.static intintdoMain(CliRequest cliRequest) private voidencryption(CliRequest cliRequest) private intexecute(CliRequest cliRequest) protected org.eclipse.aether.transfer.TransferListenerprivate static PathgetCanonicalPath(Path path) protected org.eclipse.aether.transfer.TransferListenergetConsoleTransferListener(boolean printResourceNames) private ObjectgetLocation(Source source, File defaultLocation) private StringgetResumeFrom(List<MavenProject> mavenProjects, MavenProject failedProject) 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.private voidinformativeCommands(CliRequest cliRequest) (package private) voidinitialize(CliRequest cliRequest) protected booleanprivate List<CoreExtensionEntry> loadCoreExtensions(CliRequest cliRequest, org.codehaus.plexus.classworlds.realm.ClassRealm containerRealm, Set<String> providedArtifacts) (package private) voidlogging(CliRequest cliRequest) configure loggingprivate voidlogSummary(ExceptionSummary summary, Map<String, String> references, String indent, boolean showErrors) static voidstatic intparseExtClasspath(CliRequest cliRequest) (package private) static voidpopulateProperties(CliRequest cliRequest, Properties systemProperties, Properties userProperties) private MavenExecutionRequestpopulateRequest(CliRequest cliRequest) private MavenExecutionRequestpopulateRequest(CliRequest cliRequest, MavenExecutionRequest request) (package private) voidproperties(CliRequest cliRequest) private List<CoreExtension> readCoreExtensionsDescriptor(File extensionsFile) private static <T> List<T> protected Pathprivate org.codehaus.plexus.classworlds.realm.ClassRealmsetupContainerRealm(org.codehaus.plexus.classworlds.ClassWorld classWorld, org.codehaus.plexus.classworlds.realm.ClassRealm coreRealm, List<File> extClassPath, List<CoreExtensionEntry> extensions) private static String(package private) voidtoolchains(CliRequest cliRequest) private voidversion(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. SeeEmbedded3xLauncherinmaven-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:
IOExceptionorg.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-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.- 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 (
:artifactIdin general andgroupId:artifactIdwhen 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) -
stripLeadingAndTrailingQuotes
-
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
-