Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2015-09-29 15:41:40 -0400
committerFred Bricon2015-09-29 15:41:40 -0400
commitca6508c2a8fcee8105c6df64775dadf363e3a078 (patch)
tree513fe2e9032e97de1aea39efbac07b104072cbf3 /org.eclipse.m2e.core
parent494c2f808b1b59dc0eb7da7b84ebbd21ce5d3e44 (diff)
downloadm2e-core-ca6508c2a8fcee8105c6df64775dadf363e3a078.tar.gz
m2e-core-ca6508c2a8fcee8105c6df64775dadf363e3a078.tar.xz
m2e-core-ca6508c2a8fcee8105c6df64775dadf363e3a078.zip
439309 : Make 'Overriding managed version' problem severity configurable
Change-Id: I67be7eb713126acb7e543fff7e3809bb31ef084c Signed-off-by: Fred Bricon <fbricon@gmail.com>
Diffstat (limited to 'org.eclipse.m2e.core')
-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/preferences/MavenConfigurationImpl.java18
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceConstants.java7
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceInitializer.java1
4 files changed, 34 insertions, 0 deletions
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 d33cae1b..3f384dde 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
@@ -109,4 +109,12 @@ public interface IMavenConfiguration {
* @since 1.6
*/
public boolean isAutomaticallyUpdateConfiguration();
+
+ /**
+ * Returns {@link IMarker} severity of "Overriding Managed version" problem.
+ *
+ * @return One of <code>ignore</code>, <code>warning</code> or <code>error</code>.
+ * @since 1.7
+ */
+ public String getOverridingManagedVersionExecutionSeverity();
}
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 93b39ed2..79fa263e 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
@@ -297,6 +297,24 @@ public class MavenConfigurationImpl implements IMavenConfiguration, IPreferenceC
}
@Override
+ public String getOverridingManagedVersionExecutionSeverity() {
+ return preferenceStore.get(MavenPreferenceConstants.P_OVERRIDING_MANAGED_VERSION_PB,
+ ProblemSeverity.warning.toString(), preferencesLookup);
+ }
+
+ /**
+ * For testing purposes only
+ */
+ public void setOverridingManagedVersionExecutionSeverity(String severity) throws CoreException {
+ if(severity == null) {
+ preferencesLookup[0].remove(MavenPreferenceConstants.P_OVERRIDING_MANAGED_VERSION_PB);
+ } else {
+ preferencesLookup[0].put(MavenPreferenceConstants.P_OVERRIDING_MANAGED_VERSION_PB, severity);
+ }
+ preferenceStore.applyPreferences(preferencesLookup[0], new IPreferenceFilter[] {getPreferenceFilter()});
+ }
+
+ @Override
public boolean isAutomaticallyUpdateConfiguration() {
return Boolean.parseBoolean(preferenceStore.get(MavenPreferenceConstants.P_AUTO_UPDATE_CONFIGURATION, null,
preferencesLookup));
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 5d456de1..c02db7b7 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
@@ -135,6 +135,13 @@ public interface MavenPreferenceConstants {
/**
* Valid values : ignore, warning or error
*
+ * @since 1.7
+ **/
+ public static final String P_OVERRIDING_MANAGED_VERSION_PB = PROBLEM_PREFIX + "overridingManagedVersion"; //$NON-NLS-1$
+
+ /**
+ * Valid values : ignore, warning or error
+ *
* @since 1.5
**/
public static final String P_OUT_OF_DATE_PROJECT_CONFIG_PB = PROBLEM_PREFIX + "outofdateProjectConfig"; //$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 27ffe1bf..80688dc3 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
@@ -52,6 +52,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_OVERRIDING_MANAGED_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());

Back to the top