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
38
votes
7 answers

How to configure Ivy cache directory per-user or system-wide?

I am using SBT as my build tool for building a Scala project. My problem is, I can't configure SBT to download dependencies to my user home directory. Therefore I am looking for a per-user or even better a system-wide setting to tell SBT to put the…
Ruediger Keller
  • 3,024
  • 2
  • 20
  • 17
38
votes
1 answer

How to disable ScalaDoc generation in dist task in Play 2.2.x (using project/build.scala)?

Adding the following settings to the build.sbt file of a Play 2.2.x app does not disable Scaladoc generation. How can it be disabled? play.Project(appName, appVersion, appDependencies) .settings(scalaVersion := "2.10.3") …
Max L.
  • 9,774
  • 15
  • 56
  • 86
37
votes
2 answers

How can I skip tests in an SBT build?

I have an SBT 0.7.5 project and its some test cases fail. Until all test cases are fixed, I want to skip tests to generate a JAR. Is there any command line argument that tells SBT to skip all tests, like Maven's -Dmaven.test.skip=true flag?
trustin
  • 12,231
  • 6
  • 42
  • 52
37
votes
7 answers

how do I get sbt to gather all the jar files my code depends on into one place?

I'm new to sbt. I want it to put all the dependency jar files as well as my jar file into one place. SBT will run the app, but I've got various dependencies scattered around and an .ivy folder full of things my jar file depends on indirectly. So Is…
Tim Pigden
  • 895
  • 2
  • 9
  • 18
37
votes
7 answers

sbt assembly command not found

I'm trying to run sbt assembly. According to https://github.com/sbt/sbt-assembly , for sbt 0.13.6+ (I'm on 0.13.7) this should be included automatically for anything with the JvmPlugin. According to sbt plugins I have the JvmPlugin enabled in root.…
Jonathan Sweetman
  • 605
  • 1
  • 6
  • 16
37
votes
1 answer

Idiomatic way to write multi-project builds with .sbt files in sbt 0.13

I hear .sbt files have been improved in various ways in 0.13, and that now I can specify multi-project builds in them. http://www.scala-sbt.org/0.13.0/docs/Community/ChangeSummary_0.13.0.html#sbt-format-enhancements mentions that we can now define…
Mysterious Dan
  • 1,316
  • 10
  • 25
37
votes
7 answers

How to turn off parallel execution of tests for multi-project builds?

I have a multi-project build with tests in sub-projects and in a parent project. The build is aggregated so that the parent project runs all tests in child projects. I configured it so that there's no parallel execution of tests in both the…
Manuel Bernhardt
  • 3,135
  • 2
  • 29
  • 36
37
votes
2 answers

Using SBT from Scala IDE

The path from SBT to Scala-IDE is well described in many places: Start with an SBT project Add the SBT plugin definition: addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0-RC1") Run the 'eclipse' command from within SBT Open…
Jack
  • 16,506
  • 19
  • 100
  • 167
36
votes
4 answers

IntelliJ IDEA - sbt plugin - 'Expression type Def.Setting[...] must conform DslEntry in sbt file'

I looked for similar questions, I found this: Expression type DslEntry must conform to Def.SettingsDefinition in SBT file at line enablePlugins(JavaServerAppPackaging) My issue is similar, but happens in every row. When I try to run, it compiles…
Rafael Leal
  • 461
  • 4
  • 6
36
votes
3 answers

Spark2.1.0 incompatible Jackson versions 2.7.6

I am trying to run a simple spark example in intellij, but I get the error like that: Exception in thread "main" java.lang.ExceptionInInitializerError at org.apache.spark.SparkContext.withScope(SparkContext.scala:701) at…
Yang
  • 612
  • 1
  • 6
  • 18
36
votes
4 answers

jboss interceptor api 1.1 not found when added as sbt dependency

I'm trying to set jboss-interceptor-api-1.1 as a dependency via sbt, but it can't be found. I've searched on Maven Repository and this version is there, can anyone help me? Actually, I'm trying to use sbt-assembly. Removing the plugin dependency and…
vicaba
  • 2,836
  • 1
  • 27
  • 45
36
votes
3 answers

How to force SBT to use Java 8?

How can I force SBT to compile to Java 8 class files. I added scalacOptions += "-target:jvm-1.8" but it gives the following error message: [error] 'jvm-1.8' is not a valid choice for '-target' [error] bad option: '-target:jvm-1.8' [error]…
Phil
  • 46,436
  • 33
  • 110
  • 175
36
votes
9 answers

SBT + Idea 13 => Cannot resolve symbol

I'm using SBT + Idea 13.1.1 and I have all my SBT file in red: name := "Transformer" version := "1.0" libraryDependencies ++= Seq( "com.github.scopt" %% "scopt" % "3.2.0", "org.scalatest" % "scalatest_2.10" % "2.1.0" % "test" ) It's saying…
Joan
  • 4,079
  • 2
  • 28
  • 37
36
votes
5 answers

Which version of Java does SBT use?

How to find out, which version of JDK SBT uses? My laptop has both JDK 1.6 and JDK 1.7 installed, so I was just wondering.
user972946
36
votes
3 answers

How to change setting inside SBT command?

I want to have a command publish-snapshot that would run the publish task with modified version setting (that setting is to be computed at the time of execution of the command). I figured out how to get the current value of the version inside…
Rogach
  • 26,050
  • 21
  • 93
  • 172