From e1cd7ebde0aac6ec3f3f7559b9c2407095c8b85e Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Wed, 2 Oct 2013 19:39:17 -0400 Subject: [PATCH] 'makePom' should not generate elements for standard classifiers. Fixes #728. The element was generated for any explicit Artifact with a type other than "jar". withSources() and withJavadoc() create explicit Artifacts of this kind, but shouldn't have elements. They are primarily artifacts with classifiers- the type is an Ivy aspect. So, when writing to a pom, don't use write a type for known classifiers. --- ivy/src/main/scala/sbt/MakePom.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ivy/src/main/scala/sbt/MakePom.scala b/ivy/src/main/scala/sbt/MakePom.scala index cbfb0a5a1..5e49243d3 100644 --- a/ivy/src/main/scala/sbt/MakePom.scala +++ b/ivy/src/main/scala/sbt/MakePom.scala @@ -174,7 +174,13 @@ class MakePom(val log: Logger) case x => x.toArray } val (scope, optional) = getScopeAndOptional(configs) - makeDependencyElem(dependency, scope, optional, artifactClassifier(artifact), artifactType(artifact)) + val classifier = artifactClassifier(artifact) + val baseType = artifactType(artifact) + val tpe = (classifier, baseType) match { + case (Some(c), Some(tpe)) if Artifact.classifierType(c) == tpe => None + case _ => baseType + } + makeDependencyElem(dependency, scope, optional, classifier, tpe) } def makeDependencyElem(dependency: DependencyDescriptor, scope: Option[String], optional: Boolean, classifier: Option[String], tpe: Option[String]): Elem = {