Can I use powermock in my sbt project? - scala

I'm using sbt.version=1.1.5.
I wanna use powermock for mocking the static method.
my build.sbt
...
scalaVersion := "2.11.7"
libraryDependencies ++= Seq(
...
"org.mockito" % "mockito-core" % "2.18.3" % "test",
"org.powermock" % "powermock-api-mockito" % "1.7.4" % "test",
"org.powermock" % "powermock-module-javaagent" % "1.7.4" % "test",
"org.powermock" % "powermock-module-junit4-rule-agent" % "1.7.4" % "test"
)
MyClassSpec.scala
...
import org.powermock.modules.junit4.PowerMockRunner
...
#RunWith(classOf[PowerMockRunner])
...
got following error with sbt test.
[error] /foo/MyClassSpec.scala:15:8: object PowerMockRunner is not a member of package org.powermock.modules.junit4
[error] import org.powermock.modules.junit4.PowerMockRunner
[error] ^
[error] /foo/MyClassSpec.scala:18:18: not found: type PowerMockRunner
[error] #RunWith(classOf[PowerMockRunner])
[error] ^
[error] two errors found
[error] (Test / compileIncremental) Compilation failed
[error] Total time: 6 s, completed 2018/05/24 2:10:44

Related

Alpakka and Akka Version Compatibility Issue

When I try to sbt build my project, the project build fails with an "extracting product structure failed" error. I am suspecting something related to the versions I am using for Alpakka and Akka.
Here is my build.sbt file:
lazy val akkaHttpVersion = "10.2.4" // "10.1.11"
lazy val akkaVersion = "2.6.14" // "2.5.31"
val JacksonVersion = "2.10.5.1"
lazy val root = (project in file(".")).
settings(
inThisBuild(List(
organization := "com.example",
scalaVersion := "2.13.4"//"2.12.11"
)),
name := "XYZ",
libraryDependencies ++= Seq(
"org.orekit" % "orekit" % "10.3",
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-actor-typed" % akkaVersion,
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"ch.qos.logback" % "logback-classic" % "1.2.3",
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % Test,
"com.typesafe.akka" %% "akka-actor-testkit-typed" % akkaVersion % Test,
"org.scalatest" %% "scalatest" % "3.1.4" % Test,
"org.ehcache" % "ehcache" % "3.1.3",
"org.apache.httpcomponents" % "httpclient" % "4.5.13",
"org.scala-lang.modules" %% "scala-parallel-collections" % "0.2.0",
"org.apache.sling" % "sling-maven-plugin" % "2.4.2",
"com.fasterxml.jackson.module" % "jackson-module-scala" % "2.0.2",
"com.fasterxml.jackson.core" % "jackson-databind" % JacksonVersion,
"com.typesafe.akka" %% "akka-stream-kafka" % "2.0.7",
"com.lightbend.akka" %% "akka-stream-alpakka-reference" % "2.0.2"
)
)
When I remove the alpakka dependency at the end of the library, the error goes away but I am unable to to build project because of the missing alpakka dependency.
Ultimately, I am just trying to implement this: https://akka.io/alpakka-samples/http-csv-to-kafka/step4.html
Gael: Here is the image of the error message from Intellij
When running sbt clean compile, I get the following error stack:
[warn]
[warn] Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading com.lightbend.akka:akka-stream-alpakka-reference_2.13:2.0.2
[error] Not found
[error] Not found
[error] not found: C:\Users\ihussein\.ivy2\localcom.lightbend.akka\akka-stream-alpakka-reference_2.13\2.0.2\ivys\ivy.xml
[error] not found: https://repo1.maven.org/maven2/com/lightbend/akka/akka-stream-alpakka-reference_2.13/2.0.2/akka-stream-alpakka-reference_2.13-2.0.2.pom
[error] at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:258)
[error] at lmcoursier.CoursierDependencyResolution.$anonfun$update$38(CoursierDependencyResolution.scala:227)
[error] at scala.util.Either$LeftProjection.map(Either.scala:573)
[error] at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:227)
[error] at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error] at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:53)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:103)
[error] at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:73)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:116)
[error] at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:116)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:97)
[error] at sbt.util.Tracked$.$anonfun$inputChangedW$1(Tracked.scala:219)
[error] at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:130)
[error] at sbt.Classpaths$.$anonfun$updateTask0$5(Defaults.scala:3486)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error] at sbt.Execute.work(Execute.scala:291)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error] at java.util.concurrent.FutureTask.run(Unknown Source)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[error] at java.util.concurrent.FutureTask.run(Unknown Source)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[error] at java.lang.Thread.run(Unknown Source)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.lightbend.akka:akka-stream-alpakka-reference_2.13:2.0.2
[error] Not found
[error] Not found
[error] not found: C:\Users\ihussein\.ivy2\localcom.lightbend.akka\akka-stream-alpakka-reference_2.13\2.0.2\ivys\ivy.xml
[error] not found: https://repo1.maven.org/maven2/com/lightbend/akka/akka-stream-alpakka-reference_2.13/2.0.2/akka-stream-alpakka-reference_2.13-2.0.2.pom
It seems that I needed to use "com.lightbend.akka" %% "akka-stream-alpakka-csv" % "2.0.2" instead of "com.lightbend.akka" %% "akka-stream-alpakka-reference" % "2.0.2".

sbt.librarymanagement.ResolveException: Error downloading org.scala-sbt:scripted-plugin_2.13:1.4.4

Whose problem is this and how does it get (re)solved?
My build.sbt works fine in Scala 2.12.12
My SBT is version 1.4.4
scalaVersion := "2.12.12"
If however I attempt to update Scala to 2.13.4 (or 2.13.0)
scalaVersion := "2.13.4"
Then I get this in the sbt console:
[warn]
[warn] Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading org.scala-sbt:scripted-plugin_2.13:1.4.4
[error] Not found
[error] Not found
[error] not found: https://repo1.maven.org/maven2/org/scala-sbt/scripted-plugin_2.13/1.4.4/scripted-plugin_2.13-1.4.4.pom
[error] not found: /Users/garyhewett/.ivy2/local/org.scala-sbt/scripted-plugin_2.13/1.4.4/ivys/ivy.xml
[error] not found: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-sbt/scripted-plugin_2.13/1.4.4/ivys/ivy.xml
[error] not found: https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/scripted-plugin_2.13/1.4.4/ivys/ivy.xml
[error] at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:258)
[error] at lmcoursier.CoursierDependencyResolution.$anonfun$update$38(CoursierDependencyResolution.scala:227)
[error] at scala.util.Either$LeftProjection.map(Either.scala:573)
[error] at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:227)
[error] at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error] at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:53)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:103)
[error] at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:73)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:116)
[error] at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:116)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:97)
[error] at sbt.util.Tracked$.$anonfun$inputChangedW$1(Tracked.scala:219)
[error] at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:130)
[error] at sbt.Classpaths$.$anonfun$updateTask0$5(Defaults.scala:3485)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error] at sbt.Execute.work(Execute.scala:291)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] at java.base/java.lang.Thread.run(Thread.java:829)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading org.scala-sbt:scripted-plugin_2.13:1.4.4
[error] Not found
[error] Not found
[error] not found: https://repo1.maven.org/maven2/org/scala-sbt/scripted-plugin_2.13/1.4.4/scripted-plugin_2.13-1.4.4.pom
[error] not found: /Users/garyhewett/.ivy2/local/org.scala-sbt/scripted-plugin_2.13/1.4.4/ivys/ivy.xml
[error] not found: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-sbt/scripted-plugin_2.13/1.4.4/ivys/ivy.xml
[error] not found: https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/scripted-plugin_2.13/1.4.4/ivys/ivy.xml
I'm documenting the question here as I can not seem to find any references to it at all (yet) but given that there have been at least 4 upgrades in Scala 2.13 then there must be something I'm missing.
I'm using this in the libraryDependencies:
"org.scala-sbt" %% "scripted-plugin" % sbtVersion.value,
and I think (but am not sure) I would be happy to turn "scripted" off but do not seem to be able to do so. Yes I checked the project/plugins (not there) and build.properties (not there either)
Attempts tp "turn off" scripted result in this output:
References to undefined settings:
scriptedLaunchOpts from scripted ((sbt.ScriptedPlugin.projectSettings) ScriptedPlugin.scala:99)
scriptedBufferLog from scripted ((sbt.ScriptedPlugin.projectSettings) ScriptedPlugin.scala:99)
Did you mean Test / g8 / scriptedBufferLog ?
scriptedLaunchOpts from Test / g8Test ((giter8.Giter8Plugin.giter8TestSettings) Giter8Plugin.scala:102)
scriptedBufferLog from Test / g8Test ((giter8.Giter8Plugin.giter8TestSettings) Giter8Plugin.scala:102)
Did you mean Test / g8 / scriptedBufferLog ?
I have this for the resolvers:
resolvers += Resolver.url("typesafe", url("https://repo.typesafe.com/typesafe/ivy-releases/"))(Resolver.ivyStylePatterns),
/project/build.sbt
sbt.version=1.4.4
/project.giter8.sbt
addSbtPlugin("org.foundweekends.giter8" % "sbt-giter8" % "0.11.0")
/project/plugins.sbt
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0") // 2020-Sep-29 -- https://github.com/sbt/sbt-assembly/releases
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.5.0") // 2020-Apr-03 -- https://index.scala-lang.org/playframework/twirl/twirl-api
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") // 2020-May-15 -- https://github.com/sbt/sbt-git
build.sbt
sbtPlugin := true
scalaVersion := "2.12.12" // 2020-09-29 https://scala-lang.org/download/all.html
lazy val scalacheck = "org.scalacheck" %% "scalacheck" % "1.14.2" // 2020-09-29 -- https://github.com/typelevel/scalacheck/blob/master/RELEASE.markdown
parallelExecution in Test := false
lazy val lambda = (project in file("."))
.settings(
scriptedLaunchOpts ++= List("-Xms1024m", "-Xmx1024m", "-XX:ReservedCodeCacheSize=128m", "-XX:MaxPermSize=256m", "-Xss2m", "-Dfile.encoding=UTF-8"),
resolvers += Resolver.url("typesafe", url("https://repo.typesafe.com/typesafe/ivy-releases/"))(Resolver.ivyStylePatterns),
libraryDependencies ++= Seq(
scalacheck % Test,
"com.github.bigwheel" %% "util-backports" % "2.1", // 2020-Dec-11 -- https://index.scala-lang.org/bigwheel/util-backports/util-backports/1.1?target=_2.12
"org.scala-sbt" %% "scripted-plugin" % sbtVersion.value, // 2020-Dec-08 -- https://github.com/sbt/sbt/issues/3514
"com.amazonaws" % "aws-java-sdk-dynamodb" % "1.11.903", // 2020-Nov-18 -- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-dynamodb
"com.amazonaws" % "aws-java-sdk-kms" % "1.11.903", // 2020-Nov-18 -- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-kms
"com.amazonaws" % "aws-java-sdk-lambda" % "1.11.903", // 2020-Nov-18 -- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-lambda
"com.amazonaws" % "aws-java-sdk-rdsdata" % "1.11.903", // 2020-Nov-18 -- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-rdsdata
"com.amazonaws" % "aws-java-sdk-s3" % "1.11.903", // 2020-Nov-18 -- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-s3
"com.amazonaws" % "aws-lambda-java-core" % "1.2.1", // 2020-Apr-29 -- https://mvnrepository.com/artifact/com.amazonaws/aws-lambda-java-core
"com.amazonaws" % "aws-lambda-java-events" % "3.6.0", // 2020-Nov-18 -- https://mvnrepository.com/artifact/com.amazonaws/aws-lambda-java-events
"com.sun.mail" % "jakarta.mail" % "1.6.5", // 2020-Jun-10 -- https://eclipse-ee4j.github.io/mail/ https://mvnrepository.com/artifact/com.sun.mail/smtp Latest is 1.6.5 however only 1.6.2 will load
"com.typesafe" % "config" % "1.4.0", // 2020-Mar-27 -- https://github.com/lightbend/config
"com.twilio.sdk" % "twilio" % "8.2.0", // 2020-Nov-18 -- https://www.twilio.com/docs/libraries/java#using-with-a-build-automation-tool
"com.authy" % "authy-java" % "1.5.0", // 2020-Aug-13 -- https://github.com/twilio/authy-java
"org.mariadb.jdbc" % "mariadb-java-client" % "2.7.0", // 2020-Sep-29 -- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client
"mysql" % "mysql-connector-java" % "8.0.22", // 2020-Nov-18 -- https://mvnrepository.com/artifact/mysql/mysql-connector-java
"com.typesafe.play" %% "play-json" % "2.9.1", // 2020-Sep-29 -- https://mvnrepository.com/artifact/com.typesafe.play/play-json
"com.github.cb372" %% "scalacache-caffeine" % "0.28.0", // 2020-May-15 -- https://cb372.github.io/scalacache/docs/cache-implementations.html
"org.slf4j" % "slf4j-nop" % "1.7.21" // 202-May-19 -- https://github.com/sbt/sbt-git (just turns off error by loading a NOOP class)
)
)
.enablePlugins(SbtTwirl) // 2020-Apr-03 -- https://index.scala-lang.org/playframework/twirl/twirl-api
.enablePlugins(GitVersioning) // 2020-May-15 -- https://github.com/sbt/sbt-git
.enablePlugins(GitBranchPrompt) // 2020-May-15 -- https://github.com/sbt/sbt-git
.enablePlugins(ScriptedPlugin)
I can not seem to find any reference to scripted-plugin_2.13 in maven which leads me to think this is most likely a configuration error on my part?
To be clear my final goal is simply to update the Scala version to 2.13.4

Task "assembly" fails with "[error] (assembly) java.nio.file.InvalidPathException: Trailing char < > at index 121"

Executing the task "assembly" fails with [error] (assembly) java.nio.file.InvalidPathException: Trailing char < > at index 121: C:\Users\IdeaProjects\GlobalConfigEditor\target\scala-2.13\GlobalConfigEditor-SettingKey(This \ This \ This.
build.sbt
name := "GlobalConfigEditor"
version := "0.3"
scalaVersion := "2.13.1"
mainClass in assembly := Some("globalconfig.ConfigEditorApplication")
assemblyJarName in assembly := s"GlobalConfigEditor-$version.jar"
assemblyMergeStrategy in assembly := {
case PathList("META-INF", xs#_*) => MergeStrategy.discard
case PathList("reference.conf") => MergeStrategy.concat
case x => MergeStrategy.first
}
libraryDependencies += "org.apache.commons" % "commons-lang3" % "3.9"
libraryDependencies += "commons-io" % "commons-io" % "2.6"
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3"
libraryDependencies += "com.typesafe.scala-logging" % "scala-logging_2.13" % "3.9.2"
libraryDependencies += "com.typesafe.akka" %% "akka-actor-typed" % "2.6.3"
libraryDependencies += "org.fxmisc.richtext" % "richtextfx" % "0.10.4"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.1" % "test"
libraryDependencies += "org.scalamock" %% "scalamock" % "4.4.0" % Test
libraryDependencies += "org.mockito" % "mockito-scala_2.13" % "1.11.3"
libraryDependencies += "org.mockito" % "mockito-scala-scalatest_2.13" % "1.11.3"
plugins.sbt
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
build.properties
sbt.version=1.3.8
Stack trace
[error] java.nio.file.InvalidPathException: Trailing char < > at index 107: C:\Users\user\GlobalConfigEditor\target\scala-2.13\GlobalConfigEditor-SettingKey(This \ This \ This
[error] at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:172)
[error] at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
[error] at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
[error] at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
[error] at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
[error] at java.io.File.toPath(File.java:2234)
[error] at sbt.io.IO$.createDirectory(IO.scala:330)
[error] at sbt.io.IO$.archive(IO.scala:643)
[error] at sbt.io.IO$.jar(IO.scala:619)
[error] at sbt.Package$.makeJar(Package.scala:164)
[error] at sbtassembly.Assembly$.makeJar$1(Assembly.scala:40)
[error] at sbtassembly.Assembly$.$anonfun$apply$13(Assembly.scala:81)
[error] at sbtassembly.Assembly$.$anonfun$apply$13$adapted(Assembly.scala:77)
[error] at sbt.util.Tracked$.$anonfun$outputChanged$1(Tracked.scala:102)
[error] at sbtassembly.Assembly$.apply(Assembly.scala:85)
[error] at sbtassembly.Assembly$.$anonfun$assemblyTask$1(Assembly.scala:244)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error] at sbt.Execute.work(Execute.scala:290)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (assembly) java.nio.file.InvalidPathException: Trailing char < > at index 107: C:\Users\user\GlobalConfigEditor\target\scala-2.13\GlobalConfigEditor-SettingKey(This \ This \ This
[IJ]sbt:GlobalConfigEditor>
Can anyone help me with this one?
Disclaimer: This is a cross-post of this issue on github.
This:
assemblyJarName in assembly := s"GlobalConfigEditor-$version.jar"
does not do what you want. version is a setting. When you want to access its value, you need to do this:
assemblyJarName in assembly := s"GlobalConfigEditor-${version.value}.jar"

Some references to JS libraries could not be resolved

I am trying to follow the ScalaJS Book tutorial. Based on their build.sbt sample here https://github.com/ochrons/scalajs-spa-tutorial/blob/master/build.sbt
I have created the following build.sbt
lazy val client = (project in file("client"))
.settings(
name := "client",
version := "1.0.0",
scalaVersion := "2.12.4",
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.4",
"com.lihaoyi" %%% "scalatags" % "0.6.7",
"com.vmunier" %% "scalajs-scripts" % "1.1.1",
"org.webjars" % "font-awesome" % "5.0.6" % Provided,
"org.webjars" % "bootstrap" % "4.0.0" % Provided,
"com.lihaoyi" %% "utest" % "0.6.3" % Test
),
jsDependencies ++= Seq(
"org.webjars.bower" % "react" % "16.1.0" / "react-with-addons.js" minified "react-with-addons.min.js" commonJSName "React",
"org.webjars.bower" % "react" % "16.1.0" / "react-dom.js" minified "react-dom.min.js" dependsOn "react-with-addons.js" commonJSName "ReactDOM",
"org.webjars" % "jquery" % "3.3.1" / "jquery.js" minified "jquery.min.js",
"org.webjars" % "bootstrap" % "4.0.0" / "bootstrap.js" minified "bootstrap.min.js" dependsOn "jquery.js",
"org.webjars" % "chartjs" % "2.7.0" / "Chart.js" minified "Chart.min.js",
"org.webjars" % "log4javascript" % "1.4.13" / "js/log4javascript_uncompressed.js" minified "js/log4javascript.js"
),
skip in packageJSDependencies := false,
scalaJSUseMainModuleInitializer := true,
scalaJSUseMainModuleInitializer in Test := false,
testFrameworks += new TestFramework("utest.runner.Framework")
).enablePlugins(ScalaJSPlugin).dependsOn(SharedJS)
But when I do sbt ~fastOptJS I get an error
[error] org.scalajs.core.tools.jsdep.JSLibResolveException: Some references to JS libraries could not be resolved:
[error] - Missing JS library: react-dom.js
[error] originating from: client:compile
[error] - Missing JS library: react-with-addons.js
[error] originating from: client:compile
[error]
[error] at org.scalajs.core.tools.jsdep.DependencyResolver$.resolveAllResourceNames(DependencyResolver.scala:84)
[error] at org.scalajs.core.tools.jsdep.DependencyResolver$.resolveDependencies(DependencyResolver.scala:25)
[error] at org.scalajs.sbtplugin.ScalaJSPluginInternal$.$anonfun$scalaJSConfigSettings$46(ScalaJSPluginInternal.scala:671)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error] at sbt.std.Transform$$anon$4.work(System.scala:66)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:271)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (client / Compile / resolvedJSDependencies) org.scalajs.core.tools.jsdep.JSLibResolveException: Some referencesto JS libraries could not be resolved:
[error] - Missing JS library: react-dom.js
[error] originating from: client:compile
[error] - Missing JS library: react-with-addons.js
[error] originating from: client:compile
[error] Total time: 3 s, completed Feb 10, 2018 9:02:20 PM
Take a look at:
https://github.com/reactjs/react-bower
there is no
react-with-addons.js
package ...
There are other projects like https://scalacenter.github.io/scalajs-bundler/getting-started.html
besides you can manually include external JS sources via cdn:
https://reactjs.org/docs/cdn-links.html

Wrong scalac compiler version invoked by SBT

I'm using Fedora Linux and sbt. I think I've tried everything, but I can't persuade sbt to use Scala 2.12.2 to compile my project.
When I compile the same project with:
Gradle,
IntelliJ IDEA,
SBT on a different Linux distro,
everything works. I just can't get it to work on Fedora Linux and sbt.
Here's my 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"
Here's my 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
Every time I start sbt and try to compile, I'm getting some syntax errors (I've changed some strings to xxx, sorry):
[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