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
9338 questions
345
votes
8 answers

How to check sbt version?

How do I check which version of sbt I'm running? I have the bash file set up that uses sbt-launch.jar, and it works, but $ sbt version only shows the "project version" (0.1) and $ sbt --version does nothing.
jpswain
  • 14,344
  • 8
  • 55
  • 63
173
votes
3 answers

How to "re-run with -deprecation for details" in sbt?

When I compile Scala code, by running sbt compile, SBT says: $ sbt compile ... [warn] there were 5 deprecation warnings; re-run with -deprecation for details ... How do I do that? (From within SBT?)
KajMagnus
  • 10,177
  • 14
  • 69
  • 115
166
votes
2 answers

Build.scala, % and %% symbols meaning

I'm new to Play! Framework 2.1 (java version) and have no experience with scala. I don't understand what are and what does % and %% mean in Build.scala. I googled about them but couldn't find their meaning. In my Build.scala file I…
Franco
  • 8,739
  • 7
  • 25
  • 32
161
votes
5 answers

ScalaTest in sbt: is there a way to run a single test without tags?

I know that a single test can be ran by running, in sbt, testOnly *class -- -n Tag Is there a way of telling sbt/scalatest to run a single test without tags? For example: testOnly *class -- -X 2 it would mean "run the second test in the class.…
Nacht
  • 8,550
  • 6
  • 26
  • 39
148
votes
7 answers

How to create SBT project with IntelliJ Idea?

I just got started with Scala/LiftWeb/Sbt developing, and I'd like to import a Sbt project in IntelliJ Idea. Actually, I managed to import my project in two different ways: 1) with Maven. I created a Maven project, and of top of that I created a Sbt…
ksemeks
  • 1,766
  • 3
  • 15
  • 17
145
votes
5 answers

How to access test resources in Scala?

I have a file data.xml in src/test/resources/. How can I read that file into a new FileReader in my test data.scala in src/test/scala/?
Aaron Yodaiken
  • 17,660
  • 30
  • 95
  • 176
143
votes
3 answers

sbt-assembly: deduplication found error

I am not sure whether mergestrategy or exclude jars is the best option here. Any help with how do I proceed further with this error will be great! [sameert@pzxdcc0151 approxstrmatch]$ sbt assembly [info] Loading project definition from…
user3803714
  • 4,431
  • 9
  • 34
  • 59
142
votes
2 answers

Pros and cons of using sbt vs maven in Scala project

Which build tool is the best for Scala? What are the pros and cons of each of them? How to I determine which one of them to use in a project?
Konstantin Solomatov
  • 9,752
  • 6
  • 52
  • 83
127
votes
14 answers

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

What's the easiest way to debug Scala code managed by sbt using IntelliJ's built-in debugger? The documentation from "RunningSbt" from sbt's google code site lists commands for running the main class for a project or the tests, but there seem to be…
Matthew
  • 2,011
  • 2
  • 17
  • 13
126
votes
8 answers

stuck at "Getting org.scala-sbt sbt 0.13.6 ..." when running sbt in terminal

Similar problem with How to use sbt behind authenticated proxy?. I tried with the given answer and problem still there. When I run sbt in terminal, it shows and stucks at : Getting org.scala-sbt sbt 0.13.6 ... additional information: sbt…
HappyCoding
  • 4,529
  • 7
  • 25
  • 46
126
votes
6 answers

How to force IntelliJ IDEA to reload dependencies from build.sbt after they changed?

I'm using IntelliJ IDEA 13 (Community Edition) with the Scala plugin. My initial import of an existing Scala project with a build.sbt worked fine. The library dependencies were picked up by IDEA. Additional dependencies added after the initial…
David B.
  • 5,090
  • 5
  • 28
  • 51
122
votes
4 answers

SBT stop run without exiting

How do you terminate a run in SBT without exiting? I'm trying CTRL+C but it exits SBT. Is there a way to only exit the running application while keeping SBT open?
dsg
  • 12,504
  • 19
  • 64
  • 109
112
votes
5 answers

comparing sbt and Gradle

I am diving into Scala and noticed sbt. I have been quite happy with Gradle in java/groovy projects, and I know there's a scala plugin for Gradle. What could be good reasons to favour sbt over Gradle in a Scala project?
Hans Westerbeek
  • 5,369
  • 3
  • 32
  • 33
111
votes
11 answers

What's the reason for "Error:Cannot determine Java VM executable in selected JDK"?

I am using IntelliJ IDEA 13.1.4 and also tried the latest release 14. Running SBT I get the following error: Error:Cannot determine Java VM executable in selected JDK I have JDK 1.7 installed on my machine and on PATH. In the logs…
Zuriar
  • 8,864
  • 14
  • 46
  • 76
107
votes
3 answers

What is the difference between build.sbt and build.scala?

I started to learn Scala and almost in every tutorial I see a build.sbt file which describes project settings. But now I have installed giter8 and created a project from template. And generated project from template missed build.sbt file, but it…
MyTitle
  • 17,348
  • 50
  • 147
  • 265
1
2 3
99 100