Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2014-02-01 21:37:53 +0000
committerIgor Fedorenko2014-02-01 21:37:53 +0000
commitc932966a80b98d9c7aeb48e0341bb8ffcc2cad54 (patch)
treef2d226fc61a54c81e41e8c5a4bc6fd88ccab322c /org.eclipse.m2e.cliresolver
parent52ff0de38453c5676eee3e8a1ba4564ff396cc82 (diff)
downloadm2e-core-c932966a80b98d9c7aeb48e0341bb8ffcc2cad54.tar.gz
m2e-core-c932966a80b98d9c7aeb48e0341bb8ffcc2cad54.tar.xz
m2e-core-c932966a80b98d9c7aeb48e0341bb8ffcc2cad54.zip
352962 fixed run-as maven fails to resolve workspace test dependencies
Changed workspace resolution state file format to include artifact classifiers and hardcoded support for classifier=tests based on presence of project testOutputLocation. Change-Id: I84d8df50f6fc5d0997f802b8d99cf1f947153606 Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.cliresolver')
-rw-r--r--org.eclipse.m2e.cliresolver/src/main/java/org/eclipse/m2e/cli/WorkspaceState.java11
1 files changed, 8 insertions, 3 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 a9d700a2..05fb19f4 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
@@ -42,7 +42,8 @@ public class WorkspaceState {
public static boolean resolveArtifact(Artifact artifact) {
String extension = artifact.getArtifactHandler().getExtension();
- File file = findArtifact(artifact.getGroupId(), artifact.getArtifactId(), extension, artifact.getBaseVersion());
+ File file = findArtifact(artifact.getGroupId(), artifact.getArtifactId(), extension, artifact.getClassifier(),
+ artifact.getBaseVersion());
if(file == null) {
return false;
@@ -53,13 +54,17 @@ public class WorkspaceState {
return true;
}
- public static File findArtifact(String groupId, String artifactId, String type, String baseVersion) {
+ public static File findArtifact(String groupId, String artifactId, String type, String classifier, String baseVersion) {
Properties state = getState();
if(state == null) {
return null;
}
- String key = groupId + ':' + artifactId + ':' + type + ':' + baseVersion;
+ if(classifier == null) {
+ classifier = "";
+ }
+
+ String key = groupId + ':' + artifactId + ':' + type + ':' + classifier + ':' + baseVersion;
String value = state.getProperty(key);
if(value == null || value.length() == 0) {

Back to the top