SBT调用错误的scalac编译器版本

时间:2017-08-11 12:32:27

标签: scala sbt

我正在使用Fedora Linux和sbt。我想我已尝试过所有内容,但我无法说服sbt使用Scala 2.12.2来编译我的项目。

当我用:

编译同一个项目时
  • 摇篮,
  • IntelliJ IDEA,
  • SBT在另一个Linux发行版上,
一切正常。我无法让它在Fedora Linux和sbt上工作。

这是我的build.sbt

scalaVersion := "2.12.2"

scalaVersion in ThisBuild := "2.12.2"

crossScalaVersions := Seq(scalaVersion.value)

scalacOptions := Seq("-unchecked", "-deprecation", "-feature", "-language:postfixOps")

libraryDependencies ++= Seq("org.xerial" % "sqlite-jdbc" % "3.18.0",
  "org.apache.httpcomponents" % "httpclient" % "4.5.3",
  "commons-codec" % "commons-codec" % "1.10",
  "commons-cli" % "commons-cli" % "1.4",
  "org.hjson" % "hjson" % "1.0.0",
  "log4j" % "log4j" % "1.2.17",
  "org.zeromq" % "jeromq" % "0.4.0",
  "com.nimbusds" % "nimbus-jose-jwt" % "4.23",
  "ws.wamp.jawampa" % "jawampa-core" % "0.5.0",
  "ws.wamp.jawampa" % "jawampa-netty" % "0.5.0",
  "org.glassfish.tyrus" % "tyrus-websocket-core" % "1.2.1",
  "org.glassfish.tyrus.bundles" % "tyrus-standalone-client" % "1.13.1",
  "org.scalactic" %% "scalactic" % "3.0.1",
  "org.scalatest" %% "scalatest" % "3.0.1" % "test",
  "org.postgresql" % "postgresql" % "42.1.1")

// https://mvnrepository.com/artifact/org.apache.commons/commons-compress
libraryDependencies += "org.apache.commons" % "commons-compress" % "1.14"

// https://mvnrepository.com/artifact/org.tukaani/xz
libraryDependencies += "org.tukaani" % "xz" % "1.6"

// https://mvnrepository.com/artifact/net.sourceforge.htmlunit/htmlunit
libraryDependencies += "net.sourceforge.htmlunit" % "htmlunit" % "2.27"

这是我的project/build.properties

sbt.version=0.13.15
scala.version=2.12.2
build.scala.version=2.12.2
def.scala.versions=2.12.2

每次我开始sbt并尝试compile时,我都会遇到一些语法错误(我已将某些字符串更改为xxx,抱歉):< / p>

[info] Compiling 76 Scala sources to /home/antek/dev/scala/xxx/target/scala-2.12/classes...
[error] /home/antek/dev/scala/xxx/src/main/scala/api/xxx.scala:168: macros cannot be partially applied
[error]     httpPost(transApi, args + ("xxx" → f"$currentTime%d"), "API-Key", "API-Hash")
[error]                                           ^
[error] /home/antek/dev/scala/xxx/src/main/scala/api/xxx.scala:39: macros cannot be partially applied
[error]     httpPost(transApi, args + ("xxx" → f"$currentTime%d"), "API-Key", "API-Hash")
[error]                                          ^
[error] /home/antek/dev/scala/xxx/src/main/scala/api/HttpSignOperation.scala:51: macros cannot be partially applied
[error]         Log.put(f"HTTP GET returned status $status%d")
[error]                 ^
[error] /home/antek/dev/scala/xxx/src/main/scala/api/HttpSignOperation.scala:82: macros cannot be partially applied
[error]         Log.put(f"HTTP POST returned status $status%d")
[error]                 ^
[error] /home/antek/dev/scala/xxx/src/main/scala/api/JWSOperation.scala:38: macros cannot be partially applied
[error]         Log.put(f"HTTP POST returned status $status%d")
[error]                 ^
[error] 
[error]      while compiling: /home/antek/dev/scala/xxx/src/main/scala/api/Order.scala
[error]         during phase: typer
[error]      library version: version 2.10.4
[error]     compiler version: version 2.10.4
[error]   reconstructed args: -classpath /home/antek/dev/scala/xxx/target/scala-2.12/classes:/home/antek/.ivy2/cache/org.xer[... cut ...]64/jre/classes:/home/antek/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.12.2.jar

0 个答案:

没有答案