private static List<String> createCommandLine(
      CompileContext context,
      ModuleChunk chunk,
      List<File> srcFiles,
      String mainOutputDir,
      @Nullable ProcessorConfigProfile profile,
      GreclipseSettings settings) {
    final List<String> args = new ArrayList<String>();

    args.add("-cp");
    args.add(getClasspathString(chunk));

    JavaBuilder.addCompilationOptions(args, context, chunk, profile);

    args.add("-d");
    args.add(mainOutputDir);

    // todo AjCompilerSettings exact duplicate, JavaBuilder.loadCommonJavacOptions inexact duplicate
    List<String> params = ParametersListUtil.parse(settings.cmdLineParams);
    for (Iterator<String> iterator = params.iterator(); iterator.hasNext(); ) {
      String option = iterator.next();
      if ("-target".equals(option)) {
        iterator.next();
        continue;
      } else if (option.isEmpty() || "-g".equals(option) || "-verbose".equals(option)) {
        continue;
      }
      args.add(option);
    }

    if (settings.debugInfo) {
      args.add("-g");
    }

    for (File file : srcFiles) {
      args.add(file.getPath());
    }

    return args;
  }
  @NotNull
  private static Map<String, String> getMavenOptsProperties() {
    Map<String, String> res = ourPropertiesFromMvnOpts;
    if (res == null) {
      String mavenOpts = System.getenv("MAVEN_OPTS");
      if (mavenOpts != null) {
        res = new HashMap<String, String>();
        final String[] split = ParametersListUtil.parseToArray(mavenOpts);
        for (String parameter : split) {
          final Matcher matcher = PROPERTY_PATTERN.matcher(parameter);
          if (matcher.matches()) {
            res.put(matcher.group(1), matcher.group(2));
          }
        }
      } else {
        res = Collections.emptyMap();
      }

      ourPropertiesFromMvnOpts = res;
    }

    return res;
  }
 /** @see ParametersListUtil#parseToArray(String) */
 @NotNull
 public static String[] parse(@NotNull final String string) {
   return ParametersListUtil.parseToArray(string);
 }
 /** @see ParametersListUtil#join(java.util.List) */
 @NotNull
 public static String join(final String... parameters) {
   return ParametersListUtil.join(parameters);
 }
 /** @see ParametersListUtil#join(java.util.List) */
 @NotNull
 public static String join(@NotNull final List<String> parameters) {
   return ParametersListUtil.join(parameters);
 }
 private static List<String> parseCmdParameters(@Nullable String cmdArgsLine) {
   return cmdArgsLine != null
       ? ParametersListUtil.parse(cmdArgsLine)
       : ContainerUtil.<String>newArrayList();
 }