Suppress SBT eviction warnings - sbt

As of SBT 0.13.6, evictions are now warnings.
[warn] Scala version was updated by one of library dependencies:
[warn] * org.scala-lang:scala-library:(2.10.4, 2.10.1, 2.10.3, 2.10.0) -> 2.10.2
[warn] * org.scala-lang:scala-compiler:2.10.0 -> 2.10.4
[warn] To force scalaVersion, add the following:
[warn] ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }
[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn] * org.apache.httpcomponents:httpclient:(4.1.3, [4.1, 4.2)) -> 4.0.1
[warn] * org.specs2:specs2_2.10:(1.12.3, 2.3.13) -> 2.4.2
[warn] Run 'evicted' to see detailed eviction warnings
How can I suppress these warnings?

This should do it:
evictionWarningOptions in update := EvictionWarningOptions.default.withWarnTransitiveEvictions(false).withWarnDirectEvictions(false).withWarnScalaVersionEviction(false)

Related

Erlang erlyberly build is failing

Setup: Java 17.0.1, Ubuntu 22.04.1 LTS, openjfx installed
$ sudo apt-get install openjfx
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
.....
$ apt list --installed | grep fx
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
grub-gfxpayload-lists/jammy,now 0.7 amd64 [installed]
libmfx1/jammy,now 22.3.0-1 amd64 [installed,automatic]
libopenjfx-java/jammy,jammy,now 11.0.11+0-1 all [installed,automatic]
libopenjfx-jni/jammy,now 11.0.11+0-1 amd64 [installed,automatic]
openjfx-source/jammy,jammy,now 11.0.11+0-1 all [installed,automatic]
openjfx/jammy,now 11.0.11+0-1 amd64 [installed]
Reference: https://github.com/andytill/erlyberly/wiki/Compiling
I have git cloned as specified in the reference. When I try to build using "./mvnw clean compile install assembly:single", I am getting the following error. Please help me in resolving the issue.
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/bhuvan/git/erlyberly/src/main/java/erlyberly/TermTreeView.java:[38,20] package javafx.event does not exist
[ERROR] /home/bhuvan/git/erlyberly/src/main/java/erlyberly/TermTreeView.java:[39,28] package javafx.scene.control does not exist
[ERROR] /home/bhuvan/git/erlyberly/src/main/java/erlyberly/TermTreeView.java:[40,28] package javafx.scene.control does not exist
[ERROR] /home/bhuvan/git/erlyberly/src/main/java/erlyberly/TermTreeView.java:[41,28] package javafx.scene.control does not exist
[ERROR] /home/bhuvan/git/erlyberly/src/main/java/erlyberly/TermTreeView.java:[42,28] package javafx.scene.control does not exist
[ERROR] /home/bhuvan/git/erlyberly/src/main/java/erlyberly/TermTreeView.java:[43,28] package javafx.scene.control does not exist
[ERROR] /home/bhuvan/git/erlyberly/src/main/java/erlyberly/TermTreeView.java:[44,26] package javafx.scene.input does not exist
[ERROR] /home/bhuvan/git/erlyberly/src/main/java/erlyberly/TermTreeView.java:[45,26] package javafx.scene.input does not exist
[ERROR] /home/bhuvan/git/erlyberly/src/main/java/erlyberly/TermTreeView.java:[46,26] package javafx.scene.input does not exist
[ERROR] /home/bhuvan/git/erlyberly/src/main/java/erlyberly/TermTreeView.java:[49,35] cannot find symbol

unresolved dependencies - Error while importing SBT project

Error while importing SBT project:...[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.apache.hadoop#hadoop-mapreduce-client-app;2.6.0-cdh5.4.2: not found
[warn] :: org.apache.hadoop#hadoop-mapreduce-client-core;2.6.0-cdh5.4.2: not found
[warn] :: org.apache.hadoop#hadoop-mapreduce-client-jobclient;2.6.0-cdh5.4.2: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[trace] Stack trace suppressed: run 'last prj1/:update' for the full output.
[trace] Stack trace suppressed: run 'last prj2/:ssExtractDependencies' for the full output.
[trace] Stack trace suppressed: run 'last prj1/:ssExtractDependencies' for the full output.
[error] (prj1/:update) sbt.ResolveException: unresolved dependency: org.apache.hadoop#hadoop-mapreduce-client-app;2.6.0-cdh5.4.2: not found
[error] unresolved dependency: org.apache.hadoop#hadoop-mapreduce-client-core;2.6.0-cdh5.4.2: not found
[error] unresolved dependency: org.apache.hadoop#hadoop-mapreduce-client-jobclient;2.6.0-cdh5.4.2: not found
[error] (prj2/:ssExtractDependencies) sbt.ResolveException: unresolved dependency: org.apache.hadoop#hadoop-mapreduce-client-app;2.6.0-cdh5.4.2: not found
[error] unresolved dependency: org.apache.hadoop#hadoop-mapreduce-client-core;2.6.0-cdh5.4.2: not found
[error] unresolved dependency: org.apache.hadoop#hadoop-mapreduce-client-jobclient;2.6.0-cdh5.4.2: not found
[error] (prj1/:ssExtractDependencies) sbt.ResolveException: unresolved dependency: org.apache.hadoop#hadoop-mapreduce-client-app;2.6.0-cdh5.4.2: not found
[error] unresolved dependency: org.apache.hadoop#hadoop-mapreduce-client-core;2.6.0-cdh5.4.2: not found
[error] unresolved dependency: org.apache.hadoop#hadoop-mapreduce-client-jobclient;2.6.0-cdh5.4.2: not found
[error] Total time: 146 s, completed May 17, 2016 4:16:57 PM
Any suggestions on how to go about resolving the issue. The import works fine on another machine. I see the jar files in .ivy2 folder.
I was using Intellij, SBT. The issue was that the repositories location had to be properly specified. To specify that go to File -> Settings -> (Search for SBT) then in the VM parameters you can specify the repostories.
-XX:MaxPermSize=1024M
-Dsbt.override.build.repos=true
-Dsbt.repository.config=/usr/local/basically_some_path/some_repo_file_name.repositories
IntelliJ IDEA 2016.1.2
Build #IU-145.971, built on April 29, 2016
JRE: 1.8.0_76-release-b47 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

Dispatch with sbt 0.11 gives sbt.ResolveException: unresolved dependency

Update:
I was using SBT 0.11 while "sbt 0.12" is required. a update of SBT does the job!
I followed the steps to install Dispatch with sbt.
$ echo 'libraryDependencies += "net.databinder.dispatch" %% "dispatch-core" % "0.11.0"' > build.sbt
When I ran:
$ sbt console
I got the following error message:
sbt.ResolveException: unresolved dependency: net.databinder.dispatch#dispatch-core_2.10.0;0.11.0: not found
What's wrong?

How do I find outdated libraries with sbt?

How can I find libraries which have newer versions with sbt.
For Ruby bundler, it can be done with bundle outdated. I want to do similar thing with sbt.
There is sbt-updates which gives you latest stable and snapshot versions. Not sure how reliable it is, though.
Example run:
my-project $ sbt
[info] Set current project to my-project
> dependencyUpdates
[info] Found 14 dependency updates for my-project
[info] com.typesafe.akka:akka-actor : 2.2.1 -> 2.2.3
[info] com.typesafe.akka:akka-agent : 2.2.1 -> 2.2.3
[info] com.typesafe.akka:akka-dataflow : 2.2.1 -> 2.2.3
[info] com.typesafe.akka:akka-slf4j : 2.2.1 -> 2.2.3
[info] com.typesafe.akka:akka-testkit : 2.2.1 -> 2.2.3
[info] com.typesafe.akka:akka-zeromq : 2.2.1 -> 2.2.3
[info] org.scala-lang.plugins:continuations:plugin->default(compile) : 2.10.2 -> 2.10.3
[info] org.scala-lang:scala-library : 2.10.2 -> 2.10.3
[info] org.scalaz:scalaz-concurrent : 7.0.3 -> 7.0.5
[info] org.scalaz:scalaz-core : 7.0.3 -> 7.0.4
[info] org.scalaz:scalaz-effect : 7.0.3 -> 7.0.5
[info] org.scalaz:scalaz-iteratee : 7.0.3 -> 7.0.5
[info] org.scalaz:scalaz-typelevel : 7.0.3 -> 7.0.5
[info] org.scalaz:scalaz-xml : 7.0.3 -> 7.0.5
You can use "SBT > dependencyUpdates" in the command line. Just like described above. That will work. But that is now automated.
You can use VersionEye to monitor your build.sbt file on GitHub/Bitbucket. VersionEye will notify you about out-dated dependencies in your project, automatically via email. In that way it is completely automated and you don't have to remember to execute commands in the shell. It's like a CI Server for versions ;-)
By the way, I'm the dude who started VersionEye. Let me know if you have questions.

specs2-embedmongo unresolved dependency with Scala 2.10.1 and Play 2.1.1

I'm within a Play 2.1.1, scala 2.10.1 environment using the latest Salat build
I'm trying to get the specs2-embedmongo dependency as described in their README.md: adding the following line to my Build.scala:
"com.github.athieriot" %% "specs2-embedmongo" % "0.5"
I also added, as indicated, the line
"de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "1.31"
But when running play dependencies I get this output:
[warn] module not found: com.github.athieriot#specs2-embedmongo_2.10;0.5
[warn] ==== local: tried
[warn] /usr/local/Cellar/play/2.1.1/libexec/repository/local/com.github.athieriot/specs2-embedmongo_2.10/0.5/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/com/github/athieriot/specs2-embedmongo_2.10/0.5/specs2-embedmongo_2.10-0.5.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn] http://repo.typesafe.com/typesafe/snapshots/com/github/athieriot/specs2-embedmongo_2.10/0.5/specs2-embedmongo_2.10-0.5.pom
[warn] ==== sonatype-snapshots: tried
[warn] https://oss.sonatype.org/content/repositories/snapshots/com/github/athieriot/specs2-embedmongo_2.10/0.5/specs2-embedmongo_2.10-0.5.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/com/github/athieriot/specs2-embedmongo_2.10/0.5/specs2-embedmongo_2.10-0.5.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.github.athieriot#specs2-embedmongo_2.10;0.5: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] (*:update) sbt.ResolveException: unresolved dependency: com.github.athieriot#specs2-embedmongo_2.10;0.5: not found
Is there a way to make this work with my current setup?
I am currently working at compiling the library against Scala 2.10 while keeping the 2.9 compatibility. Need to clean up some other dependencies for that :)
Maybe the lib has not been compiled against Scala 2.10. You could try using the previous version:
"com.github.athieriot" % "specs2-embedmongo_2.9.1" % "0.5"

Resources