Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does activator/sbt add Scala version to pure Java library dependencies?

I'm using Typesafe Activator's last version (1.2.8 with Scala 2.11.x).

When I add a dependency "org.apache.httpcomponents" %% "httpclient" % "4.4-alpha1" to my project in build.sbt, something like this:

libraryDependencies ++= Seq(
  "com.typesafe.akka" %% "akka-actor" % "2.3.4",
  "com.typesafe.akka" %% "akka-testkit" % "2.3.4",
  "org.scalatest" %% "scalatest" % "2.1.6" % "test",
  "junit" % "junit" % "4.11" % "test",
  "com.novocode" % "junit-interface" % "0.10" % "test",
  "org.apache.httpcomponents" %% "httpclient" % "4.4-alpha1" // my added dependency
)

... and try to update the project ( in activator's cli ) I get an error:

[error] (*:update) sbt.ResolveException: unresolved dependency: org.apache.httpcomponents#httpclient_2.11;4.4-alpha1: not found

I know scala's version aren't binary compatible, but I try to get a pure-java library org.apache.httpcomponent#httpclient! Why does activator add "_2.11" at the end of artifactId and make wrong urls...? How to resolve it?

like image 778
Reza Same'ei Avatar asked Aug 20 '14 08:08

Reza Same'ei


1 Answers

Change the first %% to a single %. The double character version is for fetching cross-built libraries, and yours isn't.

like image 60
Paul Butcher Avatar answered Sep 18 '22 13:09

Paul Butcher