Questions tagged [sbt]

sbt is an open source build tool for Scala and Java projects, similar to Java's Maven or Ant.

  • Fast and unintrusive to build simple projects.
  • Supports multiple projects/modules, external projects and other advanced setups.
  • Configuration, customization, and extension are done in Scala.
  • Dependency management support: inline declarations, external Ivy or Maven configuration files, and manual library management.
  • Supports mixed Scala/Java projects, packages jars, generates documentation with scaladoc.
  • Plugin framework for customized integrations (i.e. web app servers, IDEs, ORMs).
  • Supports testing with ScalaCheck, specs, and ScalaTest (JUnit is supported by a plugin).
  • Continuous compilation and testing with triggered execution.
  • Accurate recompilation is done using information extracted from the compiler.
  • Starts the Scala REPL with project classes and dependencies on the classpath.
  • Parallel task execution, including parallel test execution.

Official repository at GitHub

Official website

Stack Overflow sbt Tutorial

  1. General
  2. Dependency management
  3. Multiproject builds with .sbt files
  4. Publishing
  5. Cross-building
  6. Logging
  7. Using plugins
  8. sbt-assembly
  9. Developing tasks
  10. Developing plugins
  11. Developing commands
  12. Outside sbt
9905 questions
61
votes
2 answers

How can I get complete stacktraces for exceptions thrown in tests when using sbt and testng?

The stacktraces are truncated - e.g. they end with [info] ... Using last or changing traceLevel doesn't help - it simply prints the complete stacktrace of the sbt wrapper. This is testing with testng (also I believe using scalatest and sl4j)
wn-
  • 1,475
  • 1
  • 14
  • 14
58
votes
5 answers

How can colored terminal output be disabled for sbt/play?

I would like to disable the color escape codes logged from sbt/play. Is this possible? And if it is, is there a way to do it without making changes to the config - i.e. via a command line switch or system property.
Mark Hibberd
  • 2,070
  • 1
  • 15
  • 12
57
votes
6 answers

How to execute tests in a single project only in multi-module build?

I have a multi-module build, and would like to run tests for different sub-projects independently. Is there a way to do this in sbt, e.g. if my multi-project build has a core and commons projects, I'd like to only run test in the commons project.
Brett
  • 5,690
  • 6
  • 36
  • 63
56
votes
4 answers

How to fix sbt reporting "Error wrapping InputStream in GZIPInputStream: java.io.EOFException"?

While running sbt command in an empty directory, it keeps failing with the following exception: $ sbt [info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins Error wrapping InputStream in GZIPInputStream: java.io.EOFException at…
Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
55
votes
6 answers

How to have Eclipse recognize dependencies from SBT

I am trying to figure out how to make Eclipse recognize dependencies that are retrieved using SBT? SBT download the correct dependencies and puts them in my ~/.ivy directory but eclipse doesn't see them. Is there a way to do this? thanks
chiappone
  • 2,728
  • 3
  • 27
  • 32
55
votes
10 answers

How to fully clean, re-resolve and rebuild a Scala sbt-managed project in IDEA?

TL;DR: How can I fully reconcile all dependencies in IntelliJ when SBT file changes I have a SBT project setup in IntelliJ. For the most part if works like a charm, but it is quite a pain for me, to change the version of the dependencies and…
Tobber
  • 7,211
  • 8
  • 33
  • 56
53
votes
5 answers

-Ywarn-unused-import triggering on play routes file

I want to be able to use -Xfatal-warnings and -Ywarn-unused-import, the problem is that the compiler is triggering an error on the file which contains the play routes for my application: [error] /path/to/app/conf/routes: Unused import [error]…
Ende Neu
  • 15,581
  • 5
  • 57
  • 68
53
votes
7 answers

How to open SBT Tool Window in Intellij?

This question may sound silly for you, but I have been searching the Internet for a while and couldn't find the answer. How can I open SBT Tool Window in Intellij (scala and SBT plugins obviously installed)?
DorianOlympia
  • 841
  • 1
  • 10
  • 22
53
votes
3 answers

How to reference external sbt project from another sbt project?

I have the following setup of a Scala application and a common core library: root -> /ApplicationA -> /project -> /build.sbt -> /CoreLibrary -> /project -> /build.sbt I want to add a reference from ApplicationA to CoreLibrary à la…
Diego
  • 5,024
  • 6
  • 38
  • 47
53
votes
4 answers

How to exclude commons-logging from a scala/sbt/slf4j project?

My scala/sbt project uses grizzled-slf4j and logback. A third-party dependency uses Apache Commons Logging. With Java/Maven, I would use jcl-over-slf4j and logback-classic so that I can use logback as the unified logging backend. I would also…
wks
  • 1,158
  • 1
  • 7
  • 12
52
votes
5 answers

Create standalone jar using SBT

I was a heavy Maven user and now I'm gradually using SBT for some of my projects. I'd like to know how could I use SBT to create a standalone Java project? This project should be packaged as a JAR file and this JAR file would be used as a dependency…
joesan
  • 13,963
  • 27
  • 95
  • 232
51
votes
1 answer

What is Scala's Simple Build Tool (sbt) and why is it used?

I am new in Scala and I have to learn Scala and SBT, I read the sbt tutorial but i am unable to understand the use of sbt, for what purpose its been used.After reading this tutorial I am still confused can any one will explain it in simple words,…
swaheed
  • 3,671
  • 10
  • 42
  • 103
50
votes
8 answers

Why does sbt compile fail with StackOverflowError?

I am working on a Scala project that has been in existence for a few years but is new to me. My task is to upgrade it from Scala 2.9.3 to 2.11.7, along with its dependencies. I have gotten past the errors and warnings, but I cannot get the project…
Kevin Doherty
  • 987
  • 1
  • 7
  • 7
49
votes
6 answers

How to access a secured Nexus with sbt?

I'm trying to access a Nexus repository manager which requires some basic authentication. Everything works fine from Maven2 but when I try to configure things in SBT it can't find the artifacts. It is using a custom repository pattern (see this…
Bryan J Swift
  • 1,449
  • 2
  • 15
  • 17
48
votes
4 answers

Why is the error Conflicting cross-version suffixes?

I'm getting this error when I try to compile a Scala project in sbt. Modules were resolved with conflicting cross-version suffixes in {file:/home/seven3n/caja/Flujo_de_caja/}flujo_de_caja: [error] com.typesafe.akka:akka-actor _2.11, _2.10 [error]…
Rodrigo Cifuentes Gómez
  • 1,304
  • 2
  • 13
  • 28