Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilos Kleint2010-12-28 09:53:41 -0500
committerMilos Kleint2010-12-28 09:53:41 -0500
commit0715a74fb46c1fc14279be7cadcf16bade96c307 (patch)
treeb98761209c34bc7afbbd44c8fc4a4ae5ef588e41
parentc9bf26e8bfbc614833a1fd6b201499edf585e06e (diff)
downloadm2e-core-0715a74fb46c1fc14279be7cadcf16bade96c307.tar.gz
m2e-core-0715a74fb46c1fc14279be7cadcf16bade96c307.tar.xz
m2e-core-0715a74fb46c1fc14279be7cadcf16bade96c307.zip
classifier shall be set
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/AddDependencyDialog.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/AddDependencyDialog.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/AddDependencyDialog.java
index 2ca51b01..25332e14 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/AddDependencyDialog.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/AddDependencyDialog.java
@@ -503,23 +503,32 @@ public class AddDependencyDialog extends AbstractMavenDialog {
String scope = scopeCombo.getText(); //$NON-NLS-1$
if(artifactFiles == null || artifactFiles.size() == 1) {
+ String type = "";
+ String classifier = "";
+ if (artifactFiles.size() == 1) {
+ // use the selected artifact props if available..
+ IndexedArtifactFile file = artifactFiles.iterator().next();
+ classifier = file.classifier;
+ type = file.type;
+ }
Dependency dependency = createDependency(groupIDtext.getText().trim(), artifactIDtext.getText().trim(),
- versionText.getText().trim(), scope, ""); //$NON-NLS-1$
+ versionText.getText().trim(), scope, type, classifier); //$NON-NLS-1$
this.dependencies = Collections.singletonList(dependency);
} else {
this.dependencies = new LinkedList<Dependency>();
for(IndexedArtifactFile file : artifactFiles) {
- Dependency dep = createDependency(file.group, file.artifact, file.version, scope, file.type);
+ Dependency dep = createDependency(file.group, file.artifact, file.version, scope, file.type, file.classifier);
this.dependencies.add(dep);
}
}
}
- private Dependency createDependency(String groupID, String artifactID, String version, String scope, String type) {
+ private Dependency createDependency(String groupID, String artifactID, String version, String scope, String type, String classifier) {
Dependency dependency = PomFactory.eINSTANCE.createDependency();
dependency.setGroupId(groupID);
dependency.setArtifactId(artifactID);
dependency.setVersion(version);
+ dependency.setClassifier(classifier);
/*
* For scope and type, if the values are the default, don't save them.

Back to the top