Class 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()  
    • Constructor Detail

      • Main

        private Main()
    • Method Detail

      • 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 the cp option from the command line, and returns a list of File.

        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)
      • usage

        private static void usage​(CommandLineParser parser,
                                  boolean showDeprecated)