o deprecate setWorkspaceRuntime and encourage people to use addWorkspaceRuntime as there are at least two variants of a Maven runtime now: standard Maven flavour and Tesla flavour
o create an AbstractWorkspaceRuntime which can be shared by the existing MavenWorkspaceRuntime and the new TeslaWorkspaceRuntime
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenRuntimeManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenRuntimeManager.java
index f317d39..28335f3 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenRuntimeManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenRuntimeManager.java
@@ -70,6 +70,10 @@
     runtimes.put(workspaceRuntime.getLocation(), workspaceRuntime);
   }
 
+  /**
+   * @deprecated use {@link addWorkspaceRuntime(runtime)}
+   */
+  @Deprecated
   public void setWorkspaceRuntime(MavenRuntime workspaceRuntime) {
     addWorkspaceRuntime(workspaceRuntime);
   }
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/AbstractWorkspaceRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/AbstractWorkspaceRuntime.java
new file mode 100644
index 0000000..8d78b61
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/AbstractWorkspaceRuntime.java
@@ -0,0 +1,177 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *      Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import java.io.File;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
+import org.eclipse.m2e.core.embedder.MavenRuntime;
+import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.IMavenProjectRegistry;
+
+
+/**
+ * Maven 3.0-SNAPSHOT runtime loaded from the Eclipse Workspace
+ * 
+ * @author Eugene Kuleshov
+ * @author Igor Fedorenko
+ * @author Jason van Zyl
+ */
+public abstract class AbstractWorkspaceRuntime implements MavenRuntime {
+
+  private static final ArtifactKey MAVEN_DISTRIBUTION = new ArtifactKey(
+      "org.apache.maven", "apache-maven", "[3.0,)", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+  private static final ArtifactKey PLEXUS_CLASSWORLDS = new ArtifactKey(
+      "org.codehaus.plexus", "plexus-classworlds", null, null); //$NON-NLS-1$ //$NON-NLS-2$
+
+  private static final String MAVEN_EXECUTOR_CLASS = "org.apache.maven.cli.MavenCli"; //$NON-NLS-1$
+
+  private static final String PLEXUS_CLASSWORLD_NAME = "plexus.core"; //$NON-NLS-1$
+
+  private IMavenProjectRegistry projectManager;
+
+  public AbstractWorkspaceRuntime(IMavenProjectRegistry projectManager) {
+    this.projectManager = projectManager;
+  }
+
+  protected abstract ArtifactKey getDistributionArtifactKey();
+
+  protected abstract String getMainClass();
+
+  public String getLocation() {
+    return MavenRuntimeManager.WORKSPACE;
+  }
+
+  public String getSettings() {
+    return null;
+  }
+
+  public boolean isEditable() {
+    return false;
+  }
+
+  public boolean isAvailable() {
+    return getMavenDistribution() != null;
+  }
+
+  protected IMavenProjectFacade getMavenDistribution() {
+    try {
+      VersionRange range = VersionRange.createFromVersionSpec(getDistributionArtifactKey().getVersion());
+      for(IMavenProjectFacade facade : projectManager.getProjects()) {
+        ArtifactKey artifactKey = facade.getArtifactKey();
+        if(getDistributionArtifactKey().getGroupId().equals(artifactKey.getGroupId()) //
+            && getDistributionArtifactKey().getArtifactId().equals(artifactKey.getArtifactId())//
+            && range.containsVersion(new DefaultArtifactVersion(artifactKey.getVersion()))) {
+          return facade;
+        }
+      }
+    } catch(InvalidVersionSpecificationException e) {
+      // can't happen
+    }
+    return null;
+  }
+
+  public void createLauncherConfiguration(IMavenLauncherConfiguration collector, IProgressMonitor monitor)
+      throws CoreException {
+    IMavenProjectFacade maven = getMavenDistribution();
+    if(maven != null) {
+      MavenProject mavenProject = maven.getMavenProject(monitor);
+      //
+      // main is org.apache.maven.cli.MavenCli from plexus.core
+      //
+      // set maven.home default ${user.home}/m2
+      //
+      // [plexus.core]
+      // optionally ${maven.home}/lib/ext/*.jar
+      // load       ${maven.home}/lib/*.jar
+      // load       ${maven.home}/conf/logging
+      //
+      collector.setMainType(getMainClass(), PLEXUS_CLASSWORLD_NAME);
+      collector.addRealm(PLEXUS_CLASSWORLD_NAME);
+      //
+      // plexus.core is the current realm, and now we want the add the SLF4J loggging configuration if 
+      // we have a verion>3.1.x Maven-like runtime
+      //
+      for(IMavenProjectFacade facade : projectManager.getProjects()) {
+        ArtifactKey artifactKey = facade.getArtifactKey();
+        if(getDistributionArtifactKey().getGroupId().equals(artifactKey.getGroupId()) //
+            && getDistributionArtifactKey().getArtifactId().equals(artifactKey.getArtifactId())) {
+          File loggingConfigurationDirectory = new File(facade.getPomFile().getParentFile(), "src/conf/logging");
+          if(loggingConfigurationDirectory.exists()) {
+            collector.addArchiveEntry(loggingConfigurationDirectory.getAbsolutePath());
+          }
+        }
+      }
+      Set<Artifact> artifacts = mavenProject.getArtifacts();
+      Artifact launcherArtifact = null;
+
+      for(Artifact artifact : artifacts) {
+        if(Artifact.SCOPE_TEST.equals(artifact.getScope())) {
+          continue;
+        }
+
+        if(PLEXUS_CLASSWORLDS.getGroupId().equals(artifact.getGroupId())
+            && PLEXUS_CLASSWORLDS.getArtifactId().equals(artifact.getArtifactId())) {
+          launcherArtifact = artifact;
+          continue;
+        }
+
+        addArtifact(collector, artifact);
+      }
+
+      if(launcherArtifact != null) {
+        collector.addRealm(IMavenLauncherConfiguration.LAUNCHER_REALM);
+        addArtifact(collector, launcherArtifact);
+      }
+    }
+  }
+
+  public String toString() {
+    return "Maven Workspace (" + getVersion() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+  }
+
+  protected void addArtifact(IMavenLauncherConfiguration collector, Artifact artifact) throws CoreException {
+    IMavenProjectFacade facade = projectManager.getMavenProject(artifact.getGroupId(), artifact.getArtifactId(),
+        artifact.getVersion());
+
+    if(facade != null) {
+      collector.addProjectEntry(facade);
+    } else {
+      File file = artifact.getFile();
+      if(file != null) {
+        collector.addArchiveEntry(file.getAbsolutePath());
+      }
+    }
+  }
+
+  public String getVersion() {
+    IMavenProjectFacade maven = getMavenDistribution();
+    if(maven != null) {
+      return maven.getArtifactKey().getVersion();
+    }
+    return getDistributionArtifactKey().getVersion();
+  }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenWorkspaceRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenWorkspaceRuntime.java
index e90a807..5c92c2a 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenWorkspaceRuntime.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenWorkspaceRuntime.java
@@ -11,23 +11,8 @@
 
 package org.eclipse.m2e.core.internal.embedder;
 
-import java.io.File;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
-import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.project.MavenProject;
-
 import org.eclipse.m2e.core.embedder.ArtifactKey;
-import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
-import org.eclipse.m2e.core.embedder.MavenRuntime;
 import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
-import org.eclipse.m2e.core.project.IMavenProjectFacade;
 import org.eclipse.m2e.core.project.IMavenProjectRegistry;
 
 
@@ -37,118 +22,31 @@
  * @author Eugene Kuleshov
  * @author Igor Fedorenko
  */
-public class MavenWorkspaceRuntime implements MavenRuntime {
+public class MavenWorkspaceRuntime extends AbstractWorkspaceRuntime {
 
   private static final ArtifactKey MAVEN_DISTRIBUTION = new ArtifactKey(
       "org.apache.maven", "apache-maven", "[3.0,)", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 
-  private static final ArtifactKey PLEXUS_CLASSWORLDS = new ArtifactKey(
-      "org.codehaus.plexus", "plexus-classworlds", null, null); //$NON-NLS-1$ //$NON-NLS-2$
-
   private static final String MAVEN_EXECUTOR_CLASS = "org.apache.maven.cli.MavenCli"; //$NON-NLS-1$
 
-  private static final String PLEXUS_CLASSWORLD_NAME = "plexus.core"; //$NON-NLS-1$
-
-  private IMavenProjectRegistry projectManager;
-
   public MavenWorkspaceRuntime(IMavenProjectRegistry projectManager) {
-    this.projectManager = projectManager;
+    super(projectManager);
+  }
+
+  protected ArtifactKey getDistributionArtifactKey() {
+    return MAVEN_DISTRIBUTION;
+  }
+
+  protected String getMainClass() {
+    return MAVEN_EXECUTOR_CLASS;
   }
 
   public String getLocation() {
     return MavenRuntimeManager.WORKSPACE;
   }
 
-  public String getSettings() {
-    return null;
-  }
-
-  public boolean isEditable() {
-    return false;
-  }
-
-  public boolean isAvailable() {
-    return getMavenDistribution() != null;
-  }
-
-  private IMavenProjectFacade getMavenDistribution() {
-    try {
-      VersionRange range = VersionRange.createFromVersionSpec(MAVEN_DISTRIBUTION.getVersion());
-      for(IMavenProjectFacade facade : projectManager.getProjects()) {
-        ArtifactKey artifactKey = facade.getArtifactKey();
-        if(MAVEN_DISTRIBUTION.getGroupId().equals(artifactKey.getGroupId()) //
-            && MAVEN_DISTRIBUTION.getArtifactId().equals(artifactKey.getArtifactId())//
-            && range.containsVersion(new DefaultArtifactVersion(artifactKey.getVersion()))) {
-          return facade;
-        }
-      }
-    } catch(InvalidVersionSpecificationException e) {
-      // can't happen
-    }
-    return null;
-  }
-
-  public void createLauncherConfiguration(IMavenLauncherConfiguration collector, IProgressMonitor monitor)
-      throws CoreException {
-    IMavenProjectFacade maven = getMavenDistribution();
-    if(maven != null) {
-      MavenProject mavenProject = maven.getMavenProject(monitor);
-
-      collector.setMainType(MAVEN_EXECUTOR_CLASS, PLEXUS_CLASSWORLD_NAME);
-
-      collector.addRealm(PLEXUS_CLASSWORLD_NAME);
-
-      Set<Artifact> artifacts = mavenProject.getArtifacts();
-
-      Artifact launcherArtifact = null;
-
-      for(Artifact artifact : artifacts) {
-        if(Artifact.SCOPE_TEST.equals(artifact.getScope())) {
-          continue;
-        }
-
-        if(PLEXUS_CLASSWORLDS.getGroupId().equals(artifact.getGroupId())
-            && PLEXUS_CLASSWORLDS.getArtifactId().equals(artifact.getArtifactId())) {
-          launcherArtifact = artifact;
-          continue;
-        }
-
-        addArtifact(collector, artifact);
-      }
-
-      if(launcherArtifact != null) {
-        collector.addRealm(IMavenLauncherConfiguration.LAUNCHER_REALM);
-        addArtifact(collector, launcherArtifact);
-      }
-    }
-
-    // XXX throw something at the caller! 
-  }
-
-  private void addArtifact(IMavenLauncherConfiguration collector, Artifact artifact) throws CoreException {
-    IMavenProjectFacade facade = projectManager.getMavenProject(artifact.getGroupId(), artifact.getArtifactId(),
-        artifact.getVersion());
-
-    if(facade != null) {
-      collector.addProjectEntry(facade);
-    } else {
-      File file = artifact.getFile();
-      if(file != null) {
-        collector.addArchiveEntry(file.getAbsolutePath());
-      }
-    }
-  }
-
   public String toString() {
     return "Maven Workspace (" + getVersion() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
   }
 
-  public String getVersion() {
-    IMavenProjectFacade maven = getMavenDistribution();
-    if(maven != null) {
-      return maven.getArtifactKey().getVersion();
-    }
-    return MAVEN_DISTRIBUTION.getVersion();
-  }
-
 }
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/TeslaWorkspaceRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/TeslaWorkspaceRuntime.java
index eb4ea3c..9ebf056 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/TeslaWorkspaceRuntime.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/TeslaWorkspaceRuntime.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008-2013 Sonatype, Inc., Jason van Zyl
  * 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,164 +7,46 @@
  *
  * Contributors:
  *      Sonatype, Inc. - initial API and implementation
+ *      Jason van Zyl  - extension to account for Tesla
  *******************************************************************************/
 
 package org.eclipse.m2e.core.internal.embedder;
 
-import java.io.File;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
-import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.project.MavenProject;
-
 import org.eclipse.m2e.core.embedder.ArtifactKey;
-import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
-import org.eclipse.m2e.core.embedder.MavenRuntime;
-import org.eclipse.m2e.core.project.IMavenProjectFacade;
 import org.eclipse.m2e.core.project.IMavenProjectRegistry;
 
 
 /**
- * Maven 3.0-SNAPSHOT runtime loaded from the Eclipse Workspace
+ * Tesla runtime loaded from the Eclipse Workspace
  * 
  * @author Eugene Kuleshov
  * @author Igor Fedorenko
+ * @author Jason van Zyl
  */
-public class TeslaWorkspaceRuntime implements MavenRuntime {
+public class TeslaWorkspaceRuntime extends AbstractWorkspaceRuntime {
 
   private static final ArtifactKey TESLA_DISTRIBUTION = new ArtifactKey(
-      "io.tesla.maven", "apache-maven", "[3.0,)", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-  private static final ArtifactKey PLEXUS_CLASSWORLDS = new ArtifactKey(
-      "org.codehaus.plexus", "plexus-classworlds", null, null); //$NON-NLS-1$ //$NON-NLS-2$
+      "io.tesla.maven", "apache-maven", "[3.1,)", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 
   private static final String MAVEN_EXECUTOR_CLASS = "org.apache.maven.cli.MavenCli"; //$NON-NLS-1$
 
-  private static final String PLEXUS_CLASSWORLD_NAME = "plexus.core"; //$NON-NLS-1$
-
-  private IMavenProjectRegistry projectManager;
-
   public TeslaWorkspaceRuntime(IMavenProjectRegistry projectManager) {
-    this.projectManager = projectManager;
+    super(projectManager);
+  }
+
+  protected ArtifactKey getDistributionArtifactKey() {
+    return TESLA_DISTRIBUTION;
+  }
+
+  protected String getMainClass() {
+    return MAVEN_EXECUTOR_CLASS;
   }
 
   public String getLocation() {
     return "TESLA_WORKSPACE";
   }
 
-  public String getSettings() {
-    return null;
-  }
-
-  public boolean isEditable() {
-    return false;
-  }
-
-  public boolean isAvailable() {
-    return getMavenDistribution() != null;
-  }
-
-  private IMavenProjectFacade getMavenDistribution() {
-    try {
-      VersionRange range = VersionRange.createFromVersionSpec(TESLA_DISTRIBUTION.getVersion());
-      for(IMavenProjectFacade facade : projectManager.getProjects()) {
-        ArtifactKey artifactKey = facade.getArtifactKey();
-        if(TESLA_DISTRIBUTION.getGroupId().equals(artifactKey.getGroupId()) //
-            && TESLA_DISTRIBUTION.getArtifactId().equals(artifactKey.getArtifactId())//
-            && range.containsVersion(new DefaultArtifactVersion(artifactKey.getVersion()))) {
-          return facade;
-        }
-      }
-    } catch(InvalidVersionSpecificationException e) {
-      // can't happen
-    }
-    return null;
-  }
-
-  public void createLauncherConfiguration(IMavenLauncherConfiguration collector, IProgressMonitor monitor)
-      throws CoreException {
-    IMavenProjectFacade maven = getMavenDistribution();
-    if(maven != null) {
-      MavenProject mavenProject = maven.getMavenProject(monitor);
-      //
-      // main is org.apache.maven.cli.MavenCli from plexus.core
-      //
-      // set maven.home default ${user.home}/m2
-      //
-      // [plexus.core]
-      // optionally ${maven.home}/lib/ext/*.jar
-      // load       ${maven.home}/lib/*.jar
-      // load       ${maven.home}/conf/logging
-      //
-      collector.setMainType(MAVEN_EXECUTOR_CLASS, PLEXUS_CLASSWORLD_NAME);
-      collector.addRealm(PLEXUS_CLASSWORLD_NAME);
-      //
-      // plexus.core is the current realm, and now we want the add the SLF4J loggging configuration.
-      //
-      for(IMavenProjectFacade facade : projectManager.getProjects()) {
-        ArtifactKey artifactKey = facade.getArtifactKey();
-        if(TESLA_DISTRIBUTION.getGroupId().equals(artifactKey.getGroupId()) //
-            && TESLA_DISTRIBUTION.getArtifactId().equals(artifactKey.getArtifactId())) {
-          collector.addArchiveEntry(new File(facade.getPomFile().getParentFile(), "src/conf/logging").getAbsolutePath());
-        }
-      }
-      collector.addArchiveEntry("/Users/jvanzyl/js/tesla/maven/apache-maven/src/conf/logging");
-      Set<Artifact> artifacts = mavenProject.getArtifacts();
-      Artifact launcherArtifact = null;
-
-      for(Artifact artifact : artifacts) {
-        if(Artifact.SCOPE_TEST.equals(artifact.getScope())) {
-          continue;
-        }
-
-        if(PLEXUS_CLASSWORLDS.getGroupId().equals(artifact.getGroupId())
-            && PLEXUS_CLASSWORLDS.getArtifactId().equals(artifact.getArtifactId())) {
-          launcherArtifact = artifact;
-          continue;
-        }
-
-        addArtifact(collector, artifact);
-      }
-
-      if(launcherArtifact != null) {
-        collector.addRealm(IMavenLauncherConfiguration.LAUNCHER_REALM);
-        addArtifact(collector, launcherArtifact);
-      }
-    }
-
-    // XXX throw something at the caller! 
-  }
-
-  private void addArtifact(IMavenLauncherConfiguration collector, Artifact artifact) throws CoreException {
-    IMavenProjectFacade facade = projectManager.getMavenProject(artifact.getGroupId(), artifact.getArtifactId(),
-        artifact.getVersion());
-
-    if(facade != null) {
-      collector.addProjectEntry(facade);
-    } else {
-      File file = artifact.getFile();
-      if(file != null) {
-        collector.addArchiveEntry(file.getAbsolutePath());
-      }
-    }
-  }
-
   public String toString() {
     return "Tesla Workspace (" + getVersion() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
   }
-
-  public String getVersion() {
-    IMavenProjectFacade maven = getMavenDistribution();
-    if(maven != null) {
-      return maven.getArtifactKey().getVersion();
-    }
-    return TESLA_DISTRIBUTION.getVersion();
-  }
-
 }