void () { MavenWorkspaceSettingsComponent settingsComponent = MavenWorkspaceSettingsComponent.getInstance(myProject); String vmOptions = settingsComponent.getSettings().getImportingSettings().getVmOptionsForImporter(); try { MavenServerConnector connector = MavenServerManager.getInstance().getConnector(myProject, myProjectRoot.getPath()); ensureConnected(connector); settingsComponent.getSettings().getImportingSettings().setVmOptionsForImporter(vmOptions + " -DtestVm=test"); assertNotSame(connector, ensureConnected(MavenServerManager.getInstance().getConnector(myProject, myProjectRoot.getPath()))); } finally { settingsComponent.getSettings().getImportingSettings().setVmOptionsForImporter(vmOptions); } }