Can multi-projects from GIT be used as SBT dependencies?

I depend on Banana RDF subprojects all the time with ProjectRef, like this: lazy val core: Project = Project( … ).dependsOn( ProjectRef(uri(“git://github.com/w3c/banana-rdf.git”), “banana-jena”) ) One especially nice part is that you can just tack a commit or branch name as a fragment identifier on the URI and everything works exactly as you’d expect.

Exception in thread “main” java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)

Make sure Spark is compatible with corresponding Scala version The error is common when using Scala version 2.12 series with any version of Spark offering Scala 2.11. You can try using the 2.11 series of Scala with Spark . i.e. libraryDependencies += “org.apache.spark” % “spark-core_2.11” % “2.2.0” As you can see in this dependency spark-core_2.11 … Read more

How to run jar generated by package (possibly with other jars under lib)?

You can use the sbt plugin sbt-assembly: sbt-assembly >= 0.12.0 with sbt >= 0.13.6 Since sbt-assembly is now an auto plugin, it is sufficient to add project/assembly.sbt to your sbt project: addSbtPlugin(“com.eed3si9n” % “sbt-assembly” % “0.14.5”) sbt-assembly 0.11 Add project/assembly.sbt to your sbt project: addSbtPlugin(“com.eed3si9n” % “sbt-assembly” % “0.11.2”) Add assembly.sbt as well: import AssemblyKeys._ … Read more

“Unknown artifact. Not resolved or indexed” error for scalatest

If you just added the dependency, it might not have been downloaded yet. Refresh/reimport the project to do so. If it has already been downloaded, press Alt+Enter in IntelliJ on the lines with the warning and select the “update project resolvers’ indexes” quickfix, then select the “local cache” index and click “update”. You can verify … Read more

How to suppress info and success messages in sbt?

sbt 1.x, sbt 0.13.13+ Use -warn or -error. See Fixes with compatibility implications for sbt 0.13.13 release: it is strongly encouraged to migrate to the single hyphen options: -error, -warn, -info, and -debug sbt 0.13.1 To disable info messages run SBT with –warn or –error command line options. To disable [success] messages set showSuccess to … Read more

Debugging Scala code with simple-build-tool (sbt) and IntelliJ

There’s a very convenient -jvm-debug flag in the official SBT packages for Mac, Linux & Windows. You can use the flag to specify the debug port: sbt -jvm-debug 5005 Under the covers, this starts the JVM for SBT with the typical verbose debugging incantation: -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 You now can run your code as normal, for … Read more

How to add “provided” dependencies back to run/test tasks’ classpath?

For a similar case I used in assembly.sbt: run in Compile <<= Defaults.runTask(fullClasspath in Compile, mainClass in (Compile, run), runner in (Compile, run)) and now the ‘run’ task uses all the libraries, including the ones marked with “provided”. No further change was necessary. Update: @rob solution seems to be the only one working on latest … Read more