summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMatthew Piggott2011-02-02 14:33:32 (EST)
committer Pascal Rapicault2011-02-04 10:25:52 (EST)
commitde59d0180d2613952e422c6d83888a1f08924905 (patch)
treec39e83c43da2319a167951c2019bbfe3300ce7f0
parentbf180876374d55778466bcdd10edcb5a31118827 (diff)
downloadm2e-core-de59d0180d2613952e422c6d83888a1f08924905.zip
m2e-core-de59d0180d2613952e422c6d83888a1f08924905.tar.gz
m2e-core-de59d0180d2613952e422c6d83888a1f08924905.tar.bz2
Bug 335485 - Update configuration of projects with configuration errors after restart
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/UpdateConfigurationAction.java69
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/jobs/UpdateConfigurationJob.java126
-rw-r--r--org.eclipse.m2e.discovery/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.m2e.discovery/plugin.xml5
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/DiscoveryActivator.java39
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryIcons.java4
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/operation/RestartInstallOperation.java38
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/startup/UpdateConfigurationStartup.java134
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenCatalogViewer.java4
9 files changed, 349 insertions, 72 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/UpdateConfigurationAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/UpdateConfigurationAction.java
index fc8277d..b18dea2 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/UpdateConfigurationAction.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/UpdateConfigurationAction.java
@@ -11,39 +11,25 @@
package org.eclipse.m2e.core.actions;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
-import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.progress.IProgressConstants;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenConsole;
import org.eclipse.m2e.core.core.MavenLogger;
-import org.eclipse.m2e.core.internal.Messages;
-import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.util.M2EUtils;
+import org.eclipse.m2e.core.jobs.UpdateConfigurationJob;
public class UpdateConfigurationAction implements IObjectActionDelegate {
@@ -78,58 +64,7 @@ public class UpdateConfigurationAction implements IObjectActionDelegate {
public void run(IAction action) {
final Set<IProject> projects = getProjects();
final MavenPlugin plugin = MavenPlugin.getDefault();
- WorkspaceJob job = new WorkspaceJob(Messages.UpdateSourcesAction_job_update_conf) {
- public IStatus runInWorkspace(IProgressMonitor monitor) {
- setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
- monitor.beginTask(getName(), projects.size());
-
- MavenConsole console = plugin.getConsole();
-
- long l1 = System.currentTimeMillis();
- console.logMessage("Update started");
-
- MultiStatus status = null;
- //project names to the errors encountered when updating them
- Map<String, Throwable> updateErrors = new HashMap<String, Throwable>();
-
- for(IProject project : projects) {
- if(monitor.isCanceled()) {
- throw new OperationCanceledException();
- }
-
- monitor.subTask(project.getName());
- IMavenProjectFacade projectFacade = plugin.getMavenProjectManager().create(project, monitor);
- if(projectFacade != null) {
- try {
- plugin.getProjectConfigurationManager().updateProjectConfiguration(project, //
- new SubProgressMonitor(monitor, 1));
- } catch(CoreException ex) {
- if(status == null) {
- status = new MultiStatus(IMavenConstants.PLUGIN_ID, IStatus.ERROR, //
- Messages.UpdateSourcesAction_error_cannot_update, null);
- }
- status.add(ex.getStatus());
- updateErrors.put(project.getName(), ex);
- } catch(IllegalArgumentException e) {
- status = new MultiStatus(IMavenConstants.PLUGIN_ID, IStatus.ERROR, //
- Messages.UpdateSourcesAction_error_cannot_update, null);
- updateErrors.put(project.getName(), e);
- }
- }
- }
- if(updateErrors.size() > 0) {
- M2EUtils.showErrorsForProjectsDialog(shell, Messages.UpdateSourcesAction_error_title,
- Messages.UpdateSourcesAction_error_message, updateErrors);
- }
- long l2 = System.currentTimeMillis();
- console.logMessage(NLS.bind("Update completed: {0} sec", ((l2 - l1) / 1000)));
-
- return status != null ? status : Status.OK_STATUS;
- }
- };
- // We need to grab workspace lock because IJavaProject.setRawClasspath() needs it.
- job.setRule(plugin.getProjectConfigurationManager().getRule());
- job.schedule();
+ new UpdateConfigurationJob(plugin, projects.toArray(new IProject[projects.size()])).schedule();
}
private Set<IProject> getProjects() {
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/jobs/UpdateConfigurationJob.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/jobs/UpdateConfigurationJob.java
new file mode 100644
index 0000000..b2668ef
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/jobs/UpdateConfigurationJob.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.jobs;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.progress.IProgressConstants;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.OpenMavenConsoleAction;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.util.M2EUtils;
+
+
+public class UpdateConfigurationJob extends WorkspaceJob {
+
+ private IProject[] projects;
+
+ private MavenPlugin plugin;
+
+ private Shell shell;
+
+ public UpdateConfigurationJob(MavenPlugin plugin, IProject[] projects) {
+ this(plugin, projects, null);
+ }
+
+ public UpdateConfigurationJob(MavenPlugin plugin, IProject[] projects, Shell shell) {
+ this(plugin, shell);
+ this.projects = projects;
+ }
+
+ private UpdateConfigurationJob(MavenPlugin plugin, Shell shell) {
+ super(Messages.UpdateSourcesAction_job_update_conf);
+ this.plugin = plugin;
+ this.shell = shell;
+ setRule(this.plugin.getProjectConfigurationManager().getRule());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.WorkspaceJob#runInWorkspace(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
+ monitor.beginTask(getName(), projects.length);
+
+ MavenConsole console = plugin.getConsole();
+
+ long l1 = System.currentTimeMillis();
+ console.logMessage("Update started");
+
+ MultiStatus status = null;
+ //project names to the errors encountered when updating them
+ Map<String, Throwable> updateErrors = new HashMap<String, Throwable>();
+
+ for(IProject project : projects) {
+ if(monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+
+ monitor.subTask(project.getName());
+ IMavenProjectFacade projectFacade = plugin.getMavenProjectManager().create(project, monitor);
+ if(projectFacade != null) {
+ try {
+ plugin.getProjectConfigurationManager().updateProjectConfiguration(project, //
+ new SubProgressMonitor(monitor, 1));
+ } catch(CoreException ex) {
+ if(status == null) {
+ status = new MultiStatus(IMavenConstants.PLUGIN_ID, IStatus.ERROR, //
+ Messages.UpdateSourcesAction_error_cannot_update, null);
+ }
+ status.add(ex.getStatus());
+ updateErrors.put(project.getName(), ex);
+ } catch(IllegalArgumentException e) {
+ status = new MultiStatus(IMavenConstants.PLUGIN_ID, IStatus.ERROR, //
+ Messages.UpdateSourcesAction_error_cannot_update, null);
+ updateErrors.put(project.getName(), e);
+ }
+ }
+ }
+ if(updateErrors.size() > 0) {
+ handleErrors(updateErrors);
+ }
+ long l2 = System.currentTimeMillis();
+ console.logMessage(NLS.bind("Update completed: {0} sec", ((l2 - l1) / 1000)));
+
+ return status != null ? status : Status.OK_STATUS;
+ }
+
+ private void handleErrors(final Map<String, Throwable> updateErrors) {
+ final Display display = Display.getDefault();
+ if(display != null) {
+ display.asyncExec(new Runnable() {
+
+ public void run() {
+ M2EUtils.showErrorsForProjectsDialog(shell != null ? shell : display.getActiveShell(),
+ Messages.UpdateSourcesAction_error_title, Messages.UpdateSourcesAction_error_message, updateErrors);
+ }
+ });
+ }
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.discovery/META-INF/MANIFEST.MF b/org.eclipse.m2e.discovery/META-INF/MANIFEST.MF
index 1378f56..7a8e5a5 100644
--- a/org.eclipse.m2e.discovery/META-INF/MANIFEST.MF
+++ b/org.eclipse.m2e.discovery/META-INF/MANIFEST.MF
@@ -31,3 +31,5 @@ Import-Package: org.apache.maven.model,
org.eclipse.equinox.p2.metadata,
org.eclipse.equinox.p2.repository.metadata,
org.eclipse.equinox.p2.ui
+Bundle-Activator: org.eclipse.m2e.internal.discovery.DiscoveryActivator
+Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.m2e.discovery/plugin.xml b/org.eclipse.m2e.discovery/plugin.xml
index b05b0cb..b0097fc 100644
--- a/org.eclipse.m2e.discovery/plugin.xml
+++ b/org.eclipse.m2e.discovery/plugin.xml
@@ -27,6 +27,11 @@
commandId="org.eclipse.m2e.discovery.ui">
</handler>
</extension>
+ <extension point="org.eclipse.ui.startup">
+ <startup
+ class="org.eclipse.m2e.internal.discovery.startup.UpdateConfigurationStartup">
+ </startup>
+ </extension>
<extension
point="org.eclipse.ui.ide.markerResolution">
<markerResolutionGenerator
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/DiscoveryActivator.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/DiscoveryActivator.java
new file mode 100644
index 0000000..f9a0bb4
--- /dev/null
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/DiscoveryActivator.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.m2e.internal.discovery;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+
+public class DiscoveryActivator extends AbstractUIPlugin {
+
+ // Should match bundle name
+ public static final String PLUGIN_ID = "org.eclipse.m2e.discovery"; //$NON-NLS-1$
+
+ private static DiscoveryActivator plugin;
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ DiscoveryActivator.plugin = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ DiscoveryActivator.plugin = null;
+ }
+
+ public static DiscoveryActivator getDefault() {
+ return plugin;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryIcons.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryIcons.java
index 3519391..ad5f7cc 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryIcons.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryIcons.java
@@ -22,9 +22,7 @@ import org.eclipse.swt.graphics.Image;
public class MavenDiscoveryIcons {
- public static final String PLUGIN_ID = "org.eclipse.m2e.discovery"; //$NON-NLS-1$
-
- private static final URL baseURL = Platform.getBundle(PLUGIN_ID).getEntry("/icons/"); //$NON-NLS-1$
+ private static final URL baseURL = Platform.getBundle(DiscoveryActivator.PLUGIN_ID).getEntry("/icons/"); //$NON-NLS-1$
private static ImageRegistry imageRegistry;
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/operation/RestartInstallOperation.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/operation/RestartInstallOperation.java
index fdd36d5..9df0242 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/operation/RestartInstallOperation.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/operation/RestartInstallOperation.java
@@ -13,11 +13,14 @@ package org.eclipse.m2e.internal.discovery.operation;
import java.util.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.operations.InstallOperation;
import org.eclipse.equinox.p2.operations.ProfileModificationJob;
import org.eclipse.equinox.p2.operations.ProvisioningJob;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
+import org.eclipse.m2e.internal.discovery.startup.UpdateConfigurationStartup;
/*
@@ -27,8 +30,11 @@ public class RestartInstallOperation extends InstallOperation {
private int restartPolicy = ProvisioningJob.RESTART_ONLY;
+ private ProvisioningSession session;
+
public RestartInstallOperation(ProvisioningSession session, Collection<IInstallableUnit> toInstall) {
super(session, toInstall);
+ this.session = session;
}
@Override
@@ -36,6 +42,9 @@ public class RestartInstallOperation extends InstallOperation {
ProvisioningJob job = super.getProvisioningJob(monitor);
if(job != null && job instanceof ProfileModificationJob) {
((ProfileModificationJob) job).setRestartPolicy(restartPolicy);
+ UpdateConfigurationProvisioningJob ucJob = new UpdateConfigurationProvisioningJob(((ProfileModificationJob) job),
+ session);
+ return ucJob;
}
return job;
}
@@ -47,4 +56,33 @@ public class RestartInstallOperation extends InstallOperation {
public void setRestartPolicy(int restartPolicy) {
this.restartPolicy = restartPolicy;
}
+
+ private static class UpdateConfigurationProvisioningJob extends ProfileModificationJob {
+
+ private ProfileModificationJob job;
+
+ public UpdateConfigurationProvisioningJob(ProfileModificationJob job, ProvisioningSession session) {
+ super(job.getName(), session, IProfileRegistry.SELF, null, null);
+ this.job = job;
+ }
+
+ @Override
+ public IStatus runModal(IProgressMonitor monitor) {
+ IStatus status = job.run(monitor);
+ if(status.isOK()) {
+ UpdateConfigurationStartup.enableStartup();
+ }
+ return status;
+ }
+
+ @Override
+ public String getProfileId() {
+ return job.getProfileId();
+ }
+
+ @Override
+ public int getRestartPolicy() {
+ return job.getRestartPolicy();
+ }
+ }
}
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/startup/UpdateConfigurationStartup.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/startup/UpdateConfigurationStartup.java
new file mode 100644
index 0000000..b4601bd
--- /dev/null
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/startup/UpdateConfigurationStartup.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.internal.discovery.startup;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.jobs.UpdateConfigurationJob;
+import org.eclipse.m2e.internal.discovery.DiscoveryActivator;
+import org.eclipse.ui.IStartup;
+import org.eclipse.ui.internal.IPreferenceConstants;
+import org.eclipse.ui.internal.Workbench;
+import org.eclipse.ui.internal.util.PrefUtil;
+
+
+@SuppressWarnings("restriction")
+public class UpdateConfigurationStartup implements IStartup {
+
+ private static final String PROJECT_PREF = DiscoveryActivator.PLUGIN_ID + ".pref.projects"; //$NON-NLS-1$
+
+ public void earlyStartup() {
+ final MavenPlugin plugin = MavenPlugin.getDefault();
+ new UpdateConfigurationJob(plugin, getMarkedProjects()).schedule();
+ disableStartup();
+ }
+
+ /*
+ * Enables the early startup for this bundle
+ */
+ public static void enableStartup() {
+ updateMarkedProjects();
+ String[] disabledEarlyActivation = Workbench.getInstance().getDisabledEarlyActivatedPlugins();
+
+ if(!isDisabled(disabledEarlyActivation)) {
+ return;
+ }
+
+ StringBuffer preference = new StringBuffer();
+ for(String item : disabledEarlyActivation) {
+ if(!DiscoveryActivator.PLUGIN_ID.equals(item)) {
+ preference.append(item).append(IPreferenceConstants.SEPARATOR);
+ }
+ }
+ setPreference(preference.toString());
+ }
+
+ /*
+ * Disables the early startup for this bundle
+ */
+ public static void disableStartup() {
+ clearMarkedProjects();
+ String[] disabledEarlyActivation = Workbench.getInstance().getDisabledEarlyActivatedPlugins();
+
+ // Determine if we're already disabled
+ if(isDisabled(disabledEarlyActivation)) {
+ return;
+ }
+
+ // Add ourself to disabled
+ StringBuffer preference = new StringBuffer();
+ for(String item : disabledEarlyActivation) {
+ preference.append(item).append(IPreferenceConstants.SEPARATOR);
+ }
+ preference.append(DiscoveryActivator.PLUGIN_ID).append(IPreferenceConstants.SEPARATOR);
+ setPreference(preference.toString());
+ }
+
+ private static boolean isDisabled(String[] disabledEarlyActivation) {
+ for(String item : disabledEarlyActivation) {
+ if(DiscoveryActivator.PLUGIN_ID.equals(item)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static void setPreference(String pref) {
+ IPreferenceStore store = PrefUtil.getInternalPreferenceStore();
+ store.putValue(IPreferenceConstants.PLUGINS_NOT_ACTIVATED_ON_STARTUP, pref);
+ PrefUtil.savePrefs();
+ }
+
+ public static IProject[] getMarkedProjects() {
+ String[] projectNames = DiscoveryActivator.getDefault().getPreferenceStore().getString(PROJECT_PREF)
+ .split(String.valueOf(IPreferenceConstants.SEPARATOR));
+ List<IProject> projects = new ArrayList<IProject>(projectNames.length);
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ for(String projectName : projectNames) {
+ if(!projectName.isEmpty()) {
+ IProject project = root.getProject(projectName);
+ if(project != null) {
+ projects.add(project);
+ }
+ }
+ }
+ return projects.toArray(new IProject[projects.size()]);
+ }
+
+ public static void updateMarkedProjects() {
+ StringBuilder sb = new StringBuilder();
+ for(IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
+ try {
+ if(project.findMarkers(IMavenConstants.MARKER_CONFIGURATION_ID, true, IResource.DEPTH_ONE).length > 0) {
+ sb.append(project.getName()).append(IPreferenceConstants.SEPARATOR);
+ }
+ } catch(CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ DiscoveryActivator.getDefault().getPreferenceStore().putValue(PROJECT_PREF, sb.toString());
+ }
+
+ public static void clearMarkedProjects() {
+ DiscoveryActivator.getDefault().getPreferenceStore().putValue(PROJECT_PREF, ""); //$NON-NLS-1$
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenCatalogViewer.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenCatalogViewer.java
index 07c3267..c6d97ba 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenCatalogViewer.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenCatalogViewer.java
@@ -29,8 +29,8 @@ import org.eclipse.m2e.core.internal.lifecycle.LifecycleMappingFactory;
import org.eclipse.m2e.core.internal.lifecycle.model.LifecycleMappingMetadata;
import org.eclipse.m2e.core.internal.lifecycle.model.LifecycleMappingMetadataSource;
import org.eclipse.m2e.core.internal.lifecycle.model.PluginExecutionMetadata;
+import org.eclipse.m2e.internal.discovery.DiscoveryActivator;
import org.eclipse.m2e.internal.discovery.MavenDiscovery;
-import org.eclipse.m2e.internal.discovery.MavenDiscoveryIcons;
import org.eclipse.m2e.internal.discovery.Messages;
import org.eclipse.osgi.util.NLS;
@@ -133,7 +133,7 @@ public class MavenCatalogViewer extends CatalogViewer {
try {
return LifecycleMappingFactory.createLifecycleMappingMetadataSource(getLifecycleMappingMetadataSourceURL(ci));
} catch(Exception e) {
- MavenLogger.log(new Status(IStatus.WARNING, MavenDiscoveryIcons.PLUGIN_ID, NLS.bind(
+ MavenLogger.log(new Status(IStatus.WARNING, DiscoveryActivator.PLUGIN_ID, NLS.bind(
Messages.MavenCatalogViewer_Error_loading_lifecycle,
ci.getId()), e));
return null;