Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Tanasenko2015-12-05 19:01:52 -0500
committerAnton Tanasenko2015-12-07 13:20:07 -0500
commitbd016543c1f4d20a3bc595b173bb3c91e5ff3398 (patch)
tree30c70a56738e526e13b4571d1dfb9355836e8814 /org.eclipse.m2e.core
parent45296327ea2d8a08c888f92a9152991c2f3b1f95 (diff)
downloadm2e-core-bd016543c1f4d20a3bc595b173bb3c91e5ff3398.tar.gz
m2e-core-bd016543c1f4d20a3bc595b173bb3c91e5ff3398.tar.xz
m2e-core-bd016543c1f4d20a3bc595b173bb3c91e5ff3398.zip
444262 Configured global settings.xml is not honored by Run as Maven
launch configurations Change-Id: Ied2168e7e3336a2ca6774ccb3ab2c11e228f3090 Signed-off-by: Anton Tanasenko <atg.sleepless@gmail.com>
Diffstat (limited to 'org.eclipse.m2e.core')
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/AbstractMavenRuntime.java14
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenEmbeddedRuntime.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenExternalRuntime.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenWorkspaceRuntime.java4
4 files changed, 14 insertions, 12 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/AbstractMavenRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/AbstractMavenRuntime.java
index 138f8fa3..3783cb47 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/AbstractMavenRuntime.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/AbstractMavenRuntime.java
@@ -11,9 +11,12 @@
package org.eclipse.m2e.core.internal.launch;
+import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.aether.util.StringUtils;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -141,5 +144,16 @@ public abstract class AbstractMavenRuntime implements MavenRuntime {
public abstract boolean isEditable();
+ public String getSettings() {
+ String settings = MavenPlugin.getMavenConfiguration().getGlobalSettingsFile();
+ if(!StringUtils.isEmpty(settings)) {
+ try {
+ settings = new File(settings).getCanonicalPath();
+ } catch(IOException ex) {
+ }
+ }
+ return settings;
+ }
+
public abstract String getVersion();
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenEmbeddedRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenEmbeddedRuntime.java
index 0e19768d..4dcdbbd6 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenEmbeddedRuntime.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenEmbeddedRuntime.java
@@ -78,10 +78,6 @@ public class MavenEmbeddedRuntime extends AbstractMavenRuntime {
return MavenRuntimeManagerImpl.EMBEDDED;
}
- public String getSettings() {
- return null;
- }
-
public boolean isAvailable() {
return true;
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenExternalRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenExternalRuntime.java
index 64c6566a..04bedd8e 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenExternalRuntime.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenExternalRuntime.java
@@ -74,10 +74,6 @@ public class MavenExternalRuntime extends AbstractMavenRuntime {
return location;
}
- public String getSettings() {
- return location + File.separator + "conf" + File.separator + "settings.xml"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
public String getMainTypeName() {
return "org.codehaus.classworlds.Launcher"; //$NON-NLS-1$
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenWorkspaceRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenWorkspaceRuntime.java
index 079b149d..6e4aea43 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenWorkspaceRuntime.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/launch/MavenWorkspaceRuntime.java
@@ -68,10 +68,6 @@ public class MavenWorkspaceRuntime extends AbstractMavenRuntime {
return MavenRuntimeManagerImpl.WORKSPACE;
}
- public String getSettings() {
- return null;
- }
-
public boolean isEditable() {
return true;
}

Back to the top