Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2015-03-13 07:50:02 -0400
committerFred Bricon2015-03-18 02:11:48 -0400
commit6eb6db0ce9f1f9169406f2d9846c09b84477a909 (patch)
tree65444154a199db9d4e42b12a753dbb84a4e1329f /org.eclipse.m2e.core
parentfb1b637af59064991edcf6ea737e5d200bfa9ab9 (diff)
downloadm2e-core-6eb6db0ce9f1f9169406f2d9846c09b84477a909.tar.gz
m2e-core-6eb6db0ce9f1f9169406f2d9846c09b84477a909.tar.xz
m2e-core-6eb6db0ce9f1f9169406f2d9846c09b84477a909.zip
335720 : Add a preference to automatically update configuration
The preference is set to true by default. Change-Id: I74b4fbc1582868d18939b36f0c87cc7617f8b938 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=335720 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.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java11
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceConstants.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceInitializer.java6
4 files changed, 30 insertions, 5 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 ae5cd76d..d33cae1b 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-2014 Sonatype, Inc. and others.
+ * Copyright (c) 2008-2015 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
@@ -102,4 +102,11 @@ public interface IMavenConfiguration {
*/
public String getNotCoveredMojoExecutionSeverity();
+ /**
+ * Returns <code>true</code> if project configuration should be automatically updated when out-of-date.
+ *
+ * @return <code>true</code> if project configuration should be automatically updated when out-of-date.
+ * @since 1.6
+ */
+ public boolean isAutomaticallyUpdateConfiguration();
}
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 c081966d..93b39ed2 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008-2015 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -296,4 +296,13 @@ public class MavenConfigurationImpl implements IMavenConfiguration, IPreferenceC
preferenceStore.applyPreferences(preferencesLookup[0], new IPreferenceFilter[] {getPreferenceFilter()});
}
+ @Override
+ public boolean isAutomaticallyUpdateConfiguration() {
+ return Boolean.parseBoolean(preferenceStore.get(MavenPreferenceConstants.P_AUTO_UPDATE_CONFIGURATION, null,
+ preferencesLookup));
+ }
+
+ public void setAutomaticallyUpdateConfiguration(boolean value) {
+ preferencesLookup[0].putBoolean(MavenPreferenceConstants.P_AUTO_UPDATE_CONFIGURATION, value);
+ }
}
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 f0ffce79..5d456de1 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-2014 Sonatype, Inc. and others.
+ * Copyright (c) 2008-2015 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
@@ -152,4 +152,11 @@ public interface MavenPreferenceConstants {
/** string **/
public static final String P_WORKSPACE_MAPPINGS_LOCATION = PREFIX + "WorkspacelifecycleMappingsLocation"; //$NON-NLS-1$
+ /**
+ * boolean
+ *
+ * @since 1.6
+ **/
+ public static final String P_AUTO_UPDATE_CONFIGURATION = PREFIX + "autoUpdateProjects"; //$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 be84d110..c337a629 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008-2015 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
@@ -20,7 +20,7 @@ import org.eclipse.m2e.core.internal.IMavenConstants;
/**
* Maven preferences initializer.
- *
+ *
* @author Eugene Kuleshov
*/
public class MavenPreferenceInitializer extends AbstractPreferenceInitializer {
@@ -57,5 +57,7 @@ public class MavenPreferenceInitializer extends AbstractPreferenceInitializer {
// set to null since the plugin state location is not available by the time execution reaches here
store.remove(MavenPreferenceConstants.P_WORKSPACE_MAPPINGS_LOCATION);
+
+ store.putBoolean(MavenPreferenceConstants.P_AUTO_UPDATE_CONFIGURATION, true);
}
}

Back to the top