mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-85101 (Provide a "Project JDK" option for the maven runner's JRE option)
This commit is contained in:
+1
-10
@@ -38,7 +38,7 @@ public class MavenRunnerSettings implements Cloneable {
|
||||
@NonNls public static final String USE_JAVA_HOME = "#JAVA_HOME";
|
||||
|
||||
private boolean runMavenInBackground = true;
|
||||
@NotNull private String jreName = "";
|
||||
@NotNull private String jreName = USE_PROJECT_JDK;
|
||||
@NotNull private String vmOptions = "";
|
||||
private boolean skipTests = false;
|
||||
private Map<String, String> mavenProperties = new LinkedHashMap<String, String>();
|
||||
@@ -55,9 +55,6 @@ public class MavenRunnerSettings implements Cloneable {
|
||||
|
||||
@NotNull
|
||||
public String getJreName() {
|
||||
if (StringUtil.isEmpty(jreName)) {
|
||||
jreName = getDefaultJdkName();
|
||||
}
|
||||
return jreName;
|
||||
}
|
||||
|
||||
@@ -96,12 +93,6 @@ public class MavenRunnerSettings implements Cloneable {
|
||||
this.mavenProperties = mavenProperties;
|
||||
}
|
||||
|
||||
public String getDefaultJdkName() {
|
||||
Sdk recent = ProjectJdkTable.getInstance().findMostRecentSdkOfType(JavaSdk.getInstance());
|
||||
if (recent == null) return USE_INTERNAL_JAVA;
|
||||
return recent.getName();
|
||||
}
|
||||
|
||||
public void addListener(Listener l) {
|
||||
myListeners.add(l);
|
||||
}
|
||||
|
||||
+13
-6
@@ -15,15 +15,14 @@
|
||||
*/
|
||||
package org.jetbrains.idea.maven.wizards;
|
||||
|
||||
import com.intellij.ide.util.projectWizard.ModuleBuilder;
|
||||
import com.intellij.ide.util.projectWizard.ModuleWizardStep;
|
||||
import com.intellij.ide.util.projectWizard.SourcePathsBuilder;
|
||||
import com.intellij.ide.util.projectWizard.WizardContext;
|
||||
import com.intellij.ide.util.projectWizard.*;
|
||||
import com.intellij.openapi.module.ModuleType;
|
||||
import com.intellij.openapi.module.StdModuleTypes;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.project.DumbAwareRunnable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.JavaSdk;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.roots.ModifiableRootModel;
|
||||
import com.intellij.openapi.roots.ui.configuration.ModulesProvider;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
@@ -104,10 +103,18 @@ public class MavenModuleBuilder extends ModuleBuilder implements SourcePathsBuil
|
||||
return StdModuleTypes.JAVA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSuitableSdk(Sdk sdk) {
|
||||
return sdk.getSdkType() == JavaSdk.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModuleWizardStep[] createWizardSteps(WizardContext wizardContext, ModulesProvider modulesProvider) {
|
||||
return new ModuleWizardStep[]{new MavenModuleWizardStep(wizardContext.getProject(), this),
|
||||
new SelectPropertiesStep(wizardContext.getProject(), this)};
|
||||
return new ModuleWizardStep[]{
|
||||
new MavenModuleWizardStep(wizardContext.getProject(), this),
|
||||
new SelectPropertiesStep(wizardContext.getProject(), this),
|
||||
ProjectWizardStepFactory.getInstance().createProjectJdkStep(wizardContext)
|
||||
};
|
||||
}
|
||||
|
||||
public MavenProject findPotentialParentProject(Project project) {
|
||||
|
||||
Reference in New Issue
Block a user