| 123 | return newTool(toolType, runtime); |
| 124 | } |
| 125 | |
| 126 | public static CommandLine parseCmdLine(Tool tool, String[] args) throws IOException { |
| 127 | // the parser doesn't like -D props |
| 128 | List<String> toolArgList = new ArrayList<>(); |
| 129 | List<String> dashDList = new ArrayList<>(); |
| 130 | for (int a = 1; a < args.length; a++) { |
| 131 | String arg = args[a]; |
| 132 | if (!args[a - 1].equals("--jvm-opts") && arg.startsWith("-D")) { |
| 133 | dashDList.add(arg); |
| 134 | } else { |
| 135 | toolArgList.add(arg); |
| 136 | } |
| 137 | } |
| 138 | String[] toolArgs = toolArgList.toArray(new String[0]); |
| 139 | |
| 140 | // process command-line args to configure this application |
| 141 | CommandLine cli = processCommandLineArgs(tool, toolArgs); |
| 142 | |
| 143 | List<String> argList = cli.getArgList(); |
| 144 | argList.addAll(dashDList); |
| 145 | |
| 146 | // for SSL support, try to accommodate relative paths set for SSL store props |
| 147 | String solrInstallDir = EnvUtils.getProperty("solr.install.dir"); |
| 148 | if (solrInstallDir != null) { |
| 149 | checkSslStoreSysProp(solrInstallDir, "keyStore"); |
| 150 | checkSslStoreSysProp(solrInstallDir, "trustStore"); |
| 151 | } |
| 152 | |
| 153 | return cli; |
| 154 | } |
| 155 | |
| 156 | protected static void checkSslStoreSysProp(String solrInstallDir, String key) { |