Skip to content

Commit

Permalink
Merge pull request #1524 from henricook/coursier-repositories
Browse files Browse the repository at this point in the history
Use Coursier defaults, which also adds support for COURSIER_REPOSITORIES
  • Loading branch information
tanishiking authored Oct 11, 2019
2 parents 2958ad7 + a5c102f commit 7e440ce
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package org.scalafmt.dynamic

import java.io.PrintWriter
import java.io.OutputStreamWriter
import java.net.URL
import java.nio.file.Path

import coursierapi._
import scala.collection.JavaConverters._
import org.scalafmt.dynamic.ScalafmtDynamicDownloader._

import scala.collection.JavaConverters._
import scala.concurrent.duration.Duration
import scala.util.Try
import java.io.OutputStream
import java.io.PrintStream
import java.io.OutputStreamWriter

class ScalafmtDynamicDownloader(
downloadProgressWriter: OutputStreamWriter,
Expand Down Expand Up @@ -75,14 +71,16 @@ class ScalafmtDynamicDownloader(
"org.scalameta"
}

private def repositories: Array[Repository] = Array(
Repository.central(),
Repository.ivy2Local(),
MavenRepository.of(
"https://oss.sonatype.org/content/repositories/snapshots"
),
MavenRepository.of("https://oss.sonatype.org/content/repositories/public")
)
private def repositories: Array[Repository] = {
// Default repositories are ivy2local, central and also anything in COURSIER_REPOSITORIES overrides
Repository.defaults().asScala.toArray ++ Array(
MavenRepository.of(
"https://oss.sonatype.org/content/repositories/snapshots"
),
MavenRepository.of("https://oss.sonatype.org/content/repositories/public")
)
}

}

object ScalafmtDynamicDownloader {
Expand Down

0 comments on commit 7e440ce

Please sign in to comment.