Allow for non default classifiers to be given a try from Maven repositories

TODO Add test with the standalone classifier on coursier-cli once coursier
1.0.0-M8 is released
This commit is contained in:
Alexandre Archambault 2016-02-20 15:53:10 +01:00
parent f6da127759
commit 1d58d8d453
1 changed files with 15 additions and 2 deletions

View File

@ -79,10 +79,23 @@ case class MavenSource(
overrideClassifiers match {
case Some(classifiers) =>
val classifiersSet = classifiers.toSet
project.publications.collect {
val publications = project.publications.collect {
case (_, p) if classifiersSet(p.classifier) =>
artifactOf(dependency.module, p)
p
}
val publications0 =
if (publications.isEmpty)
classifiers.map { classifier =>
Publication(dependency.module.name, "jar", "jar", classifier)
}
else
publications
publications0.map { p =>
artifactOf(dependency.module, p)
}
case None =>
Seq(
artifactOf(