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

How to prevent SBT from resolving the same dependencies for different projects

I have a .sbt file with 4 projects. They all share many dependencies. When I Refresh SBT in Idea, it seems to resolve all dependencies over and over again, even if they have been previously resolved in other projects. Is there any way to prevent…
mirosval
  • 6,671
  • 3
  • 32
  • 46
5
votes
3 answers

Where is the base docker image specified in Play Framework?

My application is built on Play Framework (2.5.3) using Scala. In order to deploy the app, I create a docker image using sbt docker:publishLocal command. I am trying to figure out where the base docker image file is in the play framework folder…
darthjit
  • 1,555
  • 13
  • 20
5
votes
2 answers

Scala worksheet can not resolve class name - IntelliJ IDEA

I am following along with a lecture, the lecturer is using Eclipse but I am using IntelliJ IDEA Community Edition 15.0.6, and the code on a Scala worksheet named rationals.scala is as follows object rationals{ val x = new Rational(1,2) x.numer …
Max Wen
  • 737
  • 2
  • 10
  • 21
5
votes
1 answer

Intertwined dependencies between sbt plugin and projects within multi-project build that uses the plugin itself

I'm developing a library that includes an sbt plugin. Naturally, I'm using sbt to build this (multi-project) library. My (simplified) project looks as follows: myProject/ # Top level of library -> models …
saeta
  • 639
  • 4
  • 8
5
votes
2 answers

How to make SBT not truncate its output?

Take for example the command sbt "inspect tree clean". This truncates its output (with ..) to the width of the terminal, or 40 characters if redirected to a file. C:\dev>sbt "inspect tree clean" [info] Loading project definition from…
OrangeDog
  • 36,653
  • 12
  • 122
  • 207
5
votes
2 answers

Substituting Ivy modules transitively

I'm using Ivy programmatically (in the context of SBT) and I need to be able to transitively substitute a small set of modules with a compatible set which have a different organisation, but which share artifact names, revisions etc. To give a…
Miles Sabin
  • 23,015
  • 6
  • 61
  • 95
5
votes
0 answers

How to make scoverage work with multi-project that are not located on the same project-root?

I work with a multi-project structure in scala. Some of the projects are located outside the root-project. There is a simlink to link them and make sbt works. Here is a small example of the structure: some-project root-folder/some-project ->…
Said Abidi
  • 51
  • 1
5
votes
0 answers

Include sub-module artifacts in SBT multi-project build

I have a multi-project build that makes extensive use of sub-projects in order to make dependencies between them explicit (by means of dependsOn - the sub-projects act as layers). If it comes to publishing I want to roll up all the sub-project…
5
votes
2 answers

sbt, publishLocal, resolve errors

I want to push my artifacts to local ivy repository in order to use them as dependencies in other projects. My artifact's build.scala: name := "jsonApi" organization := "com.github.kondaurovdev" version := "0.1-SNAPSHOT" scalaVersion :=…
Alexander Kondaurov
  • 3,677
  • 5
  • 42
  • 64
5
votes
1 answer

SBT Run Main Method from a Sub Project

I am writing a project which contains scala macros. This is why I have organized my project into two sub projects called "macroProj" and "coreProj". The "coreProj" depends on "macroProj" and also contains the main method to run my code. My…
Knows Not Much
  • 30,395
  • 60
  • 197
  • 373
5
votes
3 answers

Automatically inject WebJarAssets in Play 2.5 HTML template?

In my Play HTML template inside my custom module, I have the following line of code: This references a WebJarAssets class…
John Doe
  • 275
  • 3
  • 12
5
votes
1 answer

Is there a way to specify an alternate location for sbt to look for build config via the command line?

As far as I can tell when you run the sbt executable it looks for your build configuration within the current directory structure (build.sbt or build scala files). Is there a way to specify an alternate location for the sbt executable to look for…
ssanj
  • 2,169
  • 3
  • 19
  • 28
5
votes
1 answer

What is "$ play test" dropdown in circleCI?

Im trying to upload my project to circleci but from some reason it fails in a dropdown called "$ play test", I have no idea what is it, and I dont have tests in my project at all. this is the section im talking about: and im getting error there,…
Joe
  • 2,543
  • 3
  • 25
  • 49
5
votes
2 answers

IntelliJ - Unable to load AWS credentials from any provider in the chain

I'm getting this weird issue when trying to import an SBT project into IntelliJ IDEA 15 CE. The message is simply Unable to load AWS Credentials from any provider in the chain. I've tried exposing AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as…
bioball
  • 1,339
  • 1
  • 12
  • 23
5
votes
2 answers

Send module version as command line argument to SBT

I am using TeamCity to run a bash script that is utilizing SBT Native Packager to publish an image to Docker. The sbt portion of the bash script looks something like this: sbt -DdockerRepository=$repo -DpackageName=$packageName -D…
Øyvind Holmstad
  • 1,379
  • 2
  • 13
  • 22
1 2 3
99
100