public IStatus configure(IProgressMonitor monitor) {
try {
MavenRuntimeManager runtimeManager = MavenPlugin.getMavenRuntimeManager();
String path = location.getCanonicalPath();
MavenRuntime runtime = runtimeManager.getRuntime(path);
// Get the existing default runtime in case we need to revert later
oldDefaultRuntime = runtimeManager.getDefaultRuntime();
// If a runtime at the given path already exists make it the default
if (runtime != null && runtime.isAvailable()) {
if (!runtime.equals(oldDefaultRuntime)) {
runtimeManager.setDefaultRuntime(runtime);
}
setConfigured(true);
return new Status(IStatus.INFO, MavenCorePlugin.PLUGIN_ID, NLS.bind("Maven already configured at {0}", path));
}