SimpleJavaParameters () { 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 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()); setupMainClass(params, myDistribution.getVersion()); params.getVMParametersList().addProperty(MavenServerEmbedder.MAVEN_EMBEDDER_VERSION, myDistribution.getVersion()); params.getClassPath().addAllFiles(collectClassPathAndLibsFolder(myDistribution)); 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; }