Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/M2EUIPluginActivator.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java6
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/UpdateConfigurationJob.java33
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddDependencyAction.java42
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java16
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java12
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java39
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenUrlAction.java35
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/RefreshMavenModelsAction.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateConfigurationAction.java20
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenGoalSelectionDialog.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java5
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java11
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java5
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java58
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ParentGatherer.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java6
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java26
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileWizard.java20
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java44
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizard.java24
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java61
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java16
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenNature.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseRepositoryListener.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java15
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ArtifactKeyAdapterFactory.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenProjectFacade.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractLifecycleMapping.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MojoExecutionBuildParticipant.java2
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java3
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/startup/UpdateConfigurationStartup.java6
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentAssistProcessor.java2
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java3
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java6
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java2
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java2
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java10
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java4
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java2
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java2
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java4
-rw-r--r--org.eclipse.m2e.integration.tests.common/src/org/eclipse/m2e/integration/tests/common/UIIntegrationTestCase.java16
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java2
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java4
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java4
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java5
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java2
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java4
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java2
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenRuntimeClasspathProvider.java2
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/filter/MavenModuleFilter.java2
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java2
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java2
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java2
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java6
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java2
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java9
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java11
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java6
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java2
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java10
-rw-r--r--org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java14
-rw-r--r--org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractMavenProjectTestCase.java29
-rw-r--r--org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/MavenHelpers.java4
83 files changed, 372 insertions, 386 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/M2EUIPluginActivator.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/M2EUIPluginActivator.java
index 88f286e7..6f5c3646 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/M2EUIPluginActivator.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/M2EUIPluginActivator.java
@@ -102,7 +102,7 @@ public class M2EUIPluginActivator extends AbstractUIPlugin {
}
public SearchEngine getSearchEngine(IProject project) throws CoreException {
- return new IndexSearchEngine(MavenPlugin.getDefault().getIndexManager().getIndex(project));
+ return new IndexSearchEngine(MavenPlugin.getIndexManager().getIndex(project));
}
@SuppressWarnings({"rawtypes", "unchecked"})
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java
index be03a7cb..19ace897 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java
@@ -47,7 +47,7 @@ public class MavenVersionDecorator implements ILabelDecorator {
IResource resource = (IResource) element;
IProject project = resource.getProject();
if(project!=null) {
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade facade = projectManager.create(project, new NullProgressMonitor());
if(facade!=null) {
ArtifactKey mavenProject = facade.getArtifactKey();
@@ -92,14 +92,14 @@ public class MavenVersionDecorator implements ILabelDecorator {
listeners.put(listener, projectChangeListener);
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
projectManager.addMavenProjectChangedListener(projectChangeListener);
}
public void removeListener(ILabelProviderListener listener) {
IMavenProjectChangedListener projectChangeListener = listeners.get(listener);
if(projectChangeListener!=null) {
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
projectManager.removeMavenProjectChangedListener(projectChangeListener);
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/UpdateConfigurationJob.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/UpdateConfigurationJob.java
index 49c1a449..98f29189 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/UpdateConfigurationJob.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/UpdateConfigurationJob.java
@@ -14,6 +14,9 @@ package org.eclipse.m2e.core.ui.internal;
import java.util.HashMap;
import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
@@ -23,17 +26,16 @@ 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.core.IMavenConstants;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.ui.internal.actions.OpenMavenConsoleAction;
import org.eclipse.m2e.core.ui.internal.util.M2EUIUtils;
-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.slf4j.Logger;
-import org.slf4j.LoggerFactory;
public class UpdateConfigurationJob extends WorkspaceJob {
@@ -41,24 +43,21 @@ 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(IProject[] projects) {
+ this(projects, null);
}
- public UpdateConfigurationJob(MavenPlugin plugin, IProject[] projects, Shell shell) {
- this(plugin, shell);
+ public UpdateConfigurationJob(IProject[] projects, Shell shell) {
+ this(shell);
this.projects = projects;
}
- private UpdateConfigurationJob(MavenPlugin plugin, Shell shell) {
+ private UpdateConfigurationJob(Shell shell) {
super(Messages.UpdateSourcesAction_job_update_conf);
- this.plugin = plugin;
this.shell = shell;
- setRule(this.plugin.getProjectConfigurationManager().getRule());
+ setRule(MavenPlugin.getProjectConfigurationManager().getRule());
}
/* (non-Javadoc)
@@ -81,10 +80,10 @@ public class UpdateConfigurationJob extends WorkspaceJob {
}
monitor.subTask(project.getName());
- IMavenProjectFacade projectFacade = plugin.getMavenProjectRegistry().create(project, monitor);
+ IMavenProjectFacade projectFacade = MavenPlugin.getMavenProjectRegistry().create(project, monitor);
if(projectFacade != null) {
try {
- plugin.getProjectConfigurationManager().updateProjectConfiguration(project, //
+ MavenPlugin.getProjectConfigurationManager().updateProjectConfiguration(project, //
new SubProgressMonitor(monitor, 1));
} catch(CoreException ex) {
if(status == null) {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddDependencyAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddDependencyAction.java
index a7924e52..9225b81a 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddDependencyAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddDependencyAction.java
@@ -11,31 +11,48 @@
package org.eclipse.m2e.core.ui.internal.actions;
-import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.*;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.ARTIFACT_ID;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.CLASSIFIER;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.DEPENDENCIES;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.DEPENDENCY;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.GROUP_ID;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.SCOPE;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.TYPE;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.VERSION;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.childEquals;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.findChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.getChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.performOnDOMDocument;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.setText;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.project.MavenProject;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+import org.apache.maven.model.Dependency;
+import org.apache.maven.project.MavenProject;
+
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.index.IndexedArtifactFile;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.ui.internal.dialogs.MavenRepositorySearchDialog;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.OperationTuple;
import org.eclipse.m2e.core.ui.internal.editing.PomHelper;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
public class AddDependencyAction extends MavenActionSupport implements IWorkbenchWindowActionDelegate {
@@ -50,11 +67,10 @@ public class AddDependencyAction extends MavenActionSupport implements IWorkbenc
return;
}
- MavenPlugin plugin = MavenPlugin.getDefault();
MavenProject mp = null;
IProject prj = file.getProject();
if (prj != null && IMavenConstants.POM_FILE_NAME.equals(file.getProjectRelativePath().toString())) {
- IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectRegistry().getProject(prj);
+ IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().getProject(prj);
if (facade != null) {
mp = facade.getMavenProject();
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java
index e57f2c72..61281bbd 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java
@@ -47,7 +47,7 @@ public class AddPluginAction extends MavenActionSupport implements IWorkbenchWin
MavenProject mp = null;
IProject prj = file.getProject();
if (prj != null && IMavenConstants.POM_FILE_NAME.equals(file.getProjectRelativePath().toString())) {
- IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectRegistry().getProject(prj);
+ IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().getProject(prj);
if (facade != null) {
mp = facade.getMavenProject();
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java
index 0d623ae2..7628ce15 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java
@@ -29,16 +29,17 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.project.IProjectConfigurationManager;
import org.eclipse.m2e.core.project.IMavenProjectRegistry;
+import org.eclipse.m2e.core.project.IProjectConfigurationManager;
import org.eclipse.m2e.core.project.MavenUpdateRequest;
import org.eclipse.m2e.core.project.ResolverConfiguration;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.m2e.core.ui.internal.Messages;
public class ChangeNatureAction implements IObjectActionDelegate, IExecutableExtension {
@@ -118,11 +119,10 @@ public class ChangeNatureAction implements IObjectActionDelegate, IExecutableExt
this.projects = projects;
this.option = option;
- MavenPlugin plugin = MavenPlugin.getDefault();
- this.importManager = plugin.getProjectConfigurationManager();
- this.projectManager = plugin.getMavenProjectRegistry();
+ this.importManager = MavenPlugin.getProjectConfigurationManager();
+ this.projectManager = MavenPlugin.getMavenProjectRegistry();
- this.mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ this.mavenConfiguration = MavenPlugin.getMavenConfiguration();
}
public IStatus runInWorkspace(IProgressMonitor monitor) {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java
index 23a0f63f..9aa626af 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java
@@ -13,6 +13,9 @@ package org.eclipse.m2e.core.ui.internal.actions;
import java.util.Iterator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
@@ -20,11 +23,10 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.eclipse.m2e.core.MavenPlugin;
public class DisableNatureAction implements IObjectActionDelegate {
@@ -49,10 +51,8 @@ public class DisableNatureAction implements IObjectActionDelegate {
project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
}
if(project != null) {
- MavenPlugin plugin = MavenPlugin.getDefault();
-
try {
- plugin.getProjectConfigurationManager().disableMavenNature(project, new NullProgressMonitor());
+ MavenPlugin.getProjectConfigurationManager().disableMavenNature(project, new NullProgressMonitor());
} catch(CoreException ex) {
log.error(ex.getMessage(), ex);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java
index 2f58ea52..987d8e6f 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java
@@ -132,7 +132,7 @@ public class EnableNatureAction implements IObjectActionDelegate, IExecutableExt
boolean hasMavenNature = project.hasNature(IMavenConstants.NATURE_ID);
- IProjectConfigurationManager configurationManager = MavenPlugin.getDefault().getProjectConfigurationManager();
+ IProjectConfigurationManager configurationManager = MavenPlugin.getProjectConfigurationManager();
configurationManager.enableMavenNature(project, configuration, new NullProgressMonitor());
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java
index 81ceae9a..42f2585d 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java
@@ -67,7 +67,7 @@ public class MavenPropertyTester extends PropertyTester {
IProject projectAdapter = (IProject) adaptable.getAdapter(IProject.class);
if(projectAdapter!=null) {
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.create(projectAdapter, new NullProgressMonitor());
if(projectFacade != null) {
ResolverConfiguration configuration = projectFacade.getResolverConfiguration();
@@ -84,7 +84,7 @@ public class MavenPropertyTester extends PropertyTester {
if (HAS_PROJECT_ARTIFACT_KEY.equals(property)) {
ArtifactKey key = SelectionUtil.getType(receiver, ArtifactKey.class);
if(key != null) {
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade mavenProject = null;
mavenProject = projectManager.getMavenProject( //
key.getGroupId(), key.getArtifactId(), key.getVersion());
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java
index d4c70530..7171fb28 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java
@@ -19,8 +19,9 @@ import java.io.InputStream;
import java.net.URL;
import java.util.List;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
@@ -39,16 +40,6 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.embedder.ArtifactKey;
-import org.eclipse.m2e.core.embedder.IMaven;
-import org.eclipse.m2e.core.index.IIndex;
-import org.eclipse.m2e.core.index.IndexedArtifact;
-import org.eclipse.m2e.core.index.IndexedArtifactFile;
-import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.project.IMavenProjectRegistry;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.dialogs.MavenRepositorySearchDialog;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
@@ -66,8 +57,20 @@ import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionDelegate;
import org.eclipse.ui.part.FileEditorInput;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.IMavenProjectRegistry;
+import org.eclipse.m2e.core.ui.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.dialogs.MavenRepositorySearchDialog;
/**
@@ -161,7 +164,7 @@ public class OpenPomAction extends ActionDelegate implements IWorkbenchWindowAct
String tooltip = groupId + ":" + artifactId + ":" + version + "/" + fileName; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
try {
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
List<ArtifactRepository> artifactRepositories = maven.getArtifactRepositories();
@@ -196,16 +199,14 @@ public class OpenPomAction extends ActionDelegate implements IWorkbenchWindowAct
final String name = groupId + ":" + artifactId + ":" + version + ".pom"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
try {
- MavenPlugin plugin = MavenPlugin.getDefault();
-
- IMavenProjectRegistry projectManager = plugin.getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.getMavenProject(groupId, artifactId, version);
if(projectFacade != null) {
final IFile pomFile = projectFacade.getPom();
return openEditor(new FileEditorInput(pomFile), name);
}
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
List<ArtifactRepository> artifactRepositories = maven.getArtifactRepositories();
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenUrlAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenUrlAction.java
index d9ce84cd..d9b6bede 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenUrlAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenUrlAction.java
@@ -16,12 +16,9 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.model.CiManagement;
-import org.apache.maven.model.IssueManagement;
-import org.apache.maven.model.Scm;
-import org.apache.maven.project.MavenProject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
@@ -33,11 +30,6 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.embedder.ArtifactKey;
-import org.eclipse.m2e.core.embedder.IMaven;
-import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchWindow;
@@ -47,8 +39,19 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionDelegate;
import org.eclipse.ui.browser.IWebBrowser;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.model.CiManagement;
+import org.apache.maven.model.IssueManagement;
+import org.apache.maven.model.Scm;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.ui.internal.Messages;
/**
@@ -182,10 +185,10 @@ public class OpenUrlAction extends ActionDelegate implements IWorkbenchWindowAct
private static MavenProject getMavenProject(String groupId, String artifactId, String version, IProgressMonitor monitor) throws Exception {
String name = groupId + ":" + artifactId + ":" + version;
- MavenPlugin plugin = MavenPlugin.getDefault();
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
- IMavenProjectFacade projectFacade = plugin.getMavenProjectRegistry().getMavenProject(groupId, artifactId, version);
+ IMavenProjectFacade projectFacade = MavenPlugin.getMavenProjectRegistry().getMavenProject(groupId, artifactId,
+ version);
if(projectFacade != null) {
return projectFacade.getMavenProject(monitor);
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/RefreshMavenModelsAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/RefreshMavenModelsAction.java
index c2cc2dc5..a7fadbb6 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/RefreshMavenModelsAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/RefreshMavenModelsAction.java
@@ -65,7 +65,7 @@ public class RefreshMavenModelsAction implements IWorkbenchWindowActionDelegate,
// IWorkbenchWindowActionDelegate
public void run(IAction action) {
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
projectManager.refresh(new MavenUpdateRequest(getProjects(), offline, updateSnapshots));
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
index 14155b66..6b8e1dfb 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
@@ -272,7 +272,7 @@ public class SelectionUtil {
public static MavenProject getMavenProject(IEditorInput editorInput, IProgressMonitor monitor) throws CoreException {
if(editorInput instanceof IFileEditorInput) {
IFile pomFile = ((IFileEditorInput) editorInput).getFile();
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade facade = projectManager.create(pomFile, true, monitor);
if(facade!=null) {
return facade.getMavenProject(monitor);
@@ -317,7 +317,7 @@ public class SelectionUtil {
monitor = new NullProgressMonitor();
}
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
MavenExecutionRequest request = maven.createExecutionRequest(monitor);
request.setOffline(false);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateConfigurationAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateConfigurationAction.java
index df7d3eae..04243201 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateConfigurationAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateConfigurationAction.java
@@ -15,21 +15,22 @@ import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.ui.internal.UpdateConfigurationJob;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkingSet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.ui.internal.UpdateConfigurationJob;
public class UpdateConfigurationAction implements IObjectActionDelegate {
@@ -39,19 +40,13 @@ public class UpdateConfigurationAction implements IObjectActionDelegate {
private IStructuredSelection selection;
- private Shell shell;
-
public UpdateConfigurationAction() {
}
public UpdateConfigurationAction(Shell shell) {
- this.shell = shell;
}
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- if (targetPart != null) {
- shell = targetPart.getSite().getShell();
- }
}
public void selectionChanged(IAction action, ISelection selection) {
@@ -64,8 +59,7 @@ public class UpdateConfigurationAction implements IObjectActionDelegate {
public void run(IAction action) {
final Set<IProject> projects = getProjects();
- final MavenPlugin plugin = MavenPlugin.getDefault();
- new UpdateConfigurationJob(plugin, projects.toArray(new IProject[projects.size()])).schedule();
+ new UpdateConfigurationJob(projects.toArray(new IProject[projects.size()])).schedule();
}
private Set<IProject> getProjects() {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenGoalSelectionDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenGoalSelectionDialog.java
index cd3b56cd..f95ef200 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenGoalSelectionDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenGoalSelectionDialog.java
@@ -162,7 +162,7 @@ public class MavenGoalSelectionDialog extends ElementTreeSelectionDialog {
private final List<Group> groups = new ArrayList<Group>();
public GoalsContentProvider() {
-// MavenEmbedderManager embedderManager = MavenPlugin.getDefault().getMavenEmbedderManager();
+// MavenEmbedderManager embedderManager = MavenPlugin.getMavenEmbedderManager();
// try {
// MavenEmbedder embedder = embedderManager.getWorkspaceEmbedder();
// groups.add(new Group(Messages.getString("launch.goalsDialog.lifecycleBuild"), //$NON-NLS-1$
@@ -175,7 +175,7 @@ public class MavenGoalSelectionDialog extends ElementTreeSelectionDialog {
// log.error("Unable to get lifecycle phases", e);
// }
- IndexManager indexManager = MavenPlugin.getDefault().getIndexManager();
+ IndexManager indexManager = MavenPlugin.getIndexManager();
try {
// TODO: this will search ALL indexes, isn't the right to search _this_ project reposes only?
// I did not find (at first glance, maybe was hasty) a way to get IProject
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java
index cc6f7d46..520e45b3 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java
@@ -30,7 +30,6 @@ import org.eclipse.ui.IMarkerResolutionGenerator;
import org.eclipse.ui.IMarkerResolutionGenerator2;
import org.eclipse.ui.views.markers.WorkbenchMarkerResolution;
-import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.ui.internal.UpdateConfigurationJob;
@@ -79,7 +78,7 @@ public class MarkerResolutionGenerator implements IMarkerResolutionGenerator, IM
*/
public void run(IMarker marker) {
final Set<IProject> projects = getProjects(marker);
- new UpdateConfigurationJob(MavenPlugin.getDefault(), projects.toArray(new IProject[projects.size()])).schedule();
+ new UpdateConfigurationJob(projects.toArray(new IProject[projects.size()])).schedule();
}
/* (non-Javadoc)
@@ -87,7 +86,7 @@ public class MarkerResolutionGenerator implements IMarkerResolutionGenerator, IM
*/
public void run(IMarker[] markers, IProgressMonitor monitor) {
final Set<IProject> projects = getProjects(markers);
- new UpdateConfigurationJob(MavenPlugin.getDefault(), projects.toArray(new IProject[projects.size()])).schedule();
+ new UpdateConfigurationJob(projects.toArray(new IProject[projects.size()])).schedule();
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java
index 23ceef8a..5c624ac2 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java
@@ -96,8 +96,6 @@ import org.eclipse.m2e.core.ui.internal.Messages;
public class MavenInstallationsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
private static final Logger log = LoggerFactory.getLogger(MavenInstallationsPreferencePage.class);
- final MavenPlugin mavenPlugin;
-
final MavenRuntimeManager runtimeManager;
final IMavenConfiguration mavenConfiguration;
@@ -119,10 +117,9 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
public MavenInstallationsPreferencePage() {
setTitle(Messages.MavenInstallationsPreferencePage_title);
- this.mavenPlugin = MavenPlugin.getDefault();
- this.runtimeManager = mavenPlugin.getMavenRuntimeManager();
- this.mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
- this.maven = MavenPlugin.getDefault().getMaven();
+ this.runtimeManager = MavenPlugin.getMavenRuntimeManager();
+ this.mavenConfiguration = MavenPlugin.getMavenConfiguration();
+ this.maven = MavenPlugin.getMaven();
}
public void init(IWorkbench workbench) {
@@ -179,7 +176,7 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
if(defaultRuntime == null || defaultRuntime instanceof MavenEmbeddedRuntime){
storeCustom(dir);
}
- IndexManager indexManager = mavenPlugin.getIndexManager();
+ IndexManager indexManager = MavenPlugin.getIndexManager();
try {
indexManager.getWorkspaceIndex().updateIndex(true, monitor);
} catch(CoreException ex) {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java
index 4b9bbe32..ab874662 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java
@@ -21,7 +21,6 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.m2e.core.ui.internal.Messages;
@@ -29,13 +28,9 @@ import org.eclipse.m2e.core.ui.internal.Messages;
public class MavenPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
- final MavenPlugin plugin;
-
public MavenPreferencePage() {
super(GRID);
setPreferenceStore(M2EUIPluginActivator.getDefault().getPreferenceStore());
-
- plugin = MavenPlugin.getDefault();
}
public void init(IWorkbench workbench) {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java
index e7d14f65..3f566c0a 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java
@@ -16,10 +16,9 @@ import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.List;
-import org.apache.maven.cli.MavenCli;
-import org.apache.maven.repository.RepositorySystem;
-import org.apache.maven.settings.Settings;
-import org.apache.maven.settings.building.SettingsProblem;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.resources.IProject;
@@ -32,15 +31,6 @@ import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.embedder.IMaven;
-import org.eclipse.m2e.core.embedder.IMavenConfiguration;
-import org.eclipse.m2e.core.embedder.MavenRuntime;
-import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
-import org.eclipse.m2e.core.index.IndexManager;
-import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.project.MavenUpdateRequest;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -67,8 +57,21 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.repository.RepositorySystem;
+import org.apache.maven.settings.Settings;
+import org.apache.maven.settings.building.SettingsProblem;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.embedder.MavenRuntime;
+import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+import org.eclipse.m2e.core.ui.internal.Messages;
/**
@@ -79,8 +82,6 @@ import org.slf4j.LoggerFactory;
public class MavenSettingsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
private static final Logger log = LoggerFactory.getLogger(MavenSettingsPreferencePage.class);
- final MavenPlugin mavenPlugin;
-
final MavenRuntimeManager runtimeManager;
final IMavenConfiguration mavenConfiguration;
@@ -89,7 +90,6 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
MavenRuntime defaultRuntime;
-
Text userSettingsText;
Text localRepositoryText;
@@ -101,10 +101,9 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
public MavenSettingsPreferencePage() {
setTitle(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_title);
- this.mavenPlugin = MavenPlugin.getDefault();
- this.runtimeManager = mavenPlugin.getMavenRuntimeManager();
- this.mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
- this.maven = MavenPlugin.getDefault().getMaven();
+ this.runtimeManager = MavenPlugin.getMavenRuntimeManager();
+ this.mavenConfiguration = MavenPlugin.getMavenConfiguration();
+ this.maven = MavenPlugin.getMaven();
}
public void init(IWorkbench workbench) {
@@ -143,22 +142,20 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
File newRepositoryDir = new File(maven.getLocalRepository().getBasedir());
if(!newRepositoryDir.equals(localRepositoryDir)) {
- IndexManager indexManager = mavenPlugin.getIndexManager();
+ IndexManager indexManager = MavenPlugin.getIndexManager();
indexManager.getWorkspaceIndex().updateIndex(true, monitor);
}
if(updateMavenDependencies){
- IMavenProjectFacade[] projects = MavenPlugin.getDefault().getMavenProjectRegistry().getProjects();
+ IMavenProjectFacade[] projects = MavenPlugin.getMavenProjectRegistry().getProjects();
ArrayList<IProject> allProjects = new ArrayList<IProject>();
if(projects != null){
- MavenPlugin.getDefault().getMaven().reloadSettings();
+ MavenPlugin.getMaven().reloadSettings();
SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, projects.length);
for(int i=0;i<projects.length;i++){
subMonitor.beginTask(NLS.bind(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_task_updating, projects[i].getProject().getName()), 1);
allProjects.add(projects[i].getProject());
}
- MavenPlugin
- .getDefault()
- .getMavenProjectRegistry()
+ MavenPlugin.getMavenProjectRegistry()
.refresh(
new MavenUpdateRequest(allProjects.toArray(new IProject[] {}), mavenConfiguration.isOffline(),
true));
@@ -226,7 +223,7 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
public void widgetSelected(SelectionEvent e) {
new WorkspaceJob(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_job_indexing) {
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- IndexManager indexManager = mavenPlugin.getIndexManager();
+ IndexManager indexManager = MavenPlugin.getIndexManager();
indexManager.getWorkspaceIndex().updateIndex(true, monitor);
return Status.OK_STATUS;
}
@@ -366,10 +363,7 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
setMessage(NLS.bind(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_error_parse, result.get(0).getMessage()), IMessageProvider.WARNING);
}
}
-
-
- @SuppressWarnings("unchecked")
void openEditor(final String fileName) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ParentGatherer.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ParentGatherer.java
index 148dd008..a891db81 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ParentGatherer.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ParentGatherer.java
@@ -44,8 +44,8 @@ public class ParentGatherer {
*/
public LinkedList<MavenProject> getParentHierarchy(IProgressMonitor monitor) throws CoreException {
LinkedList<MavenProject> hierarchy = new LinkedList<MavenProject>();
- IMaven maven = MavenPlugin.getDefault().getMaven();
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMaven maven = MavenPlugin.getMaven();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
maven.detachFromSession(mavenProject);
hierarchy.add(mavenProject);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java
index 396ff5cc..1d92175a 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java
@@ -90,7 +90,7 @@ public class MavenRepositoryView extends ViewPart {
private static final String ENABLED_MIN = Messages.MavenRepositoryView_minimum_enabled;
private static final String MENU_ID = ".repositoryViewMenu";
- private IndexManager indexManager = MavenPlugin.getDefault().getIndexManager();
+ private IndexManager indexManager = MavenPlugin.getIndexManager();
private IAction collapseAllAction;
@@ -270,7 +270,7 @@ public class MavenRepositoryView extends ViewPart {
Job job = new WorkspaceJob(Messages.MavenRepositoryView_job_reloading) {
public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
- MavenPlugin.getDefault().getMaven().reloadSettings();
+ MavenPlugin.getMaven().reloadSettings();
} catch(CoreException ex) {
return ex.getStatus();
}
@@ -290,7 +290,7 @@ public class MavenRepositoryView extends ViewPart {
// for(IArtifactNode node : nodes){
// String key = node.getDocumentKey();
// System.out.println("key: "+key);
-// ((NexusIndexManager)MavenPlugin.getDefault().getIndexManager()).removeDocument("local", null, key);
+// ((NexusIndexManager)MavenPlugin.getIndexManager()).removeDocument("local", null, key);
// }
// }
// }
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java
index c1b24b70..22584919 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java
@@ -29,8 +29,8 @@ import org.eclipse.swt.graphics.Image;
*/
public abstract class AbstractRepositoriesNode implements IMavenRepositoryNode {
- protected final NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getDefault().getIndexManager();
- protected final IRepositoryRegistry repositoryRegistry = MavenPlugin.getDefault().getRepositoryRegistry();
+ protected final NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getIndexManager();
+ protected final IRepositoryRegistry repositoryRegistry = MavenPlugin.getRepositoryRegistry();
public Object[] getChildren() {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java
index 6c411fa3..8217693d 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java
@@ -38,7 +38,7 @@ public class IndexedArtifactGroupNode implements IMavenRepositoryNode, IArtifact
* @see org.eclipse.m2e.ui.internal.views.IMavenRepositoryNode#getChildren()
*/
public Object[] getChildren() {
- NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getDefault().getIndexManager();
+ NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getIndexManager();
IndexedArtifactGroup resolvedGroup = indexManager.resolveGroup(indexedArtifactGroup);
//IndexedArtifactGroup resolvedGroup = indexedArtifactGroup;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java
index 50dfb092..08766df9 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java
@@ -26,7 +26,7 @@ import org.eclipse.swt.graphics.Image;
public class LocalRepositoryRootNode implements IMavenRepositoryNode{
public Object[] getChildren() {
- NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getDefault().getIndexManager();
+ NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getIndexManager();
NexusIndex localIndex = indexManager.getLocalIndex();
NexusIndex workspaceIndex = indexManager.getWorkspaceIndex();
return new Object[]{
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java
index c01b17bf..1b48ccb7 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java
@@ -28,8 +28,8 @@ import org.eclipse.swt.graphics.Image;
*/
public class ProjectRepositoriesNode implements IMavenRepositoryNode {
- private NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getDefault().getIndexManager();
- private IRepositoryRegistry repositoryRegistry = MavenPlugin.getDefault().getRepositoryRegistry();
+ private NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getIndexManager();
+ private IRepositoryRegistry repositoryRegistry = MavenPlugin.getRepositoryRegistry();
public Object[] getChildren() {
ArrayList<Object> nodes = new ArrayList<Object>();
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
index 2b3be67e..aa0ee6e8 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
@@ -499,7 +499,7 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
protected AbstractProjectScanner<MavenProjectInfo> getProjectScanner() {
File root = workspaceRoot.getLocation().toFile();
- MavenModelManager modelManager = MavenPlugin.getDefault().getMavenModelManager();
+ MavenModelManager modelManager = MavenPlugin.getMavenModelManager();
if(showLocation) {
String location = rootDirectoryCombo.getText().trim();
if (location.length() > 0) {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java
index 4d61e559..3bd1983b 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java
@@ -13,16 +13,12 @@ package org.eclipse.m2e.core.ui.internal.wizards;
import java.io.File;
-import org.apache.maven.project.MavenProject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.embedder.ArtifactKey;
-import org.eclipse.m2e.core.embedder.IMaven;
-import org.eclipse.m2e.core.index.IndexedArtifactFile;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.actions.SelectionUtil;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -37,8 +33,15 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.ui.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.actions.SelectionUtil;
/**
@@ -248,9 +251,8 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
pomFileNameText.setText(""); //$NON-NLS-1$
}
- MavenPlugin plugin = MavenPlugin.getDefault();
try {
- IndexedArtifactFile iaf = plugin.getIndexManager().getAllIndexes().identify(file);
+ IndexedArtifactFile iaf = MavenPlugin.getIndexManager().getAllIndexes().identify(file);
if(iaf!=null) {
groupIdCombo.setText(iaf.group);
artifactIdCombo.setText(iaf.artifact);
@@ -276,7 +278,7 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
// read pom file
try {
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
MavenProject mavenProject = maven.readProject(new File(pomFileName), null);
groupIdCombo.setText(mavenProject.getGroupId());
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileWizard.java
index 4b194316..f60a4326 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileWizard.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileWizard.java
@@ -15,8 +15,9 @@ import java.util.Arrays;
import java.util.List;
import java.util.Properties;
-import org.apache.maven.execution.MavenExecutionRequest;
-import org.apache.maven.execution.MavenExecutionResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
@@ -26,16 +27,18 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.progress.IProgressConstants;
+
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenExecutionResult;
+
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.ui.internal.actions.OpenMavenConsoleAction;
-import org.eclipse.ui.IImportWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.progress.IProgressConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
@@ -96,10 +99,9 @@ public class MavenInstallFileWizard extends Wizard implements IImportWizard {
new Job(Messages.MavenInstallFileWizard_job) {
protected IStatus run(IProgressMonitor monitor) {
setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
- MavenPlugin plugin = MavenPlugin.getDefault();
try {
// Run the install:install-file goal
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
MavenExecutionRequest request = maven.createExecutionRequest(monitor);
request.setGoals(Arrays.asList("install:install-file")); //$NON-NLS-1$
request.setUserProperties(properties);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java
index b22df413..64fa4fb6 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java
@@ -11,13 +11,23 @@
package org.eclipse.m2e.core.ui.internal.wizards;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.createElementWithText;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.findChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.format;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.getChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.performOnDOMDocument;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.textEquals;
+
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
-import org.apache.maven.archetype.catalog.Archetype;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.Parent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -29,10 +39,6 @@ import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.ui.internal.MavenImages;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.actions.OpenMavenConsoleAction;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -42,12 +48,17 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.progress.IProgressConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.*;
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.ui.internal.MavenImages;
+import org.eclipse.m2e.core.ui.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.actions.OpenMavenConsoleAction;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.OperationTuple;
/**
* A project wizard for creating a new Maven2 module project.
@@ -184,8 +195,6 @@ public class MavenModuleWizard extends AbstractMavenProjectWizard implements INe
Job job;
- final MavenPlugin plugin = MavenPlugin.getDefault();
-
if(parentPage.isSimpleProject()) {
final Model model = artifactPage.getModel();
@@ -212,7 +221,7 @@ public class MavenModuleWizard extends AbstractMavenProjectWizard implements INe
// XXX respect parent's setting for separate projects for modules
// XXX should run update sources on parent instead of creating new module project
- plugin.getProjectConfigurationManager().createSimpleProject(project, location.append(moduleName), model,
+ MavenPlugin.getProjectConfigurationManager().createSimpleProject(project, location.append(moduleName), model,
folders, importConfiguration, monitor);
setModule(projectName);
@@ -237,8 +246,7 @@ public class MavenModuleWizard extends AbstractMavenProjectWizard implements INe
workingSets) {
@Override
protected List<IProject> doCreateMavenProjects(IProgressMonitor monitor) throws CoreException {
- MavenPlugin plugin = MavenPlugin.getDefault();
- plugin.getProjectConfigurationManager().createArchetypeProject(project, location, archetype, //
+ MavenPlugin.getProjectConfigurationManager().createArchetypeProject(project, location, archetype, //
groupId, artifactId, version, javaPackage, properties, importConfiguration, monitor);
setModule(moduleName);
@@ -279,7 +287,7 @@ public class MavenModuleWizard extends AbstractMavenProjectWizard implements INe
}
}
});
- job.setRule(plugin.getProjectConfigurationManager().getRule());
+ job.setRule(MavenPlugin.getProjectConfigurationManager().getRule());
job.schedule();
if(isEditor) {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java
index 69712c1a..de7c39da 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java
@@ -228,7 +228,7 @@ public class MavenModuleWizardParentPage extends AbstractMavenWizardPage {
parentContainer = pom.getParent();
try {
- parentModel = MavenPlugin.getDefault().getMavenModelManager().readMavenModel(pom);
+ parentModel = MavenPlugin.getMavenModelManager().readMavenModel(pom);
validateParent();
parentProjectText.setText(parentModel.getArtifactId());
} catch(CoreException e) {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java
index 75827869..f93359d9 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java
@@ -306,13 +306,13 @@ public class MavenPomSelectionComponent extends Composite {
void scheduleSearch(String query, boolean delay) {
if(query != null && query.length() > 2) {
if(searchJob == null) {
- IndexManager indexManager = MavenPlugin.getDefault().getIndexManager();
+ IndexManager indexManager = MavenPlugin.getIndexManager();
searchJob = new SearchJob(queryType, indexManager);
} else {
if(!searchJob.cancel()) {
//for already running ones, just create new instance so that the previous one can piecefully die
//without preventing the new one from completing first
- IndexManager indexManager = MavenPlugin.getDefault().getIndexManager();
+ IndexManager indexManager = MavenPlugin.getIndexManager();
searchJob = new SearchJob(queryType, indexManager);
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java
index 60043690..b6aaf808 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java
@@ -132,7 +132,7 @@ public class MavenPomWizard extends Wizard implements INewWizard {
final File pom = file.getLocation().toFile();
try {
- MavenModelManager modelManager = MavenPlugin.getDefault().getMavenModelManager();
+ MavenModelManager modelManager = MavenPlugin.getMavenModelManager();
modelManager.createMavenModel(file, model);
getShell().getDisplay().asyncExec(new Runnable() {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizard.java
index f8c21b20..35c0bc70 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizard.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizard.java
@@ -15,8 +15,6 @@ import java.util.Arrays;
import java.util.List;
import java.util.Properties;
-import org.apache.maven.archetype.catalog.Archetype;
-import org.apache.maven.model.Model;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -32,11 +30,6 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.ui.internal.MavenImages;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.actions.SelectionUtil;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -48,6 +41,15 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.INewWizard;
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.ui.internal.MavenImages;
+import org.eclipse.m2e.core.ui.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.actions.SelectionUtil;
+
/**
* Simple project wizard for creating a new Maven2 project.
@@ -212,15 +214,13 @@ public class MavenProjectWizard extends AbstractMavenProjectWizard implements IN
final Job job;
- final MavenPlugin plugin = MavenPlugin.getDefault();
-
if(simpleProject.getSelection()) {
final String[] folders = artifactPage.getFolders();
job = new AbstactCreateMavenProjectJob(NLS.bind(Messages.wizardProjectJobCreatingProject, projectName), workingSets) {
@Override
protected List<IProject> doCreateMavenProjects(IProgressMonitor monitor) throws CoreException {
- plugin.getProjectConfigurationManager().createSimpleProject(project, location, model, folders, //
+ MavenPlugin.getProjectConfigurationManager().createSimpleProject(project, location, model, folders, //
importConfiguration, monitor);
return Arrays.asList(project);
}
@@ -238,7 +238,7 @@ public class MavenProjectWizard extends AbstractMavenProjectWizard implements IN
job = new AbstactCreateMavenProjectJob(NLS.bind(Messages.wizardProjectJobCreating, archetype.getArtifactId()), workingSets) {
@Override
protected List<IProject> doCreateMavenProjects(IProgressMonitor monitor) throws CoreException {
- plugin.getProjectConfigurationManager().createArchetypeProject(project, location, archetype, //
+ MavenPlugin.getProjectConfigurationManager().createArchetypeProject(project, location, archetype, //
groupId, artifactId, version, javaPackage, properties, importConfiguration, monitor);
return Arrays.asList(project);
}
@@ -260,7 +260,7 @@ public class MavenProjectWizard extends AbstractMavenProjectWizard implements IN
});
- job.setRule(plugin.getProjectConfigurationManager().getRule());
+ job.setRule(MavenPlugin.getProjectConfigurationManager().getRule());
job.schedule();
// ProjectListener listener = new ProjectListener();
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java
index 4d36d9d3..c4b6a62b 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java
@@ -22,13 +22,9 @@ import java.util.List;
import java.util.Set;
import java.util.TreeSet;
-import org.apache.maven.archetype.catalog.Archetype;
-import org.apache.maven.archetype.catalog.ArchetypeCatalog;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.DefaultArtifactRepository;
-import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
-import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -52,21 +48,6 @@ import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.IWizardContainer;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory;
-import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory.NexusIndexerCatalogFactory;
-import org.eclipse.m2e.core.archetype.ArchetypeManager;
-import org.eclipse.m2e.core.embedder.ArtifactKey;
-import org.eclipse.m2e.core.embedder.IMaven;
-import org.eclipse.m2e.core.index.IMutableIndex;
-import org.eclipse.m2e.core.index.IndexListener;
-import org.eclipse.m2e.core.index.IndexManager;
-import org.eclipse.m2e.core.internal.MavenPluginActivator;
-import org.eclipse.m2e.core.project.ProjectImportConfiguration;
-import org.eclipse.m2e.core.repository.IRepository;
-import org.eclipse.m2e.core.ui.internal.MavenImages;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.util.M2EUIUtils;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
@@ -90,8 +71,30 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.archetype.catalog.ArchetypeCatalog;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.DefaultArtifactRepository;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory;
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory.NexusIndexerCatalogFactory;
+import org.eclipse.m2e.core.archetype.ArchetypeManager;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.index.IMutableIndex;
+import org.eclipse.m2e.core.index.IndexListener;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.internal.MavenPluginActivator;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.repository.IRepository;
+import org.eclipse.m2e.core.ui.internal.MavenImages;
+import org.eclipse.m2e.core.ui.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.util.M2EUIUtils;
/**
@@ -178,7 +181,7 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
createAdvancedSettings(composite, new GridData(SWT.FILL, SWT.TOP, true, false, 3, 1));
- MavenPlugin.getDefault().getIndexManager().addIndexListener(this);
+ MavenPlugin.getIndexManager().addIndexListener(this);
setControl(composite);
}
@@ -475,7 +478,7 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
}
public void dispose() {
- MavenPlugin.getDefault().getIndexManager().removeIndexListener(this);
+ MavenPlugin.getIndexManager().removeIndexListener(this);
super.dispose();
}
@@ -693,9 +696,7 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
+ archetypeName, IProgressMonitor.UNKNOWN);
try {
- final IMaven maven = MavenPlugin.getDefault().getMaven();
-
- final MavenPlugin plugin = MavenPlugin.getDefault();
+ final IMaven maven = MavenPlugin.getMaven();
final List<ArtifactRepository> remoteRepositories;
if(repositoryUrl.length() == 0) {
@@ -733,7 +734,7 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
}
monitor.subTask(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypePage_task_indexing);
- IndexManager indexManager = plugin.getIndexManager();
+ IndexManager indexManager = MavenPlugin.getIndexManager();
IMutableIndex localIndex = indexManager.getLocalIndex();
localIndex.addArtifact(jarFile, new ArtifactKey(pomArtifact));
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java
index 8a6a99e9..6174cabc 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java
@@ -387,7 +387,7 @@ public class MavenProjectWizardArchetypeParametersPage extends AbstractMavenWiza
public void run(IProgressMonitor monitor) {
monitor.beginTask(NLS.bind(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypeParametersPage_task, archetypeName), IProgressMonitor.UNKNOWN);
try {
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
ArtifactRepository localRepository = maven.getLocalRepository();
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java
index 3cda1463..5aa6626b 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java
@@ -170,7 +170,7 @@ public class MavenModelManager {
String classpath, IProgressMonitor monitor) throws CoreException {
monitor.setTaskName(Messages.MavenModelManager_monitor_building);
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(maven.createSession(
maven.createExecutionRequest(monitor), mavenProject).getRepositorySession());
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java
index cca2365b..075ed16a 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java
@@ -96,10 +96,9 @@ public class MavenBuilder extends IncrementalProjectBuilder {
log.debug("Building project {}", project.getName()); //$NON-NLS-1$
long start = System.currentTimeMillis();
- MavenPlugin plugin = MavenPlugin.getDefault();
- IMavenProjectRegistry projectManager = plugin.getMavenProjectRegistry();
- IProjectConfigurationManager configurationManager = plugin.getProjectConfigurationManager();
- IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
+ IProjectConfigurationManager configurationManager = MavenPlugin.getProjectConfigurationManager();
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getMavenConfiguration();
IMavenMarkerManager markerManager = MavenPluginActivator.getDefault().getMavenMarkerManager();
markerManager.deleteMarkers(project, kind == FULL_BUILD, IMavenConstants.MARKER_BUILD_ID);
@@ -148,7 +147,7 @@ public class MavenBuilder extends IncrementalProjectBuilder {
Set<IProject> dependencies = new HashSet<IProject>();
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
MavenExecutionRequest request = projectManager.createExecutionRequest(pomResource,
projectFacade.getResolverConfiguration(), monitor);
MavenSession session = maven.createSession(request, mavenProject);
@@ -375,9 +374,8 @@ public class MavenBuilder extends IncrementalProjectBuilder {
}
protected void clean(IProgressMonitor monitor) throws CoreException{
- MavenPlugin plugin = MavenPlugin.getDefault();
- IMavenProjectRegistry projectManager = plugin.getMavenProjectRegistry();
- IProjectConfigurationManager configurationManager = plugin.getProjectConfigurationManager();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
+ IProjectConfigurationManager configurationManager = MavenPlugin.getProjectConfigurationManager();
IProject project = getProject();
IMavenMarkerManager markerManager = MavenPluginActivator.getDefault().getMavenMarkerManager();
@@ -396,7 +394,7 @@ public class MavenBuilder extends IncrementalProjectBuilder {
return;
}
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
// TODO flush relevant caches
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenNature.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenNature.java
index b96601e8..6041622b 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenNature.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenNature.java
@@ -29,7 +29,7 @@ public class MavenNature implements IProjectNature {
*/
public void configure() throws CoreException {
IProjectDescription description = project.getDescription();
- MavenPlugin.getDefault().getProjectConfigurationManager().addMavenBuilder(project, description, null /*monitor*/);
+ MavenPlugin.getProjectConfigurationManager().addMavenBuilder(project, description, null /*monitor*/);
project.setDescription(description, null);
}
@@ -40,7 +40,7 @@ public class MavenNature implements IProjectNature {
*/
public void deconfigure() throws CoreException {
IProjectDescription description = project.getDescription();
- MavenPlugin.getDefault().getProjectConfigurationManager()
+ MavenPlugin.getProjectConfigurationManager()
.removeMavenBuilder(project, description, null /*monitor*/);
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseRepositoryListener.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseRepositoryListener.java
index b5da2ffa..adf309f2 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseRepositoryListener.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseRepositoryListener.java
@@ -44,7 +44,7 @@ public class EclipseRepositoryListener extends AbstractRepositoryListener implem
private void notifyListeners(RepositoryEvent event) {
File file = event.getFile();
if(file != null) {
- MavenImpl maven = (MavenImpl) MavenPlugin.getDefault().getMaven();
+ MavenImpl maven = (MavenImpl) MavenPlugin.getMaven();
Artifact artifact = event.getArtifact();
ArtifactKey key = new ArtifactKey(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
artifact.getClassifier());
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java
index 98c97137..47184423 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java
@@ -178,7 +178,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
this.repositoryRegistry = repositoryRegistry;
this.baseIndexDir = new File(stateDir, "nexus"); //$NON-NLS-1$
- this.maven = MavenPlugin.getDefault().getMaven();
+ this.maven = MavenPlugin.getMaven();
this.indexUpdater = MavenPluginActivator.getDefault().getIndexUpdater();
this.updaterJob = new IndexUpdaterJob(this);
@@ -1068,7 +1068,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
} else {
if(!force) {
//if 'force' is not set, then only do the remote update if this value is set
- IMavenConfiguration mavenConfig = MavenPlugin.getDefault().getMavenConfiguration();
+ IMavenConfiguration mavenConfig = MavenPlugin.getMavenConfiguration();
if(mavenConfig.isUpdateIndexesOnStartup()) {
updateRemoteIndex(repository, force, monitor);
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java
index a13c2dc3..874b515c 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java
@@ -237,7 +237,7 @@ public class LifecycleMappingFactory {
MavenExecutionRequest templateRequest, List<MappingMetadataSource> metadataSources, MavenProject mavenProject,
List<MojoExecution> mojoExecutions, boolean applyDefaultStrategy) {
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
MavenSession session = maven.createSession(newMavenExecutionRequest(templateRequest), mavenProject);
//
@@ -362,7 +362,7 @@ public class LifecycleMappingFactory {
private static List<PluginExecutionMetadata> applyParametersFilter(MavenSession session,
List<PluginExecutionMetadata> metadatas, MavenProject mavenProject, MojoExecution execution) throws CoreException {
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
List<PluginExecutionMetadata> result = new ArrayList<PluginExecutionMetadata>();
all_metadatas: for(PluginExecutionMetadata metadata : metadatas) {
@@ -498,7 +498,7 @@ public class LifecycleMappingFactory {
*/
public static List<LifecycleMappingMetadataSource> getPomMappingMetadataSources(MavenProject mavenProject,
MavenExecutionRequest templateRequest, IProgressMonitor monitor) throws CoreException {
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
ArrayList<LifecycleMappingMetadataSource> sources = new ArrayList<LifecycleMappingMetadataSource>();
@@ -644,9 +644,8 @@ public class LifecycleMappingFactory {
AbstractProjectConfigurator configurator = (AbstractProjectConfigurator) element
.createExecutableExtension(AbstractProjectConfigurator.ATTR_CLASS);
- MavenPlugin plugin = MavenPlugin.getDefault();
- configurator.setProjectManager(plugin.getMavenProjectRegistry());
- configurator.setMavenConfiguration(plugin.getMavenConfiguration());
+ configurator.setProjectManager(MavenPlugin.getMavenProjectRegistry());
+ configurator.setMavenConfiguration(MavenPlugin.getMavenConfiguration());
configurator.setMarkerManager(MavenPluginActivator.getDefault().getMavenMarkerManager());
return configurator;
@@ -816,7 +815,7 @@ public class LifecycleMappingFactory {
addBuild(result, profile.getBuild());
}
- MavenImpl maven = (MavenImpl) MavenPlugin.getDefault().getMaven();
+ MavenImpl maven = (MavenImpl) MavenPlugin.getMaven();
maven.interpolateModel(mavenProject, model);
return result;
@@ -867,7 +866,7 @@ public class LifecycleMappingFactory {
// TODO: cache LifecycleMappingMetadataSource instances
private static LifecycleMappingMetadataSource getLifecycleMappingMetadataSource(String groupId, String artifactId,
String version, List<ArtifactRepository> repositories, IProgressMonitor monitor) {
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
try {
// TODO this does not resolve workspace artifacts
Artifact artifact = maven.resolve(groupId, artifactId, version, "xml", LIFECYCLE_MAPPING_METADATA_CLASSIFIER,
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ArtifactKeyAdapterFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ArtifactKeyAdapterFactory.java
index 6666cd37..b0a616cb 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ArtifactKeyAdapterFactory.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ArtifactKeyAdapterFactory.java
@@ -38,7 +38,7 @@ public class ArtifactKeyAdapterFactory implements IAdapterFactory {
return null;
}
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
if(adaptable instanceof IProject) {
IProject project = (IProject) adaptable;
IMavenProjectFacade facade = projectManager.create(project, new NullProgressMonitor());
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
index f096f4aa..71c2f3ac 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
@@ -169,7 +169,7 @@ public class ProjectConfigurationManager implements IProjectConfigurationManager
private void hideNestedProjectsFromParents(List<IProject> projects) {
- if (!MavenPlugin.getDefault().getMavenConfiguration().isHideFoldersOfNestedProjects()) {
+ if (!MavenPlugin.getMavenConfiguration().isHideFoldersOfNestedProjects()) {
return;
}
// Prevent child project folders from showing up in parent project folders.
@@ -598,7 +598,7 @@ public class ProjectConfigurationManager implements IProjectConfigurationManager
if (StringUtils.isBlank(artifactRemoteRepository)){
- IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getMavenConfiguration();
if (!mavenConfiguration.isOffline()){
//Try to find the repository from remote catalog if needed
final ArchetypeManager archetypeManager = MavenPluginActivator.getDefault().getArchetypeManager();
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenProjectFacade.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenProjectFacade.java
index 92722c5b..a38b0a26 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenProjectFacade.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenProjectFacade.java
@@ -199,7 +199,7 @@ public class MavenProjectFacade implements IMavenProjectFacade, Serializable {
if (mavenProject == null) {
//this used to just pass in 'true' for 'offline'. when the local repo was removed or
//corrupted, though, the project wouldn't load correctly
- IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getMavenConfiguration();
boolean isOffline = mavenConfiguration.isOffline();
MavenExecutionResult result = manager.readProjectWithDependencies(pom, resolverConfiguration, //
new MavenUpdateRequest(isOffline, false /* updateSnapshots */), monitor);
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
index ae854e39..9487f056 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
@@ -749,7 +749,7 @@ public class ProjectRegistryManager {
public Map<String, List<MojoExecution>> calculateExecutionPlans(MavenProjectFacade projectFacade, IProgressMonitor monitor)
throws CoreException {
- boolean offline = MavenPlugin.getDefault().getMavenConfiguration().isOffline();
+ boolean offline = MavenPlugin.getMavenConfiguration().isOffline();
MavenUpdateRequest request = new MavenUpdateRequest(offline, false /*updateSnapshots*/);
MavenExecutionRequest executionRequest = createExecutionRequest(projectFacade.getPom(),
projectFacade.getResolverConfiguration(), monitor);
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractLifecycleMapping.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractLifecycleMapping.java
index 35a796cd..2c7d15df 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractLifecycleMapping.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractLifecycleMapping.java
@@ -34,7 +34,7 @@ public abstract class AbstractLifecycleMapping implements ILifecycleMapping {
* Calls #configure method of all registered project configurators
*/
public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException {
- MavenPlugin.getDefault().getProjectConfigurationManager()
+ MavenPlugin.getProjectConfigurationManager()
.addMavenBuilder(request.getProject(), null /*description*/, monitor);
IMavenProjectFacade projectFacade = request.getMavenProjectFacade();
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java
index 41c17608..c79f1b83 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java
@@ -75,7 +75,7 @@ public abstract class AbstractProjectConfigurator implements IExecutableExtensio
protected IMavenMarkerManager markerManager;
- protected IMaven maven = MavenPlugin.getDefault().getMaven();
+ protected IMaven maven = MavenPlugin.getMaven();
public void setProjectManager(IMavenProjectRegistry projectManager) {
this.projectManager = projectManager;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MojoExecutionBuildParticipant.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MojoExecutionBuildParticipant.java
index f0852f35..e2f5eed7 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MojoExecutionBuildParticipant.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MojoExecutionBuildParticipant.java
@@ -40,7 +40,7 @@ public class MojoExecutionBuildParticipant extends AbstractBuildParticipant {
public Set<IProject> build(int kind, IProgressMonitor monitor) throws Exception {
if(appliesToBuildKind(kind)) {
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
maven.execute(getSession(), getMojoExecution(), monitor);
}
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java
index dd68ca11..dc6b5005 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java
@@ -147,8 +147,7 @@ public class MavenDiscoveryService implements IMavenDiscoveryUI, IMavenDiscovery
}
}
- MavenPlugin mavenPlugin = MavenPlugin.getDefault();
- IMaven maven = mavenPlugin.getMaven();
+ IMaven maven = MavenPlugin.getMaven();
MavenExecutionRequest request = maven.createExecutionRequest(monitor); // TODO this ignores workspace dependencies
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
index 0470605d..de62f6ad 100644
--- 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
@@ -24,7 +24,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.ui.internal.UpdateConfigurationJob;
import org.eclipse.m2e.internal.discovery.DiscoveryActivator;
@@ -86,12 +85,11 @@ public class UpdateConfigurationStartup implements IStartup {
*/
public static void updateConfiguration() {
Collection<IProject> projects = getMarkedProjects();
- new UpdateConfigurationJob(MavenPlugin.getDefault(), projects.toArray(new IProject[projects.size()])).schedule();
+ new UpdateConfigurationJob(projects.toArray(new IProject[projects.size()])).schedule();
}
private static void updateConfiguration(IProject[] projects) {
- final MavenPlugin plugin = MavenPlugin.getDefault();
- new UpdateConfigurationJob(plugin, projects).schedule();
+ new UpdateConfigurationJob(projects).schedule();
}
private static void addEarlyStartup() {
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentAssistProcessor.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentAssistProcessor.java
index 9b9c475a..5e0c0199 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentAssistProcessor.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentAssistProcessor.java
@@ -330,7 +330,7 @@ public class PomContentAssistProcessor extends XMLContentAssistProcessor {
public static String findRelativePath(ISourceViewer viewer, String groupId, String artifactId, String version) {
if (groupId != null && artifactId != null && version != null) {
- IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectRegistry().getMavenProject(groupId, artifactId, version);
+ IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().getMavenProject(groupId, artifactId, version);
if (facade != null) {
//now add the proposal for relativePath
IFile parentPomFile = facade.getPom();
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java
index 384b7b17..ffd75d31 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java
@@ -49,9 +49,8 @@ class PomTemplateContextUtil {
return descriptor;
}
- MavenPlugin plugin = MavenPlugin.getDefault();
try {
- IMaven embedder = MavenPlugin.getDefault().getMaven();
+ IMaven embedder = MavenPlugin.getMaven();
List<ArtifactRepository> repositories = embedder.getArtifactRepositories();
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
index 2261e7a0..ba210189 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
@@ -81,7 +81,7 @@ public class XmlUtils {
* what is this method supposed to do? for the sourceViewer find the associated file on disk and for
* that one find the IProject it belongs to. The required condition for the IProject instance is that
* project relative path of the file shall only be pom.xml (thus no nested, unopened maven pom).
- * So that when MavenPlugin.getDefault().getMavenProjectManager().getProject(prj); is called later on
+ * So that when MavenPlugin.getMavenProjectManager().getProject(prj); is called later on
* the instance, it actually returns the maven model facade for the pom.xml backing the sourceViewer.
* @param sourceViewer
* @return
@@ -156,12 +156,12 @@ public class XmlUtils {
}
String[] splitStrings = modelId.split(":");
assert splitStrings.length == 3;
- IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectRegistry().getMavenProject(splitStrings[0], splitStrings[1], splitStrings[2]);
+ IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().getMavenProject(splitStrings[0], splitStrings[1], splitStrings[2]);
if (facade != null) {
file = facade.getPomFile();
} else {
//if not in the workspace, try looking into the local repository.
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
try {
String path = maven.getArtifactPath(maven.getLocalRepository(), splitStrings[0], splitStrings[1], splitStrings[2], "pom", null);
if (path != null) {
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java
index 8a315f8c..739ddd30 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java
@@ -655,7 +655,7 @@ public class DependenciesComposite extends Composite {
IRunnableWithProgress projectLoader = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.create(pomEditor.getPomFile(), true, monitor);
if (projectFacade != null) {
hierarchy.addAll(new ParentGatherer(projectFacade.getMavenProject(), projectFacade).getParentHierarchy(monitor));
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java
index d9e06b0b..451cc001 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java
@@ -217,7 +217,7 @@ public class DependencyLabelProvider extends LabelProvider implements IColorProv
}
if(groupId != null && artifactId != null && version != null) {
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.getMavenProject(groupId, artifactId, version);
if(projectFacade != null) {
return isManaged ? MavenImages.getOverlayImage(MavenImages.PATH_PROJECT, MavenImages.PATH_LOCK, IDecoration.BOTTOM_LEFT) : MavenEditorImages.IMG_PROJECT;
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java
index 6e19c569..4b3feb64 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java
@@ -235,10 +235,10 @@ public class ManageDependenciesDialog extends AbstractMavenDialog {
*/
protected void computeResult() {
MavenProject targetPOM = getTargetPOM();
- IMavenProjectFacade targetFacade = MavenPlugin.getDefault().getMavenProjectRegistry()
+ IMavenProjectFacade targetFacade = MavenPlugin.getMavenProjectRegistry()
.getMavenProject(targetPOM.getGroupId(), targetPOM.getArtifactId(), targetPOM.getVersion());
MavenProject currentPOM = projectHierarchy.getFirst();
- IMavenProjectFacade currentFacade = MavenPlugin.getDefault().getMavenProjectRegistry()
+ IMavenProjectFacade currentFacade = MavenPlugin.getMavenProjectRegistry()
.getMavenProject(currentPOM.getGroupId(), currentPOM.getArtifactId(), currentPOM.getVersion());
if (targetFacade == null || currentFacade == null) {
@@ -393,7 +393,7 @@ public class ManageDependenciesDialog extends AbstractMavenDialog {
return;
}
boolean error = false;
- IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectRegistry()
+ IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry()
.getMavenProject(targetProject.getGroupId(), targetProject.getArtifactId(), targetProject.getVersion());
if(facade == null) {
error = true;
@@ -403,7 +403,7 @@ public class ManageDependenciesDialog extends AbstractMavenDialog {
org.apache.maven.model.Model model = null;
if(facade.getMavenProject() == null || facade.getMavenProject().getModel() == null) {
try {
- model = MavenPlugin.getDefault().getMavenModelManager().readMavenModel(facade.getPom());
+ model = MavenPlugin.getMavenModelManager().readMavenModel(facade.getPom());
} catch(CoreException e) {
Object[] arguments = {facade.getPom(), e.getLocalizedMessage()};
String message = NLS.bind(Messages.ManageDependenciesDialog_pomReadingError, arguments);
@@ -471,7 +471,7 @@ public class ManageDependenciesDialog extends AbstractMavenDialog {
public Color getForeground(Object element) {
if(element instanceof MavenProject) {
MavenProject project = (MavenProject) element;
- IMavenProjectFacade search = MavenPlugin.getDefault().getMavenProjectRegistry()
+ IMavenProjectFacade search = MavenPlugin.getMavenProjectRegistry()
.getMavenProject(project.getGroupId(), project.getArtifactId(), project.getVersion());
if(search == null) {
//This project is not in the workspace so we can't really modify it.
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java
index 57d082b7..3e3da0e0 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java
@@ -823,7 +823,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
if(element instanceof DependencyNode) {
DependencyNode node = (DependencyNode) element;
org.sonatype.aether.artifact.Artifact a = node.getDependency().getArtifact();
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.getMavenProject(a.getGroupId(), //
a.getArtifactId(), //
a.getBaseVersion() == null ? a.getVersion() : a.getBaseVersion());
@@ -901,7 +901,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
public Image getImage(Object element) {
if(element instanceof Artifact) {
Artifact a = (Artifact) element;
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.getMavenProject(a.getGroupId(), //
a.getArtifactId(), //
a.getBaseVersion() == null ? a.getVersion() : a.getBaseVersion());
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
index f3faf4a8..812786a6 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
@@ -690,7 +690,7 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
log.error("Unable to read maven project. Dependencies not updated."); //$NON-NLS-1$
return null;
}
- DependencyNode root = MavenPlugin.getDefault().getMavenModelManager().readDependencyTree(mavenProject, classpath, monitor);
+ DependencyNode root = MavenPlugin.getMavenModelManager().readDependencyTree(mavenProject, classpath, monitor);
root.setData("LEVEL", "ROOT");
for (DependencyNode nd : root.getChildren()) {
nd.setData("LEVEL", "DIRECT");
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java
index 63e6979d..29406f76 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java
@@ -588,7 +588,7 @@ public abstract class MavenPomEditorPage extends FormPage {
if (!modulePath.lastSegment().endsWith("pom.xml")) { //$NON-NLS-1$
modulePath = modulePath.append("pom.xml"); //$NON-NLS-1$
}
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade[] facades = projectManager.getProjects();
for(int i = 0; i < facades.length; i++ ) {
if(facades[i].getPom().getLocation().equals(modulePath)) {
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java
index d2a2e6e4..b81bbbf5 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java
@@ -13,7 +13,6 @@ package org.eclipse.m2e.editor.pom;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.m2e.editor.internal.Messages;
import org.eclipse.swt.widgets.Composite;
@@ -24,14 +23,11 @@ public class PomEditorPreferencePage extends FieldEditorPreferencePage implement
public static final String P_DEFAULT_POM_EDITOR_PAGE = "eclipse.m2.defaultPomEditorPage"; //$NON-NLS-1$
public static final String P_SHOW_ADVANCED_TABS = "eclipse.m2.showAdvancedTabs"; //$NON-NLS-1$
- final MavenPlugin plugin;
private Composite parent;
public PomEditorPreferencePage() {
super(GRID);
setPreferenceStore(M2EUIPluginActivator.getDefault().getPreferenceStore());
-
- plugin = MavenPlugin.getDefault();
}
public void init(IWorkbench workbench) {
diff --git a/org.eclipse.m2e.integration.tests.common/src/org/eclipse/m2e/integration/tests/common/UIIntegrationTestCase.java b/org.eclipse.m2e.integration.tests.common/src/org/eclipse/m2e/integration/tests/common/UIIntegrationTestCase.java
index b9a52f54..e9b12ccf 100644
--- a/org.eclipse.m2e.integration.tests.common/src/org/eclipse/m2e/integration/tests/common/UIIntegrationTestCase.java
+++ b/org.eclipse.m2e.integration.tests.common/src/org/eclipse/m2e/integration/tests/common/UIIntegrationTestCase.java
@@ -1251,11 +1251,11 @@ public abstract class UIIntegrationTestCase {
protected void switchToExternalMaven() throws Exception {
MavenRuntime newRuntime = MavenRuntimeManager.createExternalRuntime("C:\\apache-maven-2.1.0");
- List<MavenRuntime> currRuntimes = MavenPlugin.getDefault().getMavenRuntimeManager().getMavenRuntimes();
+ List<MavenRuntime> currRuntimes = MavenPlugin.getMavenRuntimeManager().getMavenRuntimes();
ArrayList<MavenRuntime> list = new ArrayList<MavenRuntime>(currRuntimes);
list.add(newRuntime);
- MavenPlugin.getDefault().getMavenRuntimeManager().setRuntimes(list);
- MavenPlugin.getDefault().getMavenRuntimeManager().setDefaultRuntime(newRuntime);
+ MavenPlugin.getMavenRuntimeManager().setRuntimes(list);
+ MavenPlugin.getMavenRuntimeManager().setDefaultRuntime(newRuntime);
}
protected void updateLocalIndex() throws Exception {
@@ -1373,31 +1373,31 @@ public abstract class UIIntegrationTestCase {
if(settingsFile != null) {
settingsFile = new File(settingsFile).getAbsolutePath();
}
- IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getMavenConfiguration();
String oldUserSettingsFile = mavenConfiguration.getUserSettingsFile();
mavenConfiguration.setUserSettingsFile(settingsFile);
return oldUserSettingsFile;
}
protected static String getUserSettings() {
- IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getMavenConfiguration();
return mavenConfiguration.getUserSettingsFile();
}
protected static void updateRepositoryRegistry() {
try {
- ((RepositoryRegistry) MavenPlugin.getDefault().getRepositoryRegistry()).updateRegistry(monitor);
+ ((RepositoryRegistry) MavenPlugin.getRepositoryRegistry()).updateRegistry(monitor);
} catch(CoreException e) {
throw new IllegalStateException(e);
}
}
protected static void updateIndex(String repoUrl) {
- IRepositoryRegistry repositoryRegistry = MavenPlugin.getDefault().getRepositoryRegistry();
+ IRepositoryRegistry repositoryRegistry = MavenPlugin.getRepositoryRegistry();
for(IRepository repository : repositoryRegistry.getRepositories(IRepositoryRegistry.SCOPE_SETTINGS)) {
if(repository.getUrl().equals(repoUrl)) {
try {
- NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getDefault().getIndexManager();
+ NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getIndexManager();
indexManager.updateIndex(repository, true, monitor);
} catch(CoreException e) {
throw new IllegalStateException(e);
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
index a970a18a..4778a681 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
@@ -161,7 +161,7 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
protected void invokeJavaProjectConfigurators(IClasspathDescriptor classpath, ProjectConfigurationRequest request,
final IProgressMonitor monitor) throws CoreException {
IMavenProjectFacade facade = request.getMavenProjectFacade();
- IProjectConfigurationManager configurationManager = MavenPlugin.getDefault().getProjectConfigurationManager();
+ IProjectConfigurationManager configurationManager = MavenPlugin.getProjectConfigurationManager();
ILifecycleMapping lifecycleMapping = configurationManager.getLifecycleMapping(facade);
if(lifecycleMapping == null) {
return;
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java
index 665661b9..7ed34036 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java
@@ -133,10 +133,10 @@ public class BuildPathManager implements IMavenProjectChangedListener, IResource
BundleContext bundleContext, File stateLocationDir) {
this.projectManager = projectManager;
this.indexManager = indexManager;
- this.mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ this.mavenConfiguration = MavenPlugin.getMavenConfiguration();
this.bundleContext = bundleContext;
this.stateLocationDir = stateLocationDir;
- this.maven = MavenPlugin.getDefault().getMaven();
+ this.maven = MavenPlugin.getMaven();
this.downloadSourcesJob = new DownloadSourcesJob(this);
this.defaultDelegate = new DefaultClasspathManagerDelegate();
}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java
index dba99b50..5d638f8a 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java
@@ -48,8 +48,8 @@ public class DefaultClasspathManagerDelegate implements IClasspathManagerDelegat
private final IMavenProjectRegistry projectManager;
public DefaultClasspathManagerDelegate() {
- this.configurationManager = MavenPlugin.getDefault().getProjectConfigurationManager();
- this.projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ this.configurationManager = MavenPlugin.getProjectConfigurationManager();
+ this.projectManager = MavenPlugin.getMavenProjectRegistry();
}
public void populateClasspath(final IClasspathDescriptor classpath, IMavenProjectFacade projectFacade,
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java
index ced1f875..6c342c50 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java
@@ -115,10 +115,9 @@ class DownloadSourcesJob extends Job implements IBackgroundProcessingQueue {
super(Messages.DownloadSourcesJob_job_download);
this.manager = manager;
- this.maven = MavenPlugin.getDefault().getMaven();
+ this.maven = MavenPlugin.getMaven();
- MavenPlugin plugin = MavenPlugin.getDefault();
- this.projectManager = plugin.getMavenProjectRegistry();
+ this.projectManager = MavenPlugin.getMavenProjectRegistry();
}
public IStatus run(IProgressMonitor monitor) {
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java
index 5af10ce4..bded57f0 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java
@@ -113,7 +113,7 @@ public class JavaElementsAdapterFactory implements IAdapterFactory {
}
private IMavenProjectFacade getProjectFacade(IProject project) {
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
return projectManager.create(project, new NullProgressMonitor());
}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java
index c72843c9..aafb6b69 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java
@@ -56,7 +56,7 @@ public class MavenClasspathContainerInitializer extends ClasspathContainerInitia
}
// force refresh if can't read persisted state
- IMavenConfiguration configuration = MavenPlugin.getDefault().getMavenConfiguration();
+ IMavenConfiguration configuration = MavenPlugin.getMavenConfiguration();
MavenUpdateRequest request = new MavenUpdateRequest(project.getProject(), configuration.isOffline(), false);
getMavenProjectManager().refresh(request);
}
@@ -87,6 +87,6 @@ public class MavenClasspathContainerInitializer extends ClasspathContainerInitia
}
IMavenProjectRegistry getMavenProjectManager() {
- return MavenPlugin.getDefault().getMavenProjectRegistry();
+ return MavenPlugin.getMavenProjectRegistry();
}
}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java
index aadf240e..c0f28d51 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java
@@ -96,7 +96,7 @@ public class OpenJavaDocAction extends ActionDelegate {
final String name = groupId + ":" + artifactId + ":" + version + ":javadoc"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
try {
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
List<ArtifactRepository> artifactRepositories = maven.getArtifactRepositories();
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenRuntimeClasspathProvider.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenRuntimeClasspathProvider.java
index d6862a9d..00bd7066 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenRuntimeClasspathProvider.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenRuntimeClasspathProvider.java
@@ -82,7 +82,7 @@ public class MavenRuntimeClasspathProvider extends StandardClasspathProvider {
supportedTypes.add(MavenRuntimeClasspathProvider.JDT_TESTNG_TEST);
}
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
public IRuntimeClasspathEntry[] computeUnresolvedClasspath(final ILaunchConfiguration configuration) throws CoreException {
boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true);
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/filter/MavenModuleFilter.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/filter/MavenModuleFilter.java
index b44a94e3..4218288d 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/filter/MavenModuleFilter.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/filter/MavenModuleFilter.java
@@ -42,7 +42,7 @@ public class MavenModuleFilter extends ViewerFilter {
IProject project = folder.getProject();
try {
if(project.hasNature(IMavenConstants.NATURE_ID)) {
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.create(project, null);
if(projectFacade != null) {
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
index 0968e2de..b766e165 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
@@ -224,7 +224,7 @@ public class ExecutePomAction implements ILaunchShortcut, IExecutableExtension {
}
private void setProjectConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IContainer basedir) {
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IFile pomFile = basedir.getFile(new Path(IMavenConstants.POM_FILE_NAME));
IMavenProjectFacade projectFacade = projectManager.create(pomFile, false, new NullProgressMonitor());
if(projectFacade != null) {
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java
index f3425268..9443260a 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java
@@ -190,7 +190,7 @@ public class MavenConsoleLineTracker implements IConsoleLineTracker {
}
static IProject getProject(String baseDir) {
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
for(IMavenProjectFacade projectFacade : projectManager.getProjects()) {
IContainer base = projectFacade.getPom().getParent();
String baseLocation = base.getLocation().toPortableString();
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
index c6d4c31e..6cb67e79 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
@@ -222,7 +222,7 @@ public class MavenLaunchDelegate extends JavaLaunchDelegate implements MavenLaun
* Construct string with preferences to pass to JVM as system properties
*/
private String getPreferences(ILaunchConfiguration configuration) throws CoreException {
- IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getMavenConfiguration();
StringBuffer sb = new StringBuffer();
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java
index 29fc057e..25141288 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java
@@ -47,7 +47,7 @@ public class MavenLaunchUtils {
private static final Logger log = LoggerFactory.getLogger(MavenLaunchUtils.class);
public static MavenRuntime getMavenRuntime(ILaunchConfiguration configuration) throws CoreException {
- MavenRuntimeManager runtimeManager = MavenPlugin.getDefault().getMavenRuntimeManager();
+ MavenRuntimeManager runtimeManager = MavenPlugin.getMavenRuntimeManager();
String location = configuration.getAttribute(MavenLaunchConstants.ATTR_RUNTIME, ""); //$NON-NLS-1$
MavenRuntime runtime = runtimeManager.getRuntime(location);
if(runtime == null) {
@@ -84,8 +84,8 @@ public class MavenLaunchUtils {
return;
}
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
+ IMaven maven = MavenPlugin.getMaven();
for(String gav : list) {
// groupId:artifactId:version
StringTokenizer st = new StringTokenizer(gav, ":"); //$NON-NLS-1$
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java
index bb317e82..8f3916cf 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java
@@ -164,7 +164,7 @@ public class MavenSourcePathComputer implements ISourcePathComputer {
private File getSourcesJar(String groupId, String artifactId, String version) {
if (groupId != null && artifactId != null && version != null) {
- IMaven maven = MavenPlugin.getDefault().getMaven();
+ IMaven maven = MavenPlugin.getMaven();
try {
Artifact artifact = maven.resolve(groupId, artifactId, version, "jar", "sources", null, null); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
index e117960d..827fd5e7 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
@@ -459,7 +459,7 @@ public class MavenLaunchMainTab extends AbstractLaunchConfigurationTab implement
}
});
- MavenRuntimeManager runtimeManager = MavenPlugin.getDefault().getMavenRuntimeManager();
+ MavenRuntimeManager runtimeManager = MavenPlugin.getMavenRuntimeManager();
runtimeComboViewer.setInput(runtimeManager.getMavenRuntimes());
runtimeComboViewer.setSelection(new StructuredSelection(runtimeManager.getDefaultRuntime()));
}
@@ -472,7 +472,7 @@ public class MavenLaunchMainTab extends AbstractLaunchConfigurationTab implement
public void widgetSelected(SelectionEvent e) {
PreferencesUtil.createPreferenceDialogOn(getShell(),
"org.eclipse.m2e.core.preferences.MavenInstallationsPreferencePage", null, null).open(); //$NON-NLS-1$
- MavenRuntimeManager runtimeManager = MavenPlugin.getDefault().getMavenRuntimeManager();
+ MavenRuntimeManager runtimeManager = MavenPlugin.getMavenRuntimeManager();
runtimeComboViewer.setInput(runtimeManager.getMavenRuntimes());
runtimeComboViewer.setSelection(new StructuredSelection(runtimeManager.getDefaultRuntime()));
}
@@ -559,9 +559,8 @@ public class MavenLaunchMainTab extends AbstractLaunchConfigurationTab implement
this.profilesText.setText(getAttribute(configuration, ATTR_PROFILES, "")); //$NON-NLS-1$
try {
- MavenPlugin plugin = MavenPlugin.getDefault();
- MavenRuntimeManager runtimeManager = plugin.getMavenRuntimeManager();
- IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ MavenRuntimeManager runtimeManager = MavenPlugin.getMavenRuntimeManager();
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getMavenConfiguration();
this.offlineButton.setSelection(getAttribute(configuration, ATTR_OFFLINE, mavenConfiguration.isOffline()));
this.debugOutputButton.setSelection(getAttribute(configuration, ATTR_DEBUG_OUTPUT, mavenConfiguration.isDebugOutput()));
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
index 8b42b482..954cab0e 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
@@ -73,9 +73,6 @@ public abstract class AbstractPomRefactoring extends Refactoring {
// main file that is being refactored
protected IFile file;
- // maven plugin
- protected MavenPlugin mavenPlugin;
-
// editing domain
protected AdapterFactoryEditingDomain editingDomain;
@@ -84,8 +81,6 @@ public abstract class AbstractPomRefactoring extends Refactoring {
public AbstractPomRefactoring(IFile file) {
this.file = file;
- this.mavenPlugin = MavenPlugin.getDefault();
-
List<AdapterFactoryImpl> factories = new ArrayList<AdapterFactoryImpl>();
factories.add(new ResourceItemProviderAdapterFactory());
factories.add(new ReflectiveItemProviderAdapterFactory());
@@ -107,7 +102,7 @@ public abstract class AbstractPomRefactoring extends Refactoring {
@Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
CompositeChange res = new CompositeChange(getTitle());
- IMavenProjectFacade[] projects = mavenPlugin.getMavenProjectRegistry().getProjects();
+ IMavenProjectFacade[] projects = MavenPlugin.getMavenProjectRegistry().getProjects();
pm.beginTask(Messages.AbstractPomRefactoring_task, projects.length);
models = new HashMap<String, RefactoringModelResources>();
@@ -270,8 +265,8 @@ public abstract class AbstractPomRefactoring extends Refactoring {
protected MavenProject getParentProject(IMavenProjectFacade project, MavenProject current, IProgressMonitor monitor)
throws CoreException {
- IMaven maven = mavenPlugin.getMaven();
- IMavenProjectRegistry projectManager = mavenPlugin.getMavenProjectRegistry();
+ IMaven maven = MavenPlugin.getMaven();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
MavenExecutionRequest request = projectManager.createExecutionRequest(project.getPom(),
project.getResolverConfiguration(), monitor);
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java
index 5597843d..6cb39e16 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java
@@ -82,11 +82,11 @@ public class ExcludeArtifactRefactoring extends Refactoring {
}
protected IMavenProjectFacade getMavenProjectFacade(IFile pom) {
- return MavenPlugin.getDefault().getMavenProjectRegistry().create(pom, true, new NullProgressMonitor());
+ return MavenPlugin.getMavenProjectRegistry().create(pom, true, new NullProgressMonitor());
}
protected IMavenProjectFacade getMavenProjectFacade(MavenProject mavenProject) {
- return MavenPlugin.getDefault().getMavenProjectRegistry()
+ return MavenPlugin.getMavenProjectRegistry()
.getMavenProject(mavenProject.getGroupId(), mavenProject.getArtifactId(), mavenProject.getVersion());
}
@@ -225,7 +225,7 @@ public class ExcludeArtifactRefactoring extends Refactoring {
}
private Visitor locate(MavenProject project, IProgressMonitor monitor) throws CoreException {
- DependencyNode root = MavenPlugin.getDefault().getMavenModelManager()
+ DependencyNode root = MavenPlugin.getMavenModelManager()
.readDependencyTree(project, JavaScopes.TEST, monitor);
Visitor visitor = new Visitor(project);
root.accept(visitor);
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java
index e2a54226..7f23bc58 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java
@@ -55,7 +55,7 @@ public class MavenProjectPomScanner<T> extends AbstractProjectScanner<MavenProje
public MavenProjectPomScanner(boolean developer, Dependency[] dependencies) {
this.developer = developer;
this.dependencies = dependencies;
- this.maven = MavenPlugin.getDefault().getMaven();
+ this.maven = MavenPlugin.getMaven();
}
public String getDescription() {
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java
index 4fff0d12..a282fdbf 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java
@@ -109,14 +109,13 @@ public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
- MavenPlugin plugin = MavenPlugin.getDefault();
- MavenModelManager modelManager = plugin.getMavenModelManager();
+ MavenModelManager modelManager = MavenPlugin.getMavenModelManager();
LocalProjectScanner scanner = new LocalProjectScanner(workspace.getLocation().toFile(), operation.getLocations(),
true, modelManager);
scanner.run(monitor);
- this.projects = plugin.getProjectConfigurationManager().collectProjects(scanner.getProjects());
+ this.projects = MavenPlugin.getProjectConfigurationManager().collectProjects(scanner.getProjects());
if(checkoutAllProjects) {
// check if there any project name conflicts
@@ -210,13 +209,12 @@ public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
}
if(checkoutAllProjects) {
- final MavenPlugin plugin = MavenPlugin.getDefault();
WorkspaceJob job = new AbstactCreateMavenProjectJob(Messages.MavenProjectCheckoutJob_job, workingSets) {
@Override
protected List<IProject> doCreateMavenProjects(IProgressMonitor monitor) throws CoreException {
- Set<MavenProjectInfo> projectSet = plugin.getProjectConfigurationManager().collectProjects(projects);
+ Set<MavenProjectInfo> projectSet = MavenPlugin.getProjectConfigurationManager().collectProjects(projects);
- List<IMavenProjectImportResult> results = plugin.getProjectConfigurationManager().importProjects(
+ List<IMavenProjectImportResult> results = MavenPlugin.getProjectConfigurationManager().importProjects(
projectSet, configuration, monitor);
return toProjects(results);
diff --git a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java
index 072fb09f..29f7742d 100644
--- a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java
+++ b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java
@@ -41,8 +41,8 @@ import org.eclipse.m2e.core.internal.project.registry.MavenProjectFacade;
import org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager;
import org.eclipse.m2e.core.lifecyclemapping.model.IPluginExecutionMetadata;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.project.IProjectConfigurationManager;
import org.eclipse.m2e.core.project.IMavenProjectRegistry;
+import org.eclipse.m2e.core.project.IProjectConfigurationManager;
import org.eclipse.m2e.core.project.ResolverConfiguration;
import org.eclipse.m2e.core.project.configurator.MojoExecutionKey;
@@ -57,8 +57,8 @@ public abstract class AbstractLifecycleMappingTest extends AbstractMavenProjectT
protected void setUp() throws Exception {
super.setUp();
- mavenProjectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
- projectConfigurationManager = MavenPlugin.getDefault().getProjectConfigurationManager();
+ mavenProjectManager = MavenPlugin.getMavenProjectRegistry();
+ projectConfigurationManager = MavenPlugin.getProjectConfigurationManager();
}
@Override
@@ -95,14 +95,14 @@ public abstract class AbstractLifecycleMappingTest extends AbstractMavenProjectT
* Creates new partially initialised MavenProjectFacade instance
*/
protected MavenProjectFacade newMavenProjectFacade(IFile pom) throws CoreException {
- MavenProject mavenProject = plugin.getMaven().readProject(pom.getLocation().toFile(), monitor);
- MavenExecutionRequest request = plugin.getMaven().createExecutionRequest(monitor);
- MavenSession session = plugin.getMaven().createSession(request, mavenProject);
+ MavenProject mavenProject = MavenPlugin.getMaven().readProject(pom.getLocation().toFile(), monitor);
+ MavenExecutionRequest request = MavenPlugin.getMaven().createExecutionRequest(monitor);
+ MavenSession session = MavenPlugin.getMaven().createSession(request, mavenProject);
Map<String, List<MojoExecution>> executionPlans = new LinkedHashMap<String, List<MojoExecution>>();
executionPlans.put(ProjectRegistryManager.LIFECYCLE_CLEAN, new ArrayList<MojoExecution>());
executionPlans.put(
ProjectRegistryManager.LIFECYCLE_DEFAULT,
- plugin
+ MavenPlugin
.getMaven()
.calculateExecutionPlan(session, mavenProject, Arrays.asList(ProjectRegistryManager.LIFECYCLE_DEFAULT),
false, monitor).getMojoExecutions());
diff --git a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractMavenProjectTestCase.java b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractMavenProjectTestCase.java
index 9d181321..1f238ff1 100644
--- a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractMavenProjectTestCase.java
+++ b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractMavenProjectTestCase.java
@@ -85,8 +85,6 @@ public abstract class AbstractMavenProjectTestCase extends TestCase {
protected ProjectRegistryRefreshJob projectRefreshJob;
protected Job downloadSourcesJob;
- protected MavenPlugin plugin;
-
protected IMavenConfiguration mavenConfiguration;
private String oldUserSettingsFile;
@@ -107,15 +105,13 @@ public abstract class AbstractMavenProjectTestCase extends TestCase {
options.put(JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER, ".svn/");
JavaCore.setOptions(options);
- plugin = MavenPlugin.getDefault();
-
projectRefreshJob = MavenPluginActivator.getDefault().getProjectManagerRefreshJob();
projectRefreshJob.sleep();
downloadSourcesJob = ((BuildPathManager) MavenJdtPlugin.getDefault().getBuildpathManager()).getDownloadSourcesJob();
downloadSourcesJob.sleep();
- mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ mavenConfiguration = MavenPlugin.getMavenConfiguration();
oldUserSettingsFile = mavenConfiguration.getUserSettingsFile();
File settings = new File("settings.xml").getCanonicalFile();
@@ -125,7 +121,7 @@ public abstract class AbstractMavenProjectTestCase extends TestCase {
mavenConfiguration.setUserSettingsFile(userSettingsFile);
}
- ArtifactRepository localRepository = MavenPlugin.getDefault().getMaven().getLocalRepository();
+ ArtifactRepository localRepository = MavenPlugin.getMaven().getLocalRepository();
if(localRepository != null) {
repo = new File(localRepository.getBasedir());
} else {
@@ -292,8 +288,7 @@ public abstract class AbstractMavenProjectTestCase extends TestCase {
}
protected IProject[] importProjects(String basedir, String[] pomNames, ResolverConfiguration configuration, boolean skipSanityCheck) throws IOException, CoreException {
- final MavenPlugin plugin = MavenPlugin.getDefault();
- MavenModelManager mavenModelManager = plugin.getMavenModelManager();
+ MavenModelManager mavenModelManager = MavenPlugin.getMavenModelManager();
IWorkspaceRoot root = workspace.getRoot();
File src = new File(basedir);
@@ -315,9 +310,10 @@ public abstract class AbstractMavenProjectTestCase extends TestCase {
workspace.run(new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
- importResults.addAll(plugin.getProjectConfigurationManager().importProjects(projectInfos, importConfiguration, monitor));
+ importResults.addAll(MavenPlugin.getProjectConfigurationManager().importProjects(projectInfos,
+ importConfiguration, monitor));
}
- }, plugin.getProjectConfigurationManager().getRule(), IWorkspace.AVOID_UPDATE, monitor);
+ }, MavenPlugin.getProjectConfigurationManager().getRule(), IWorkspace.AVOID_UPDATE, monitor);
IProject[] projects = new IProject[projectInfos.size()];
for (int i = 0; i < projectInfos.size(); i++) {
@@ -331,7 +327,7 @@ public abstract class AbstractMavenProjectTestCase extends TestCase {
*/
if(!skipSanityCheck) {
Model model = projectInfos.get(0).getModel();
- IMavenProjectFacade facade = plugin.getMavenProjectRegistry().create(projects[i], monitor);
+ IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().create(projects[i], monitor);
if(facade == null) {
fail("Project " + model.getGroupId() + "-" + model.getArtifactId() + "-" + model.getVersion()
+ " was not imported. Errors: "
@@ -361,19 +357,18 @@ public abstract class AbstractMavenProjectTestCase extends TestCase {
copyDir(new File(projectLocation), dir);
File pomFile = new File(dir, IMavenConstants.POM_FILE_NAME);
- Model model = MavenPlugin.getDefault().getMavenModelManager().readMavenModel(pomFile);
+ Model model = MavenPlugin.getMavenModelManager().readMavenModel(pomFile);
final MavenProjectInfo projectInfo = new MavenProjectInfo(projectName, pomFile, model, null);
setBasedirRename(projectInfo);
- final MavenPlugin plugin = MavenPlugin.getDefault();
-
workspace.run(new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
- plugin.getProjectConfigurationManager().importProjects(Collections.singleton(projectInfo), importConfiguration, monitor);
+ MavenPlugin.getProjectConfigurationManager().importProjects(Collections.singleton(projectInfo),
+ importConfiguration, monitor);
IProject project = workspace.getRoot().getProject(importConfiguration.getProjectName(projectInfo.getModel()));
assertNotNull("Failed to import project " + projectInfo, project);
}
- }, plugin.getProjectConfigurationManager().getRule(), IWorkspace.AVOID_UPDATE, monitor);
+ }, MavenPlugin.getProjectConfigurationManager().getRule(), IWorkspace.AVOID_UPDATE, monitor);
return workspace.getRoot().getProject(projectName);
}
@@ -447,7 +442,7 @@ public abstract class AbstractMavenProjectTestCase extends TestCase {
}
protected void injectFilexWagon() throws Exception {
- PlexusContainer container = ((MavenImpl) MavenPlugin.getDefault().getMaven()).getPlexusContainer();
+ PlexusContainer container = ((MavenImpl) MavenPlugin.getMaven()).getPlexusContainer();
if(container.getContainerRealm().getResource(FilexWagon.class.getName().replace('.', '/') + ".class") == null) {
container.getContainerRealm().importFrom(FilexWagon.class.getClassLoader(), FilexWagon.class.getName());
ComponentDescriptor<Wagon> descriptor = new ComponentDescriptor<Wagon>();
diff --git a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/MavenHelpers.java b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/MavenHelpers.java
index f895a3ab..f9c3e2ea 100644
--- a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/MavenHelpers.java
+++ b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/MavenHelpers.java
@@ -25,14 +25,14 @@ public class MavenHelpers {
if(settingsFile != null && settingsFile.length() > 0) {
settingsFile = new File(settingsFile).getAbsolutePath();
}
- IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getMavenConfiguration();
String oldUserSettingsFile = mavenConfiguration.getUserSettingsFile();
mavenConfiguration.setUserSettingsFile(settingsFile);
return oldUserSettingsFile;
}
public static String getUserSettings() {
- IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getMavenConfiguration();
return mavenConfiguration.getUserSettingsFile();
}

Back to the top