Package org.apache.ivy
Class Main
- java.lang.Object
-
- org.apache.ivy.Main
-
public final class Main extends java.lang.ObjectClass used to launch ivy as a standalone tool.Valid arguments can be obtained with the -? argument.
-
-
Field Summary
Fields Modifier and Type Field Description private static intHELP_WIDTH
-
Constructor Summary
Constructors Modifier Constructor Description privateMain()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidconfigureURLHandler(java.lang.String realm, java.lang.String host, java.lang.String username, java.lang.String passwd)private static voiderror(java.lang.String msg)private static java.util.List<java.io.File>getExtraClasspathFileList(CommandLine line)Parses thecpoption from the command line, and returns a list ofFile.(package private) static CommandLineParsergetParser()private static voidinitMessage(CommandLine line, Ivy ivy)private static IvySettingsinitSettings(CommandLine line, Ivy ivy)private static voidinvoke(Ivy ivy, java.io.File cache, ModuleDescriptor md, java.lang.String[] confs, java.util.List<java.io.File> fileList, java.lang.String mainclass, java.lang.String[] args)static voidmain(java.lang.String[] args)private static voidoutputCachePath(Ivy ivy, java.io.File cache, ModuleDescriptor md, java.lang.String[] confs, java.lang.String outFile)static ResolveReportrun(java.lang.String[] args)A method that allows to run embedded Ivy as if it were launched from CLI (e.g., for use with REPL in Java 9+).private static ResolveReportrun(java.lang.String[] args, boolean isCli)(package private) static voidrun(CommandLineParser parser, java.lang.String[] args)private static ResolveReportrun(CommandLine line, boolean isCli)private static voidusage(CommandLineParser parser, boolean showDeprecated)
-
-
-
Field Detail
-
HELP_WIDTH
private static final int HELP_WIDTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getParser
static CommandLineParser getParser()
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
run
public static ResolveReport run(java.lang.String[] args) throws java.lang.Exception
A method that allows to run embedded Ivy as if it were launched from CLI (e.g., for use with REPL in Java 9+).- Parameters:
args- an array of command line arguments- Returns:
- null if asked for usage or version, or if anything fails during resolve, publish or launch; a ResolveReport on success
- Throws:
java.lang.Exception- if something goes wrong
-
run
static void run(CommandLineParser parser, java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
run
private static ResolveReport run(java.lang.String[] args, boolean isCli) throws java.lang.Exception
- Throws:
java.lang.Exception
-
run
private static ResolveReport run(CommandLine line, boolean isCli) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getExtraClasspathFileList
private static java.util.List<java.io.File> getExtraClasspathFileList(CommandLine line)
Parses thecpoption from the command line, and returns a list ofFile.All the files contained in the returned List exist, non existing files are simply skipped with a warning.
- Parameters:
line- the command line in which the cp option should be parsed- Returns:
- a List of files to include as extra classpath entries, or
nullif no cp option was provided.
-
initSettings
private static IvySettings initSettings(CommandLine line, Ivy ivy) throws java.text.ParseException, java.io.IOException, ParseException
- Throws:
java.text.ParseExceptionjava.io.IOException
-
initMessage
private static void initMessage(CommandLine line, Ivy ivy)
-
outputCachePath
private static void outputCachePath(Ivy ivy, java.io.File cache, ModuleDescriptor md, java.lang.String[] confs, java.lang.String outFile)
-
invoke
private static void invoke(Ivy ivy, java.io.File cache, ModuleDescriptor md, java.lang.String[] confs, java.util.List<java.io.File> fileList, java.lang.String mainclass, java.lang.String[] args)
-
configureURLHandler
private static void configureURLHandler(java.lang.String realm, java.lang.String host, java.lang.String username, java.lang.String passwd)
-
error
private static void error(java.lang.String msg) throws ParseException- Throws:
ParseException
-
usage
private static void usage(CommandLineParser parser, boolean showDeprecated)
-
-