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/Messages.java8
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties6
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java25
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java28
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/WarningsPreferencePage.java73
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfiguration.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java16
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/NotCoveredMojoExecution.java13
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java19
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceConstants.java15
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceInitializer.java1
11 files changed, 189 insertions, 23 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java
index 11e4dcce..d0c06bcb 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java
@@ -379,12 +379,16 @@ public class Messages extends NLS {
public static String MavenPomWizardPage_title;
+ public static String MavenPreferencePage_changingPreferencesRequiresProjectUpdate;
+
public static String MavenPreferencePage_download;
public static String MavenPreferencePage_hide;
public static String MavenPreferencePage_update;
+ public static String MavenPreferencePage_updateProjectRequired_title;
+
public static String MavenProjectPreferencePage_btnResolve;
public static String MavenProjectPreferencePage_dialog_message;
@@ -571,6 +575,8 @@ public class Messages extends NLS {
public static String MavenWarningsPreferencePage_groupidDupParent;
+ public static String MavenWarningsPreferencePage_notCoveredMojoExecution;
+
public static String MavenWarningsPreferencePage_versionDupParent;
public static String MavenPreferencePage_warnIncompleteMapping;
@@ -651,6 +657,8 @@ public class Messages extends NLS {
public static String UpdateSourcesAction_job_update_conf;
+ public static String MavenWarningsPreferencePage_changingProblemSeveritiesRequiresProjectUpdate;
+
public static String WorkingSetGroup_btnAddSet;
public static String WorkingSetGroup_btnMore;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties
index 65da0c45..77c9a9e8 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties
@@ -223,9 +223,11 @@ MavenPomWizard_title=Maven POM wizard
MavenPreferencePage_download=Download repository index updates on startup
MavenPreferencePage_hide=Hide folders of physically nested modules (experimental)
MavenPreferencePage_update=Update Maven projects on startup
+MavenPreferencePage_updateProjectRequired_title=Update project required
MavenPreferencePage_warnIncompleteMapping=Hide warning for incomplete mapping
+MavenPreferencePage_changingPreferencesRequiresProjectUpdate=Changing the checksum policy requires updating the Maven projects for the changes to take effect. Do you want to update projects now?
MavenProjectPreferencePage_btnResolve=Resolve dependencies from &Workspace projects
-MavenProjectPreferencePage_dialog_message=Maven settings has changed. Do you want to update project configuration?
+MavenProjectPreferencePage_dialog_message=Maven settings have changed. Do you want to update project configuration?
MavenProjectPreferencePage_dialog_title=Maven Settings
MavenProjectPreferencePage_job=Updating {0} Sources
MavenProjectPreferencePage_lblProfiles=Active Maven &Profiles (comma separated)\:
@@ -318,7 +320,9 @@ MavenWarningsPreferencePage_Ignore=Ignore
MavenWarningsPreferencePage_Warning=Warning
MavenWarningsPreferencePage_OutOfDate_Project_Config=Out-of-date project configuration
MavenWarningsPreferencePage_groupidDupParent="groupId" duplicate of parent groupId
+MavenWarningsPreferencePage_notCoveredMojoExecution=Plugin execution not covered by lifecycle configuration
MavenWarningsPreferencePage_versionDupParent="version" duplicate of parent version
+MavenWarningsPreferencePage_changingProblemSeveritiesRequiresProjectUpdate=Changing problems severity requires updating the Maven projects for the changes to take effect. Do you want to update projects now?
NestedProjectsComposite_Add_OutOfDate=Add out-of-date
NestedProjectsComposite_Multiple_OOD_Projects_Link={0} unselected projects are out of date and should be updated. <A>Click here</A> to include them.
NestedProjectsComposite_OutOfDateProjectBtn_AddOneProject_Tooltip=Add out-of-date project to the selection
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 5b5af0e9..75d57d5d 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
@@ -15,10 +15,8 @@ package org.eclipse.m2e.core.ui.internal.preferences;
import java.util.ArrayList;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.ComboFieldEditor;
import org.eclipse.jface.preference.FieldEditor;
@@ -38,7 +36,7 @@ import org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob;
public class MavenPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
- private static final Logger log = LoggerFactory.getLogger(MavenPreferencePage.class);
+ //private static final Logger log = LoggerFactory.getLogger(MavenPreferencePage.class);
private String originalChecksumPolicy;
@@ -124,14 +122,19 @@ public class MavenPreferencePage extends FieldEditorPreferencePage implements IW
if(updateRequired) {
IMavenProjectFacade[] facades = MavenPlugin.getMavenProjectRegistry().getProjects();
if(facades != null && facades.length > 0) {
- ArrayList<IProject> allProjects = new ArrayList<IProject>(facades.length);
- for(IMavenProjectFacade facade : facades) {
- allProjects.add(facade.getProject());
+ boolean proceed = MessageDialog.openQuestion(getShell(),
+ Messages.MavenPreferencePage_updateProjectRequired_title,
+ Messages.MavenPreferencePage_changingPreferencesRequiresProjectUpdate);
+ if(proceed) {
+ ArrayList<IProject> allProjects = new ArrayList<IProject>(facades.length);
+ for(IMavenProjectFacade facade : facades) {
+ allProjects.add(facade.getProject());
+ }
+ new UpdateMavenProjectJob(
+ allProjects.toArray(new IProject[allProjects.size()]), //
+ MavenPlugin.getMavenConfiguration().isOffline(), true /*forceUpdateDependencies*/,
+ false /*updateConfiguration*/, true /*rebuild*/, true /*refreshFromLocal*/).schedule();
}
- new UpdateMavenProjectJob(
- allProjects.toArray(new IProject[allProjects.size()]), //
- MavenPlugin.getMavenConfiguration().isOffline(), true /*forceUpdateDependencies*/,
- false /*updateConfiguration*/, true /*rebuild*/, true /*refreshFromLocal*/).schedule();
}
}
originalChecksumPolicy = newChecksumPolicy;
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 78fd80ba..7a297379 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
@@ -28,6 +28,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
@@ -57,6 +58,8 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.FileStoreEditorInput;
import org.eclipse.ui.ide.IDE;
+import org.codehaus.plexus.util.StringUtils;
+
import org.apache.maven.cli.MavenCli;
import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.settings.Settings;
@@ -116,6 +119,24 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
final String userSettings = getUserSettings();
final String globalSettings = getGlobalSettings();
+ String currentGlobalSettings = mavenConfiguration.getGlobalSettingsFile();
+ String currentUserSettings = mavenConfiguration.getUserSettingsFile();
+ if(StringUtils.equals(globalSettings, currentGlobalSettings)
+ && StringUtils.equals(currentUserSettings, userSettings)) {
+ return;
+ }
+
+ final Boolean[] updateProjects = new Boolean[1];
+ updateProjects[0] = updateMavenDependencies;
+ if(updateMavenDependencies) {
+ IMavenProjectFacade[] projects = MavenPlugin.getMavenProjectRegistry().getProjects();
+ if(projects != null && projects.length > 0) {
+ updateProjects[0] = MessageDialog.openQuestion(getShell(),
+ Messages.MavenPreferencePage_updateProjectRequired_title,
+ Messages.MavenProjectPreferencePage_dialog_message);
+ }
+ }
+
new Job(Messages.MavenSettingsPreferencePage_job_updating) {
protected IStatus run(IProgressMonitor monitor) {
try {
@@ -130,11 +151,12 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
IndexManager indexManager = MavenPlugin.getIndexManager();
indexManager.getWorkspaceIndex().updateIndex(true, monitor);
}
- if(updateMavenDependencies) {
+ if(updateProjects[0]) {
IMavenProjectFacade[] projects = MavenPlugin.getMavenProjectRegistry().getProjects();
ArrayList<IProject> allProjects = new ArrayList<IProject>();
- if(projects != null) {
+ if(projects != null && projects.length > 0) {
MavenPlugin.getMaven().reloadSettings();
+
SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, projects.length);
for(int i = 0; i < projects.length; i++ ) {
subMonitor
@@ -167,7 +189,7 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
@Override
public boolean performOk() {
- updateSettings(false);
+ updateSettings(true);
return true;
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/WarningsPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/WarningsPreferencePage.java
index a462b671..e58eb156 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/WarningsPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/WarningsPreferencePage.java
@@ -14,8 +14,18 @@ package org.eclipse.m2e.core.ui.internal.preferences;
import static org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants.P_DUP_OF_PARENT_GROUPID_PB;
import static org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants.P_DUP_OF_PARENT_VERSION_PB;
+import static org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants.P_NOT_COVERED_MOJO_EXECUTION_PB;
import static org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants.P_OUT_OF_DATE_PROJECT_CONFIG_PB;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.ComboFieldEditor;
import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
@@ -23,9 +33,14 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.codehaus.plexus.util.StringUtils;
+
+import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.internal.preferences.ProblemSeverity;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.m2e.core.ui.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob;
public class WarningsPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
@@ -37,6 +52,11 @@ public class WarningsPreferencePage extends FieldEditorPreferencePage implements
private Composite parent;
+ private static List<String> SENSIBLE_PREFERENCES = Arrays.asList(P_DUP_OF_PARENT_GROUPID_PB,
+ P_DUP_OF_PARENT_VERSION_PB, P_NOT_COVERED_MOJO_EXECUTION_PB, P_OUT_OF_DATE_PROJECT_CONFIG_PB);
+
+ private Map<String, String> originalValues = new HashMap<String, String>();
+
public WarningsPreferencePage() {
super(GRID);
setPreferenceStore(M2EUIPluginActivator.getDefault().getPreferenceStore());
@@ -61,10 +81,63 @@ public class WarningsPreferencePage extends FieldEditorPreferencePage implements
addField(getDefaultCombo(P_OUT_OF_DATE_PROJECT_CONFIG_PB, //
Messages.MavenWarningsPreferencePage_OutOfDate_Project_Config, parent));
+
+ addField(getDefaultCombo(P_NOT_COVERED_MOJO_EXECUTION_PB, //
+ Messages.MavenWarningsPreferencePage_notCoveredMojoExecution, parent));
+
+ initOriginalValues();
+
+ }
+
+ private void initOriginalValues() {
+ originalValues.clear();
+ for(String pref : SENSIBLE_PREFERENCES) {
+ originalValues.put(pref, getPreferenceStore().getString(pref));
+ }
}
private FieldEditor getDefaultCombo(String key, String label, Composite parent) {
return new ComboFieldEditor(key, label, ERROR_SEVERITIES, parent);
}
+ @Override
+ public boolean performOk() {
+ boolean result = super.performOk();
+ if(result) {
+ updateProjects();
+ }
+ return result;
+ }
+
+ private void updateProjects() {
+ //Update projects if problem severities changed
+ if(isDirty()) {
+ IMavenProjectFacade[] facades = MavenPlugin.getMavenProjectRegistry().getProjects();
+ if(facades != null && facades.length > 0) {
+ boolean proceed = MessageDialog.openQuestion(getShell(),
+ Messages.MavenPreferencePage_updateProjectRequired_title,
+ Messages.MavenWarningsPreferencePage_changingProblemSeveritiesRequiresProjectUpdate);
+ if(proceed) {
+ ArrayList<IProject> allProjects = new ArrayList<IProject>(facades.length);
+ for(IMavenProjectFacade facade : facades) {
+ allProjects.add(facade.getProject());
+ }
+ new UpdateMavenProjectJob(
+ allProjects.toArray(new IProject[allProjects.size()]), //
+ MavenPlugin.getMavenConfiguration().isOffline(), true /*forceUpdateDependencies*/,
+ false /*updateConfiguration*/, true /*rebuild*/, true /*refreshFromLocal*/).schedule();
+ initOriginalValues();
+ }
+ }
+ }
+ }
+
+ private boolean isDirty() {
+ for(Entry<String, String> original : originalValues.entrySet()) {
+ if(!StringUtils.equals(original.getValue(), getPreferenceStore().getString(original.getKey()))) {
+ return true;
+ }
+ }
+ return false;
+ }
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfiguration.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfiguration.java
index 78d42897..ae5cd76d 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfiguration.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfiguration.java
@@ -94,4 +94,12 @@ public interface IMavenConfiguration {
*/
public String getGlobalChecksumPolicy();
+ /**
+ * Returns {@link IMarker} severity of "Not Covered Mojo Execution" problem.
+ *
+ * @return One of <code>ignore</code>, <code>warning</code> or <code>error</code>.
+ * @since 1.5
+ */
+ public String getNotCoveredMojoExecutionSeverity();
+
}
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 261e1e86..c096cbcd 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
@@ -82,6 +82,7 @@ import org.eclipse.m2e.core.internal.lifecyclemapping.model.io.xpp3.LifecycleMap
import org.eclipse.m2e.core.internal.markers.MavenProblemInfo;
import org.eclipse.m2e.core.internal.markers.SourceLocation;
import org.eclipse.m2e.core.internal.markers.SourceLocationHelper;
+import org.eclipse.m2e.core.internal.preferences.ProblemSeverity;
import org.eclipse.m2e.core.internal.project.registry.EclipseWorkspaceArtifactRepository;
import org.eclipse.m2e.core.internal.project.registry.MavenProjectFacade;
import org.eclipse.m2e.core.lifecyclemapping.model.IPluginExecutionMetadata;
@@ -688,15 +689,21 @@ public class LifecycleMappingFactory {
return;
}
+ ProblemSeverity notCoveredMojoExecutionSeverity = ProblemSeverity.get(MavenPlugin.getMavenConfiguration()
+ .getNotCoveredMojoExecutionSeverity());
+
+ boolean reportNotCoveredMojoExecutionProblems = !ProblemSeverity.ignore.equals(notCoveredMojoExecutionSeverity);
+
Map<String, AbstractProjectConfigurator> configurators = new LinkedHashMap<String, AbstractProjectConfigurator>();
for(Map.Entry<MojoExecutionKey, List<IPluginExecutionMetadata>> entry : map.entrySet()) {
MojoExecutionKey executionKey = entry.getKey();
List<IPluginExecutionMetadata> executionMetadatas = entry.getValue();
if(executionMetadatas == null || executionMetadatas.isEmpty()) {
- if(isInterestingPhase(executionKey.getLifecyclePhase())) {
+ if(reportNotCoveredMojoExecutionProblems && isInterestingPhase(executionKey.getLifecyclePhase())) {
SourceLocation markerLocation = SourceLocationHelper.findLocation(mavenProject, executionKey);
- result.addProblem(new NotCoveredMojoExecution(executionKey, markerLocation));
+ result.addProblem(new NotCoveredMojoExecution(executionKey, notCoveredMojoExecutionSeverity.getSeverity(),
+ markerLocation));
}
continue;
}
@@ -730,7 +737,10 @@ public class LifecycleMappingFactory {
log.debug("Could not instantiate project configurator {}.", configuratorId, e);
SourceLocation markerLocation = SourceLocationHelper.findLocation(mavenProject, executionKey);
result.addProblem(new MissingConfiguratorProblemInfo(configuratorId, markerLocation));
- result.addProblem(new NotCoveredMojoExecution(executionKey, markerLocation));
+ if(reportNotCoveredMojoExecutionProblems) {
+ result.addProblem(new NotCoveredMojoExecution(executionKey, notCoveredMojoExecutionSeverity
+ .getSeverity(), markerLocation));
+ }
}
break;
case ignore:
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/NotCoveredMojoExecution.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/NotCoveredMojoExecution.java
index 5365b85d..a3d545b3 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/NotCoveredMojoExecution.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/NotCoveredMojoExecution.java
@@ -23,8 +23,19 @@ import org.eclipse.m2e.core.project.configurator.MojoExecutionKey;
public class NotCoveredMojoExecution extends MojoExecutionProblemInfo {
+ /**
+ * @deprecated use {@link #NotCoveredMojoExecution(MojoExecutionKey, int, SourceLocation)}
+ */
+ @Deprecated
public NotCoveredMojoExecution(MojoExecutionKey mojoExecutionKey, SourceLocation markerLocation) {
- super(NLS.bind(Messages.LifecycleConfigurationPluginExecutionNotCovered, mojoExecutionKey.toString()),
+ this(mojoExecutionKey, IMarker.SEVERITY_ERROR, markerLocation);
+ }
+
+ /**
+ * @since 1.5
+ */
+ public NotCoveredMojoExecution(MojoExecutionKey mojoExecutionKey, int severity, SourceLocation markerLocation) {
+ super(NLS.bind(Messages.LifecycleConfigurationPluginExecutionNotCovered, mojoExecutionKey.toString()), severity,
mojoExecutionKey, markerLocation);
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java
index 650bc77d..c081966d 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java
@@ -277,4 +277,23 @@ public class MavenConfigurationImpl implements IMavenConfiguration, IPreferenceC
throw new IllegalArgumentException(checksumPolicy + " is not a valid checksum policy");
}
}
+
+ @Override
+ public String getNotCoveredMojoExecutionSeverity() {
+ return preferenceStore.get(MavenPreferenceConstants.P_NOT_COVERED_MOJO_EXECUTION_PB,
+ ProblemSeverity.error.toString(), preferencesLookup);
+ }
+
+ /**
+ * For testing purposes only
+ */
+ public void setNotCoveredMojoExecutionSeverity(String severity) throws CoreException {
+ if(severity == null) {
+ preferencesLookup[0].remove(MavenPreferenceConstants.P_NOT_COVERED_MOJO_EXECUTION_PB);
+ } else {
+ preferencesLookup[0].put(MavenPreferenceConstants.P_NOT_COVERED_MOJO_EXECUTION_PB, severity);
+ }
+ preferenceStore.applyPreferences(preferencesLookup[0], new IPreferenceFilter[] {getPreferenceFilter()});
+ }
+
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceConstants.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceConstants.java
index 64d063cc..f0ffce79 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceConstants.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceConstants.java
@@ -114,31 +114,38 @@ public interface MavenPreferenceConstants {
+ ".disableVersionDuplicateOfParentWarning"; //$NON-NLS-1$
/**
- * @since 1.5.0
+ * @since 1.5
**/
static final String PROBLEM_PREFIX = PREFIX + "problem.";
/**
* Valid values : ignore, warning or error
*
- * @since 1.5.0
+ * @since 1.5
**/
public static final String P_DUP_OF_PARENT_GROUPID_PB = PROBLEM_PREFIX + "duplicateParentGroupId"; //$NON-NLS-1$
/**
* Valid values : ignore, warning or error
*
- * @since 1.5.0
+ * @since 1.5
**/
public static final String P_DUP_OF_PARENT_VERSION_PB = PROBLEM_PREFIX + "duplicateParentVersion"; //$NON-NLS-1$
/**
* Valid values : ignore, warning or error
*
- * @since 1.5.0
+ * @since 1.5
**/
public static final String P_OUT_OF_DATE_PROJECT_CONFIG_PB = PROBLEM_PREFIX + "outofdateProjectConfig"; //$NON-NLS-1$
+ /**
+ * Valid values : ignore, warning or error
+ *
+ * @since 1.5
+ **/
+ public static final String P_NOT_COVERED_MOJO_EXECUTION_PB = PROBLEM_PREFIX + "notCoveredMojoExecution"; //$NON-NLS-1$
+
/** string **/
public static final String P_LIFECYCLE_MAPPINGS = PREFIX + "lifecycleMappings"; //$NON-NLS-1$
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceInitializer.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceInitializer.java
index 4b12c601..be84d110 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceInitializer.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceInitializer.java
@@ -53,6 +53,7 @@ public class MavenPreferenceInitializer extends AbstractPreferenceInitializer {
store.put(MavenPreferenceConstants.P_DUP_OF_PARENT_GROUPID_PB, ProblemSeverity.warning.toString());
store.put(MavenPreferenceConstants.P_DUP_OF_PARENT_VERSION_PB, ProblemSeverity.warning.toString());
store.put(MavenPreferenceConstants.P_OUT_OF_DATE_PROJECT_CONFIG_PB, ProblemSeverity.error.toString());
+ store.put(MavenPreferenceConstants.P_NOT_COVERED_MOJO_EXECUTION_PB, ProblemSeverity.error.toString());
// set to null since the plugin state location is not available by the time execution reaches here
store.remove(MavenPreferenceConstants.P_WORKSPACE_MAPPINGS_LOCATION);

Back to the top