为什么activator/sbt将Scala版本添加到纯Java库依赖项中?

为什么activator/sbt将Scala版本添加到纯Java库依赖项中?,scala,sbt,typesafe-activator,Scala,Sbt,Typesafe Activator,我使用的是的最新版本(1.2.8和Scala 2.11.x) 当我在build.sbt中将依赖项“org.apache.httpcomponents”%%“httpclient”%%“4.4-alpha1”添加到我的项目中时,类似如下: libraryDependencies ++= Seq( "com.typesafe.akka" %% "akka-actor" % "2.3.4", "com.typesafe.akka" %% "akka-testkit" % "2.3.4",

我使用的是的最新版本(1.2.8和Scala 2.11.x)

当我在
build.sbt
中将依赖项
“org.apache.httpcomponents”%%“httpclient”%%“4.4-alpha1”
添加到我的项目中时,类似如下:

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
)
。。。并尝试更新项目(在activator的cli中),我收到一个错误:

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

我知道scala的版本不兼容二进制文件,但我试图获得一个纯java库
org.apache.httpcomponent#httpclient
!为什么activator在artifactId的末尾添加“_2.11”并生成错误的URL。。。?如何解决它?

将第一个
%%
更改为单个
%%
。双字符版本用于获取库,而您的不是。

%%仅用于scala库-(它添加了_2.9//u 2.10//u 2.11,这取决于对artifactId的Scalaversation)。对于java库,始终使用单百分比。请参阅@Paul Butcher评论并接受。这是否意味着此Apache URL中的依赖项信息实际上不正确,应该是单个的
%
?(或者我不明白为什么要留下来,
%%
)。。。当您在sbt shell中工作并且刚刚从
%%
更改为
%%
时,不要忘记重新加载
。)