Package org.apache.ivy
Class Main
- java.lang.Object
-
- org.apache.ivy.Main
-
public final class Main extends java.lang.Object
Class 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 int
HELP_WIDTH
-
Constructor Summary
Constructors Modifier Constructor Description private
Main()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
configureURLHandler(java.lang.String realm, java.lang.String host, java.lang.String username, java.lang.String passwd)
private static void
error(java.lang.String msg)
private static java.util.List<java.io.File>
getExtraClasspathFileList(CommandLine line)
Parses thecp
option from the command line, and returns a list ofFile
.(package private) static CommandLineParser
getParser()
private static void
initMessage(CommandLine line, Ivy ivy)
private static IvySettings
initSettings(CommandLine line, Ivy ivy)
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)
static void
main(java.lang.String[] args)
private static void
outputCachePath(Ivy ivy, java.io.File cache, ModuleDescriptor md, java.lang.String[] confs, java.lang.String outFile)
static ResolveReport
run(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 ResolveReport
run(java.lang.String[] args, boolean isCli)
(package private) static void
run(CommandLineParser parser, java.lang.String[] args)
private static ResolveReport
run(CommandLine line, boolean isCli)
private static void
usage(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 thecp
option 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
null
if 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.ParseException
java.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)
-
-