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
5
votes
1 answer

Building packages using sbt-git results in "SNAPSHOT-SNAPSHOT" version qualifier

We're using SBT with sbt-git to derive the version of our build from the Git revision. Specifically, we're using the output from git describe as version number and append the "SNAPSHOT" qualifier when the current revision is not tagged: val…
F30
  • 1,036
  • 1
  • 10
  • 21
5
votes
2 answers

sbt test-only specific test

I have several tests distributed over several classes. I would like to run only the first test from the first class: The class is: class Step1_PrimarySpec The test is: test("case1: Primary (in isolation) should properly register itself to the…
bsky
  • 19,326
  • 49
  • 155
  • 270
5
votes
1 answer

SBT - Multi project merge strategy and build sbt structure when using assembly

I have a project that consists of multiple smaller projects, some with dependencies upon each other, for example, there is a utility project that depends upon commons project. Other projects may or may not depend upon utilities or commons or neither…
null
  • 3,469
  • 7
  • 41
  • 90
5
votes
1 answer

Incompatible Jackson version: 2.7.1 in sbt?

I'm getting this error when running TwitterServer from sbt: SEVERE: LoadService: failed to instantiate 'com.twitter.finagle.stats.MetricsExporter' for the requested service…
mikebridge
  • 4,209
  • 2
  • 40
  • 50
5
votes
4 answers

How to setup scala sbt project for nd4j and deeplearning4j

I want to run the LSTM code from deeplearning4j examples in my own sbt project using scala. My setup is Ubuntu 14.04, sbt 0.13, Oracle Java 8, nd4j version 0.5.0, scala 2.11.8. My approach can be found in my git repo. Feel free to clone it. On…
Sebastian
  • 281
  • 1
  • 8
5
votes
0 answers

Sbt fork run doesn't work

Sbt docs say that To enable forking run tasks only, set fork to true in the run scope. fork in run := true But when I run my app with sbt run(or open sbt console and then run) I don't see another process in task manager. The same case also when I…
insan-e
  • 3,883
  • 3
  • 18
  • 43
5
votes
1 answer

SBT - Class not found, continuing with a stub

I am currently migrating my Play 2 Scala API project and encounter 10 warnings during the compilations indicating : [warn] Class play.core.enhancers.PropertiesEnhancer$GeneratedAccessor not found - continuing with a stub. All of them are the same,…
guigui
  • 103
  • 2
  • 8
5
votes
1 answer

Jackson version is too old

I have the following build.sbt file: name := "myProject" version := "1.0" scalaVersion := "2.11.8" javaOptions ++= Seq("-Xms512M", "-Xmx2048M", "-XX:MaxPermSize=2048M", "-XX:+CMSClassUnloadingEnabled") dependencyOverrides ++= Set( …
bsky
  • 19,326
  • 49
  • 155
  • 270
5
votes
1 answer

multiple SDKs for one intellij module

I have a multi-module, mono repo style SBT project that uses 64-bit java that we use IntelliJ to develop. At the root of the project we have a build.sbt file that imports subprojects. We recently introduced a new module that has a dll dependency…
canisrufus
  • 665
  • 2
  • 6
  • 19
5
votes
2 answers

SBT - do not replace dot with hyphen in published name

I have a config like this for the project in my build.sbt: name := "test-utils_0.1" organization := "com.my.test.project" version := "0.6.0-SNAPSHOT" My problem is - when I run sbt clean publish-local command, the jar gets published in the .ivy2…
TheMP
  • 8,257
  • 9
  • 44
  • 73
5
votes
0 answers

Unresolved dependencies: com.typesafe.play (Play Java)

I am receiving a similar error regarding typesafe.play. I have added scalaVersion := "2.11.7" to my build.sbt file and still seeing the same error. build.sbt version := "1.0-SNAPSHOT" lazy val root = (project in file(".")) …
JaRavi
  • 71
  • 3
5
votes
1 answer

How to ZIP files with a prefix folder in SBT

To generate a distribution ZIP with Simple Build Tool one can simply do def distPath = ( ((outputPath ##) / defaultJarName) +++ mainDependencies.scalaJars ) lazy val dist = zipTask(distPath, "dist", "distribution.zip") dependsOn (`package`)…
jelovirt
  • 5,844
  • 8
  • 38
  • 49
5
votes
2 answers

Passing command line argument to sbt test

In sbt run config can be passed easily, for example as: sbt "run -Dlib.lib1.version=2.0.0" But a similar thing fails when arguments are passed to sbt test. For example: sbt "test -Dlib.lib1.version=2.0.0" Official document states that sbt test…
KarateKid
  • 3,138
  • 4
  • 20
  • 39
5
votes
1 answer

How can i use a variable in sbt

I am creating a build.sbt for my project and it has dependencies mentioned like libraryDependencies ++= Seq( "com.typesafe.akka" % "akka-actor_2.11" % "2.3.15", …
Som Bhattacharyya
  • 3,972
  • 35
  • 54
5
votes
1 answer

Scala 'sbt' how to add the app build information to jar file?

I have "build.sbt" file like this: lazy val root = (project in file(".")). settings( name := "AppName", version := "1.0", ) I compiling source like this in PowerShell: $process = Start-Process -FilePath (Join-Path $sbtHome "sbt.bat")…
Drasius
  • 825
  • 1
  • 11
  • 26