protected SimpleJavaParameters createJavaParameters() {
    if (!myDistribution.isValid()) {
      MavenLog.LOG.warn("Maven Distribution " + myDistribution + " is not valid");
      throw new IllegalArgumentException("Maven distribution at " + myDistribution.getMavenHome().toAbsolutePath() + " is not valid");
    }

    final SimpleJavaParameters params = new SimpleJavaParameters();

    params.setJdk(myJdk);

    params.setWorkingDirectory(getWorkingDirectory());


    Map<String, String> defs = new HashMap<>(getMavenOpts());

    configureSslRelatedOptions(defs);

    defs.put("java.awt.headless", "true");
    for (Map.Entry<String, String> each : defs.entrySet()) {
      params.getVMParametersList().defineProperty(each.getKey(), each.getValue());
    }

    params.getVMParametersList().addProperty("maven.defaultProjectBuilder.disableGlobalModelCache", "true");

    if (myDebugPort != null) {
      params.getVMParametersList().addParametersString("-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=*:" + myDebugPort);
      params.getProgramParametersList().add("runWithDebugger");
    }

    params.getVMParametersList().addProperty("maven.defaultProjectBuilder.disableGlobalModelCache", "true");
    if (Registry.is("maven.collect.local.stat")) {
      params.getVMParametersList().addProperty("maven.collect.local.stat", "true");
    }

    String profilerOption = getProfilerVMString();
    if (profilerOption != null) {
      params.getVMParametersList()
        .addParametersString(profilerOption);
    }

    String xmxProperty = null;
    String xmsProperty = null;

    if (myVmOptions != null) {
      ParametersList mavenOptsList = new ParametersList();
      mavenOptsList.addParametersString(myVmOptions);

      for (String param : mavenOptsList.getParameters()) {
        if (param.startsWith("-Xmx")) {
          xmxProperty = param;
          continue;
        }
        if (param.startsWith("-Xms")) {
          xmsProperty = param;
          continue;
        }
        if (Registry.is("maven.server.vm.remove.javaagent") && param.startsWith("-javaagent")) {
          continue;
        }
        params.getVMParametersList().add(param);
      }
    }
    params.getVMParametersList().add("-Didea.version=" + MavenUtil.getIdeaVersionToPassToMavenProcess());


    params.getVMParametersList().addProperty(MavenServerEmbedder.MAVEN_EMBEDDER_VERSION, myDistribution.getVersion());

    MavenVersionAwareSupportExtension extension = MavenVersionSupportUtil.getExtensionFor(myDistribution);
    setupMainClass(params, extension);
    checkExtension(extension);
    assert extension != null; //checked in the method above, need to make static analyzer happy
    params.getClassPath().addAllFiles(extension.collectClassPathAndLibsFolder(myDistribution));

    params.getVMParametersList().addAll(extension.getAdditionalVmParameters());


    Collection<String> classPath = collectRTLibraries(myDistribution.getVersion());
    for (String s : classPath) {
      params.getClassPath().add(s);
    }

    String embedderXmx = System.getProperty("idea.maven.embedder.xmx");
    if (embedderXmx != null) {
      xmxProperty = "-Xmx" + embedderXmx;
    }
    else {
      if (xmxProperty == null) {
        xmxProperty = getMaxXmxStringValue("-Xmx768m", xmsProperty);
      }
    }
    params.getVMParametersList().add(xmsProperty);
    params.getVMParametersList().add(xmxProperty);


    String mavenEmbedderParameters = System.getProperty("idea.maven.embedder.parameters");
    if (mavenEmbedderParameters != null) {
      params.getProgramParametersList().addParametersString(mavenEmbedderParameters);
    }

    String mavenEmbedderCliOptions = System.getProperty(MavenServerEmbedder.MAVEN_EMBEDDER_CLI_ADDITIONAL_ARGS);
    if (mavenEmbedderCliOptions != null) {
      params.getVMParametersList().addProperty(MavenServerEmbedder.MAVEN_EMBEDDER_CLI_ADDITIONAL_ARGS, mavenEmbedderCliOptions);
    }

    setupMainExt(params);
    return params;
  }
protected SimpleJavaParameters createJavaParameters()