Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2014-02-26 21:57:06 -0500
committerIgor Fedorenko2014-02-26 21:57:06 -0500
commit9509896ef113f1a4f77f15f85594dad328485ad6 (patch)
tree44ec16db74e4d49de68112ec72dab5803c911d38
parent608ed1322483a6e3e70298e4e797b5d6b37398b9 (diff)
downloadm2e-core-9509896ef113f1a4f77f15f85594dad328485ad6.tar.gz
m2e-core-9509896ef113f1a4f77f15f85594dad328485ad6.tar.xz
m2e-core-9509896ef113f1a4f77f15f85594dad328485ad6.zip
429204 fixed run-as-maven workspace version range resolution
Change-Id: Ifa4dd003be400af245519ab924c781755ac4e8ab Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.cliresolver/src/main/java/org/eclipse/m2e/cli/WorkspaceState.java22
-rw-r--r--org.eclipse.m2e.cliresolver30/src/main/java/org/eclipse/m2e/cliresolver30/EclipseWorkspaceReader.java3
-rw-r--r--org.eclipse.m2e.cliresolver31/src/main/java/org/eclipse/m2e/cliresolver31/EclipseWorkspaceReader.java7
-rw-r--r--org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver30.jarbin6957 -> 7440 bytes
-rw-r--r--org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver31.jarbin6009 -> 6490 bytes
5 files changed, 27 insertions, 5 deletions
diff --git a/org.eclipse.m2e.cliresolver/src/main/java/org/eclipse/m2e/cli/WorkspaceState.java b/org.eclipse.m2e.cliresolver/src/main/java/org/eclipse/m2e/cli/WorkspaceState.java
index 05fb19f4..c89fe274 100644
--- a/org.eclipse.m2e.cliresolver/src/main/java/org/eclipse/m2e/cli/WorkspaceState.java
+++ b/org.eclipse.m2e.cliresolver/src/main/java/org/eclipse/m2e/cli/WorkspaceState.java
@@ -12,6 +12,9 @@ import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import java.util.Properties;
import org.apache.maven.artifact.Artifact;
@@ -79,4 +82,23 @@ public class WorkspaceState {
return file;
}
+ public static List<String> findVersions(String groupId, String artifactId) {
+ Properties state = getState();
+ if(state == null) {
+ return Collections.emptyList();
+ }
+
+ String prefix = groupId + ':' + artifactId + ':';
+
+ List<String> versions = new ArrayList<String>();
+ for(Object obj : state.keySet()) {
+ String key = (String) obj;
+ if(key.startsWith(prefix)) {
+ versions.add(key.substring(key.lastIndexOf(':') + 1));
+ }
+ }
+
+ return versions;
+ }
+
}
diff --git a/org.eclipse.m2e.cliresolver30/src/main/java/org/eclipse/m2e/cliresolver30/EclipseWorkspaceReader.java b/org.eclipse.m2e.cliresolver30/src/main/java/org/eclipse/m2e/cliresolver30/EclipseWorkspaceReader.java
index 3e79373a..ea7ae89f 100644
--- a/org.eclipse.m2e.cliresolver30/src/main/java/org/eclipse/m2e/cliresolver30/EclipseWorkspaceReader.java
+++ b/org.eclipse.m2e.cliresolver30/src/main/java/org/eclipse/m2e/cliresolver30/EclipseWorkspaceReader.java
@@ -9,7 +9,6 @@
package org.eclipse.m2e.cliresolver30;
import java.io.File;
-import java.util.Collections;
import java.util.List;
import org.codehaus.plexus.component.annotations.Component;
@@ -50,7 +49,7 @@ public final class EclipseWorkspaceReader implements WorkspaceReader {
}
public List<String> findVersions(org.sonatype.aether.artifact.Artifact artifact) {
- return Collections.emptyList();
+ return WorkspaceState.findVersions(artifact.getGroupId(), artifact.getArtifactId());
}
}
diff --git a/org.eclipse.m2e.cliresolver31/src/main/java/org/eclipse/m2e/cliresolver31/EclipseWorkspaceReader.java b/org.eclipse.m2e.cliresolver31/src/main/java/org/eclipse/m2e/cliresolver31/EclipseWorkspaceReader.java
index e2523ff1..8310e473 100644
--- a/org.eclipse.m2e.cliresolver31/src/main/java/org/eclipse/m2e/cliresolver31/EclipseWorkspaceReader.java
+++ b/org.eclipse.m2e.cliresolver31/src/main/java/org/eclipse/m2e/cliresolver31/EclipseWorkspaceReader.java
@@ -9,12 +9,13 @@
package org.eclipse.m2e.cliresolver31;
import java.io.File;
-import java.util.Collections;
import java.util.List;
-import org.codehaus.plexus.component.annotations.Component;
import org.eclipse.aether.repository.WorkspaceReader;
import org.eclipse.aether.repository.WorkspaceRepository;
+
+import org.codehaus.plexus.component.annotations.Component;
+
import org.eclipse.m2e.cli.WorkspaceState;
@@ -50,7 +51,7 @@ public final class EclipseWorkspaceReader implements WorkspaceReader {
}
public List<String> findVersions(org.eclipse.aether.artifact.Artifact artifact) {
- return Collections.emptyList();
+ return WorkspaceState.findVersions(artifact.getGroupId(), artifact.getArtifactId());
}
}
diff --git a/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver30.jar b/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver30.jar
index 04028e37..296a2243 100644
--- a/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver30.jar
+++ b/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver30.jar
Binary files differ
diff --git a/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver31.jar b/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver31.jar
index e185dea4..47d13b61 100644
--- a/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver31.jar
+++ b/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver31.jar
Binary files differ

Back to the top