mCs mCs - 2 months ago 18
Scala Question

sbt: Add multiple resolvers

I tried to add two resolvers:

resolvers ++= Seq(
Resolver.DefaultMavenRepositoryRoot,
//Resolver.sonatypeRepo("releases"),
Resolver.typesafeRepo("releases")
)


However I keep getting:


...build.sbt:9: error: No implicit for
Append.Values[Seq[sbt.Resolver], Seq[java.io.Serializable]] found,

so Seq[java.io.Serializable] cannot be appended to Seq[sbt.Resolver]
resolvers ++= Seq(
^ [error] Type error in expression Invalid response. Invalid response.

Invalid response.



  1. What are the default resolvers in the
    resolvers
    ?

  2. What is wrong? How to add multiple resolvers ?


Answer

The way you are adding multiple resolvers is correct. The problem is with DefaultMavenRepositoryRoot: it's not a Resolver, it's just a string, and you need to provide a sequence of Resolvers.

That being said, you don't need to explicitly add this resolver because it's included by default.

But if for some reason you do want to add it explicitly, you should use DefaultMavenRepository. It uses the same url in DefaultMavenRepositoryRoot. So you would be writing this:

resolvers ++= Seq(
  DefaultMavenRepository,
  //Resolver.sonatypeRepo("releases"),
  Resolver.typesafeRepo("releases")
)