RunnerAndConfigurationSettings (ConfigurationFactory factory, @NotNull final Module module) { final RunnerAndConfigurationSettings settings = RunManager.getInstance(module.getProject()).createConfiguration(module.getName(), factory); ModuleBasedConfiguration configuration = (ModuleBasedConfiguration) settings.getConfiguration(); configuration.setModule(module); return settings; }