Skip to content

Commit

Permalink
Merge pull request #317 from rtimush/maven-central-index-page
Browse files Browse the repository at this point in the history
Extract versions from maven central html listing
  • Loading branch information
rtimush authored May 29, 2022
2 parents 632f369 + 9bee0f4 commit 66f38db
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import scala.concurrent.Future

class CompoundMetadataLoader(loaders: Seq[MetadataLoader]) extends MetadataLoader {
override def getVersions(module: sbt.ModuleID): Future[Seq[Version]] =
loaders.foldLeft(Future.failed[Seq[Version]](new NoSuchElementException)) { (result, loader) =>
result.recoverWith { case _ =>
loader.getVersions(module)
Future
.sequence {
loaders.map { loader =>
loader.getVersions(module).recover { case _ => Seq.empty }
}
}
}
.map(_.flatten)
}

0 comments on commit 66f38db

Please sign in to comment.