Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.m2e.core.ui/plugin.properties2
-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.properties8
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/WarningsPreferencePage.java37
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfiguration.java11
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java17
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceConstants.java42
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceInitializer.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/ProblemSeverity.java51
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java18
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java25
11 files changed, 187 insertions, 36 deletions
diff --git a/org.eclipse.m2e.core.ui/plugin.properties b/org.eclipse.m2e.core.ui/plugin.properties
index b30c9a98..3c98d8ba 100644
--- a/org.eclipse.m2e.core.ui/plugin.properties
+++ b/org.eclipse.m2e.core.ui/plugin.properties
@@ -78,7 +78,7 @@ page.installations.name = Installations
page.usersettings.name = User Settings
page.archetypes.name = Archetypes
page.userinterface.name = User Interface
-page.warnings.name = Warnings
+page.warnings.name = Errors/Warnings
page.lifecyclemapping.name = Lifecycle Mappings
category.general.name = General
wizard.install.name = Install or deploy an artifact to a Maven repository
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 0564efaa..b8e7033e 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
@@ -561,6 +561,14 @@ public class Messages extends NLS {
public static String MavenSettingsPreferencePage_title;
+ public static String MavenWarningsPreferencePage_Error;
+
+ public static String MavenWarningsPreferencePage_Ignore;
+
+ public static String MavenWarningsPreferencePage_Warning;
+
+ public static String MavenWarningsPreferencePage_OutOfDate_Project_Config;
+
public static String MavenWarningsPreferencePage_groupidDupParent;
public static String MavenWarningsPreferencePage_versionDupParent;
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 25525786..b239d75a 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
@@ -313,8 +313,12 @@ MavenSettingsPreferencePage_globalSettingslink2=Global &Settings (<a href\="\#">
MavenSettingsPreferencePage_globalSettingslink_tooltip=Open editor for global settings
MavenSettingsPreferencePage_task_updating=Updating progress for {0}
MavenSettingsPreferencePage_title=Maven User Settings
-MavenWarningsPreferencePage_groupidDupParent=Disable "{0}" warning
-MavenWarningsPreferencePage_versionDupParent=Disable "{0}" warning
+MavenWarningsPreferencePage_Error=Error
+MavenWarningsPreferencePage_Ignore=Ignore
+MavenWarningsPreferencePage_Warning=Warning
+MavenWarningsPreferencePage_OutOfDate_Project_Config=Out-of-date project configuration
+MavenWarningsPreferencePage_groupidDupParent="groupId" duplicate of parent groupId
+MavenWarningsPreferencePage_versionDupParent="version" duplicate of parent version
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/WarningsPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/WarningsPreferencePage.java
index 48cc049c..a462b671 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Rob Newton.
+ * Copyright (c) 2012-2014 Rob Newton and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,24 +7,34 @@
*
* Contributors:
* Rob Newton - initial warnings preference page
+ * Fred Bricon (Red Hat, Inc.) - use combos for problem severity
*******************************************************************************/
package org.eclipse.m2e.core.ui.internal.preferences;
-import org.eclipse.jface.preference.BooleanFieldEditor;
+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_OUT_OF_DATE_PROJECT_CONFIG_PB;
+
+import org.eclipse.jface.preference.ComboFieldEditor;
+import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+import org.eclipse.m2e.core.internal.preferences.ProblemSeverity;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.m2e.core.ui.internal.Messages;
public class WarningsPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public static String[][] ERROR_SEVERITIES = new String[][] {
+ new String[] {Messages.MavenWarningsPreferencePage_Ignore, ProblemSeverity.ignore.toString()},
+ new String[] {Messages.MavenWarningsPreferencePage_Warning, ProblemSeverity.warning.toString()},
+ new String[] {Messages.MavenWarningsPreferencePage_Error, ProblemSeverity.error.toString()}};
+
private Composite parent;
public WarningsPreferencePage() {
@@ -42,14 +52,19 @@ public class WarningsPreferencePage extends FieldEditorPreferencePage implements
*/
public void createFieldEditors() {
parent = getFieldEditorParent();
- String text;
- text = NLS.bind(Messages.MavenWarningsPreferencePage_groupidDupParent,
- org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_duplicate_groupid);
- addField(new BooleanFieldEditor(MavenPreferenceConstants.P_DISABLE_GROUPID_DUP_OF_PARENT_WARNING, text, parent));
+ addField(getDefaultCombo(P_DUP_OF_PARENT_GROUPID_PB, //
+ Messages.MavenWarningsPreferencePage_groupidDupParent, parent));
+
+ addField(getDefaultCombo(P_DUP_OF_PARENT_VERSION_PB, //
+ Messages.MavenWarningsPreferencePage_versionDupParent, parent));
- text = NLS.bind(Messages.MavenWarningsPreferencePage_versionDupParent,
- org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_duplicate_version);
- addField(new BooleanFieldEditor(MavenPreferenceConstants.P_DISABLE_VERSION_DUP_OF_PARENT_WARNING, text, parent));
+ addField(getDefaultCombo(P_OUT_OF_DATE_PROJECT_CONFIG_PB, //
+ Messages.MavenWarningsPreferencePage_OutOfDate_Project_Config, parent));
}
+
+ private FieldEditor getDefaultCombo(String key, String label, Composite parent) {
+ return new ComboFieldEditor(key, label, ERROR_SEVERITIES, parent);
+ }
+
}
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 0ffcb5ad..bca5f987 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008-2014 Sonatype, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
package org.eclipse.m2e.core.embedder;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
@@ -69,4 +70,12 @@ public interface IMavenConfiguration {
public String getWorkspaceLifecycleMappingMetadataFile();
public void setWorkspaceLifecycleMappingMetadataFile(String location) throws CoreException;
+
+ /**
+ * Returns {@link IMarker} severity of "out-of-date" project problem
+ *
+ * @return One of <code>ignore</code>, <code>warning</code> or <code>error</code>.
+ * @since 1.5.0
+ */
+ public String getOutOfDateProjectSeverity();
}
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 31998624..226ba80a 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
@@ -238,4 +238,21 @@ public class MavenConfigurationImpl implements IMavenConfiguration, IPreferenceC
}
preferenceStore.applyPreferences(preferencesLookup[0], new IPreferenceFilter[] {getPreferenceFilter()});
}
+
+ public String getOutOfDateProjectSeverity() {
+ return preferenceStore.get(MavenPreferenceConstants.P_OUT_OF_DATE_PROJECT_CONFIG_PB,
+ ProblemSeverity.error.toString(), preferencesLookup);
+ }
+
+ /**
+ * For testing purposes only
+ */
+ public void setOutOfDateProjectSeverity(String severity) throws CoreException {
+ if(severity == null) {
+ preferencesLookup[0].remove(MavenPreferenceConstants.P_OUT_OF_DATE_PROJECT_CONFIG_PB);
+ } else {
+ preferencesLookup[0].put(MavenPreferenceConstants.P_OUT_OF_DATE_PROJECT_CONFIG_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 7e545fae..7751e951 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008-2014 Sonatype, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -95,14 +95,50 @@ public interface MavenPreferenceConstants {
/** boolean **/
public static final String P_DEFAULT_POM_EDITOR_PAGE = "eclipse.m2.defaultPomEditorPage"; //$NON-NLS-1$
- /** boolean **/
+ /**
+ * boolean
+ *
+ * @deprecated Use {@link MavenPreferenceConstants#P_DUP_OF_PARENT_GROUPID_PB} instead
+ */
+ @Deprecated
public static final String P_DISABLE_GROUPID_DUP_OF_PARENT_WARNING = PREFIX
+ ".disableGroupIdDuplicateOfParentWarning"; //$NON-NLS-1$
- /** boolean **/
+ /**
+ * boolean
+ *
+ * @deprecated Use {@link MavenPreferenceConstants#P_DISABLE_VERSION_DUP_OF_PARENT_WARNING} instead
+ */
+ @Deprecated
public static final String P_DISABLE_VERSION_DUP_OF_PARENT_WARNING = PREFIX
+ ".disableVersionDuplicateOfParentWarning"; //$NON-NLS-1$
+ /**
+ * @since 1.5.0
+ **/
+ static final String PROBLEM_PREFIX = PREFIX + "problem.";
+
+ /**
+ * Valid values : ignore, warning or error
+ *
+ * @since 1.5.0
+ **/
+ 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
+ **/
+ 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
+ **/
+ public static final String P_OUT_OF_DATE_PROJECT_CONFIG_PB = PROBLEM_PREFIX + "outofdateProjectConfig"; //$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 44cb40d3..4b12c601 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
@@ -50,6 +50,10 @@ public class MavenPreferenceInitializer extends AbstractPreferenceInitializer {
store.putBoolean(MavenPreferenceConstants.P_SHOW_CONSOLE_ON_ERR, true);
store.putBoolean(MavenPreferenceConstants.P_SHOW_CONSOLE_ON_OUTPUT, false);
+ 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());
+
// set to null since the plugin state location is not available by the time execution reaches here
store.remove(MavenPreferenceConstants.P_WORKSPACE_MAPPINGS_LOCATION);
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/ProblemSeverity.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/ProblemSeverity.java
new file mode 100644
index 00000000..10ca96d0
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/ProblemSeverity.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.preferences;
+
+import org.eclipse.core.resources.IMarker;
+
+
+/**
+ * Problem Severity enum mapping {@link IMarker} severities
+ *
+ * @author Fred Bricon
+ * @since 1.5.0
+ */
+public enum ProblemSeverity {
+
+ ignore(-1), info(IMarker.SEVERITY_INFO), warning(IMarker.SEVERITY_WARNING), error(IMarker.SEVERITY_ERROR);
+
+ private int severity;
+
+ ProblemSeverity(int severity) {
+ this.severity = severity;
+ }
+
+ /**
+ * Returns matching {@link IMarker} severity value or -1 if ignore
+ *
+ * @see {@link IMarker#SEVERITY}
+ */
+ public int getSeverity() {
+ return severity;
+ }
+
+ public static ProblemSeverity get(String value) {
+ try {
+ if(value != null) {
+ return ProblemSeverity.valueOf(value);
+ }
+ } catch(IllegalArgumentException iae) {
+ }
+ return ProblemSeverity.error;
+ }
+}
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 8d549d04..4edbcd24 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2013 Sonatype, Inc.
+ * Copyright (c) 2008-2014 Sonatype, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,7 +33,6 @@ import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
@@ -79,6 +78,7 @@ import org.eclipse.m2e.core.internal.embedder.AbstractRunnable;
import org.eclipse.m2e.core.internal.embedder.MavenExecutionContext;
import org.eclipse.m2e.core.internal.lifecyclemapping.LifecycleMappingFactory;
import org.eclipse.m2e.core.internal.markers.IMavenMarkerManager;
+import org.eclipse.m2e.core.internal.preferences.ProblemSeverity;
import org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager;
import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
@@ -961,11 +961,15 @@ public class ProjectConfigurationManager implements IProjectConfigurationManager
}
if(facade != null) {
- LifecycleMappingConfiguration oldConfiguration = LifecycleMappingConfiguration.restore(facade, monitor);
- if(oldConfiguration != null
- && LifecycleMappingFactory.isLifecycleMappingChanged(facade, oldConfiguration, monitor)) {
- mavenMarkerManager.addMarker(facade.getProject(), IMavenConstants.MARKER_CONFIGURATION_ID,
- Messages.ProjectConfigurationUpdateRequired, -1, IMarker.SEVERITY_ERROR);
+ ProblemSeverity outOfDateSeverity = ProblemSeverity.get(mavenConfiguration.getOutOfDateProjectSeverity());
+ mavenMarkerManager.deleteMarkers(facade.getProject(), IMavenConstants.MARKER_CONFIGURATION_ID);
+ if(!ProblemSeverity.ignore.equals(outOfDateSeverity)) {
+ LifecycleMappingConfiguration oldConfiguration = LifecycleMappingConfiguration.restore(facade, monitor);
+ if(oldConfiguration != null
+ && LifecycleMappingFactory.isLifecycleMappingChanged(facade, oldConfiguration, monitor)) {
+ mavenMarkerManager.addMarker(facade.getProject(), IMavenConstants.MARKER_CONFIGURATION_ID,
+ Messages.ProjectConfigurationUpdateRequired, -1, outOfDateSeverity.getSeverity());
+ }
}
} else {
IMavenProjectFacade oldFacade = event.getOldMavenProject();
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java
index f0e40179..909c46f3 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008-2014 Sonatype, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -60,6 +60,7 @@ import org.eclipse.m2e.core.internal.markers.IEditorMarkerService;
import org.eclipse.m2e.core.internal.markers.IMarkerLocationService;
import org.eclipse.m2e.core.internal.markers.IMavenMarkerManager;
import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+import org.eclipse.m2e.core.internal.preferences.ProblemSeverity;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.m2e.core.ui.internal.editing.PomEdits;
import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Matcher;
@@ -493,7 +494,8 @@ public class MarkerLocationService implements IMarkerLocationService, IEditorMar
IResource pomFile, String type, IStructuredDocument document) throws CoreException {
Element parent = findChild(root, PomEdits.PARENT);
Element groupId = findChild(root, PomEdits.GROUP_ID);
- if(parent != null && groupId != null && !skipParentMatchingGroupIdWarning()) {
+ ProblemSeverity matchingParentGroupIdSeverity = getMatchingParentGroupIdSeverity();
+ if(parent != null && groupId != null && !ProblemSeverity.ignore.equals(matchingParentGroupIdSeverity)) {
//now compare the values of parent and project groupid..
String parentString = getTextValue(findChild(parent, PomEdits.GROUP_ID));
String childString = getTextValue(groupId);
@@ -503,7 +505,7 @@ public class MarkerLocationService implements IMarkerLocationService, IEditorMar
IndexedRegion off = (IndexedRegion) groupId;
IMarker mark = mavenMarkerManager.addMarker(pomFile, type,
org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_duplicate_groupid,
- document.getLineOfOffset(off.getStartOffset()) + 1, IMarker.SEVERITY_WARNING);
+ document.getLineOfOffset(off.getStartOffset()) + 1, matchingParentGroupIdSeverity.getSeverity());
mark.setAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, IMavenConstants.EDITOR_HINT_PARENT_GROUP_ID);
mark.setAttribute(IMarker.CHAR_START, off.getStartOffset());
mark.setAttribute(IMarker.CHAR_END, off.getEndOffset());
@@ -512,7 +514,8 @@ public class MarkerLocationService implements IMarkerLocationService, IEditorMar
}
}
Element version = findChild(root, PomEdits.VERSION); //$NON-NLS-1$
- if(parent != null && version != null && !skipParentMatchingVersionWarning()) {
+ ProblemSeverity matchingParentVersionSeverity = getMatchingParentVersionSeverity();
+ if(parent != null && version != null && !ProblemSeverity.ignore.equals(matchingParentVersionSeverity)) {
//now compare the values of parent and project version..
String parentString = getTextValue(findChild(parent, PomEdits.VERSION)); //$NON-NLS-1$
String childString = getTextValue(version);
@@ -522,7 +525,7 @@ public class MarkerLocationService implements IMarkerLocationService, IEditorMar
IndexedRegion off = (IndexedRegion) version;
IMarker mark = mavenMarkerManager.addMarker(pomFile, type,
org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_duplicate_version,
- document.getLineOfOffset(off.getStartOffset()) + 1, IMarker.SEVERITY_WARNING);
+ document.getLineOfOffset(off.getStartOffset()) + 1, matchingParentVersionSeverity.getSeverity());
mark.setAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, IMavenConstants.EDITOR_HINT_PARENT_VERSION);
mark.setAttribute(IMarker.CHAR_START, off.getStartOffset());
mark.setAttribute(IMarker.CHAR_END, off.getEndOffset());
@@ -532,14 +535,14 @@ public class MarkerLocationService implements IMarkerLocationService, IEditorMar
}
}
- private static boolean skipParentMatchingGroupIdWarning() {
- return M2EUIPluginActivator.getDefault().getPreferenceStore()
- .getBoolean(MavenPreferenceConstants.P_DISABLE_GROUPID_DUP_OF_PARENT_WARNING);
+ private static ProblemSeverity getMatchingParentGroupIdSeverity() {
+ return ProblemSeverity.get(M2EUIPluginActivator.getDefault().getPreferenceStore()
+ .getString(MavenPreferenceConstants.P_DUP_OF_PARENT_GROUPID_PB));
}
- private static boolean skipParentMatchingVersionWarning() {
- return M2EUIPluginActivator.getDefault().getPreferenceStore()
- .getBoolean(MavenPreferenceConstants.P_DISABLE_VERSION_DUP_OF_PARENT_WARNING);
+ private static ProblemSeverity getMatchingParentVersionSeverity() {
+ return ProblemSeverity.get(M2EUIPluginActivator.getDefault().getPreferenceStore()
+ .getString(MavenPreferenceConstants.P_DUP_OF_PARENT_VERSION_PB));
}
/**

Back to the top