sbt

sbt, the interactive build tool

Subscribe to updates I use sbt


Statistics on sbt

Number of watchers on Github 3450
Number of open issues 769
Average time to close an issue 8 days
Main language Scala
Average time to merge a PR 2 days
Open pull requests 109+
Closed pull requests 44+
Last commit 7 months ago
Repo Created about 9 years ago
Repo Last Updated 6 months ago
Size 16.6 MB
Homepage https://scala-sbt...
Organization / Authorsbt
Latest Releasev1.1.1
Contributors137
Page Updated
Do you use sbt? Leave a review!
View open issues (769)
View sbt activity
View on github
Latest Open Source Launches
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating sbt for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Gitter Chat

sbt

sbt is a build tool for Scala, Java, and more.

For general documentation, see http://www.scala-sbt.org/.

sbt 1.x

This is the 1.x series of sbt. The source code of sbt is split across several Github repositories, including this one.

  • sbt/io hosts sbt.io module.
  • sbt/util hosts a collection of internally used modules.
  • sbt/librarymanagement hosts sbt.librarymanagement module that wraps Ivy.
  • sbt/zinc hosts Zinc, an incremental compiler for Scala.
  • sbt/sbt, this repository hosts modules that implements the build tool.

Other links

  • Setup: Describes getting started with the latest binary release.
  • FAQ: Explains how to get help and more.
  • sbt/sbt-zero-seven: hosts sbt 0.7.7 and earlier versions

Issues and Pull Requests

Please read CONTRIBUTING carefully before opening a GitHub Issue.

The short version: try searching or asking on StackOverflow.

license

See LICENSE.

sbt open issues Ask a question     (View All Issues)
  • almost 2 years Feature Request: test:clean
  • almost 2 years sbt run fails in this trivial example
  • almost 2 years Camel Context keeps hanging and executing after "run" ends
  • almost 2 years [0.13.13] test class autocompletion broken
  • almost 2 years Can't Publish Ivy & Maven Metadata Simultaneously
  • almost 2 years Change cross-version source directory support to use CrossVersion.binary instead of CrossVersion.partialVersion
  • almost 2 years [sbt 0.13.13] incorrect deprecated message
  • almost 2 years Cannot access an artifactory repo protected by HTTP basic authentication on Windows
  • almost 2 years sbt 0.13.13.tgz has a different directory layout than 0.13.12.tgz
  • almost 2 years Docs inconsistent about where to put sonatype.sbt
  • almost 2 years updateSbtClassifiers fails when scalaOrganization is set to org.typelevel
  • almost 2 years Errors running sbtRoot/compile:doc
  • almost 2 years sbt-datatype: more natural JSON encoding of ADTs
  • almost 2 years Concurrent processing of run
  • almost 2 years Concurrent processing of settings
  • almost 2 years Job list
  • almost 2 years Background run (bgrun)
  • almost 2 years Abstract "console" task over JSON
  • almost 2 years Abstract "run" task over JSON
  • almost 2 years JSON encoding for useful tasks and settings
  • almost 2 years Abstract compile output over JSON
  • almost 2 years Abstract logging output over JSON
  • almost 2 years Split terminal output per-channel
  • almost 2 years Channel cursor
  • almost 2 years Minimal sbt thin client
  • almost 2 years GraphQL-like frontend for sbt-datatype
  • almost 2 years Conflict with internal SBT dependencies
  • almost 2 years Require scalaVersion
  • almost 2 years ivy-home in sbt.conf not respected by sbt-launcher
  • almost 2 years Scala 2.10 build failure when using sbt 0.13.12 or higher
sbt open pull requests (View All Pulls)
  • Fixes #2464. Actually reorganize appResolvers
  • Don't drop JCenter when useJCenter is false
  • FPORT: Avoid CCE when scalac internally uses compileLate
  • FPORT: Add a pending test for a modified member of a trait
  • Use scripted engine from sbt/util
  • FPORT: Inter-project dependency tracking
  • Update version to 0.13.11-SNAPSHOT
  • Upgrade to latest sbt/librarymanagement
  • FPORT: Consider signatures of methods before and after erasure in ExtractAPI
  • FPORT: Refix snapshots
  • FPORT: Maven compatibility changes (intransitive warnings and "configuration not public")
  • FPORT: Make sbt aware of Dotty
  • FPORT: Assorted incremental compiler bug fixes
  • Enable mavenResolverPlugin scripted w/ new sbt/librarymanagement
  • FPORT: Make JCenter opt in
  • (Do not merge) Fixes sbt/sbt#2264. Use explicit artifacts if any, fallback to hardcoded
  • Improve time measuring capabilities (1.0.X)
  • Implement `projects` for .sbt files
  • Publish compiler interface to an alternate local repository for Scripted tests
  • Keep roots when cleaning
  • Add POM props missing from ScmInfo/Developer
  • Add Ivy `branch` support to ModuleID
  • Allow test framework to provide test names
  • Invalidate macro providers whose transitive dependencies have been recompiled
  • Add support for external apidoc URLs for both Scala and Java projects.
  • Add javaScalaCompiler task
  • Macrotracker support
  • Registering dependencies on auxiliary (non-scala) files
  • Events reported by forked tests should be sequence of (String, SuiteResult)
  • Add Append & Remove instances for Option
  • Fix instability of self variable API representation
  • Make moduleConfigurations a TaskKey
  • Fix sbt/sbt#2431
  • Fix a few typos
  • FPORT: Inter-project dependency tracking
  • Native script support
  • Improve performance for DefaultParsers.validID(String)
  • Fix for https://github.com/sbt/sbt/issues/2254
  • [sbt 1.0] Reduce sbt.Project(...) params and make settings(...) lazy
  • Static launcher, get bridge sources from resources
  • BPORT: Include used types in the set of used names
  • (WIP) Attempt at fixing sbt/sbt#2435
  • [sbt 1.0] Refactoring
  • FPORT: Avoid CCE when scalac internally uses compileLate. Fixes #2452
  • FPORT: Completion for build-level keys
  • Support repositories override in static launcher
  • Change ivy home when running scripted tests
  • Simplify EvaluateSettings and INode
  • Rework DefinesClass lookup.
  • Override scala organization and version transitively at the Ivy level
  • Add new SBT global setting asciiGraphWidth
  • Fix typo: paralleism -> parallelism
  • FPORT: Fix for sbt/sbt#2435
  • Workaround for inclusion of ScalaCheck classes in scala-partest-extras.jar
  • Make publishTo & otherResolvers TaskKey's
  • Fixes #2686 by resetting scalaVersion for updateSbtClassifiers
  • Fix for #2686
  • Tests for scalaOrganization + patches (do not merge yet)
  • Adds templateResolvers and `new` command
  • [sbt 0.13] Configure scripted to do less
  • Configurable explicit list of artifacts for Scala binary version check
  • Allow single-letter aliases
  • Workaround #1696 & bump to JDK 1.8
  • Fix #2766 sourceFile null causes NPE
  • Deprecate tuple enrichments. Fixes #2763
  • [sbt 1.0] server reboot
  • Add new param to javadoc.run due to interface change
  • Remove ProcessExtra and the use of java.lang.ProcessBuilder
  • Add build-level keys to the tab completion
  • JUnitXmlTestsListener now correctly flags ignored, skipped and pending tests
  • Back out build-level key completion
  • Add props to define source dependencies on io/util/lm/zinc
  • Error message and Syntax
  • [fport] Fix #2677: Tags.ForkedTestGroup doesn't work
  • [fport] Loading performance
  • Use Scala 2.12.1
  • Fixes Issue #3154 - "It is not a test" in JUnit XML reports.
  • Add parallel batch mode to scripted tests
  • Clean up `update` in `Defaults`
  • Change "Updating" logging from info to debug
  • WIP: Improve sbt evaluation
  • [fport] ScalaTest nested suites reported in JUnit XML reports as "(It is not a test)"
  • Remove implicit formats from Defaults
  • Misc tweaks and cleanups
  • Add warning for slow hostname lookups on OS X
  • cleanKeepFiles is ignored if cleanFiles is overriden
  • Fix compile clean
  • fix sbt help new does not explain how to use sbt new
  • Monkeys
  • [WIP] Add Scala Outline view to vscode
  • Added name property to Command trait
  • Call the soon-to-exist Global#close when done compiling
  • Fix sbt/sbt#3143: Add test to confirm leak is gone
  • add visualize task to sbt
  • Implement sequential[B](tasks: Seq[Initialize[Task[B]]]) and remove useless coment outs
  • [WIP] Fix #3183: Add `inspect build` to detect unused
  • Merge branch 1.1.x into 1.x
  • Handle very long socket file paths on UNIX
  • Upgrade to sbt-buildinfo 0.8.0
  • add scalacOptions for scaladoc
  • Add the eviction warnings options to global
  • optimize scope delegation
  • add tests around scope delegation
  • Add an optional exitCode to ExecStatusEvent so clients can use it
  • Cleanup some parts of the LSP impl
  • WIP: Support non-echoing console for emacs
  • Optimize settings storage and delegation
  • make sbt server extensible
  • fix getDecoder
sbt questions on Stackoverflow (View All Questions)
  • Scala: change folder inside sbt
  • SBT asking for a command
  • Error trying to run SBT
  • Current procedure to change default port in Scalatra's scalatra-sbt giter8 template?
  • sbt cannot switch to project imported from github using ProjectRef
  • Cannot build SBT project with IntelliJ IDEA
  • sbt-assembly include test classes
  • Using SBT to drive a build Java+Scala build that includes SWIG and C++ compilation
  • Create standalone jar using SBT
  • Deploying sbt project in tomcat
  • How to check if application is being run via SBT?
  • SBT 0.13.8 multi module project with Playframework 2.4.2
  • scala compile in spark/sbt ERROR Access Denied in MS DOS
  • Tests fail when run with SBT on the command line but not when run in the IDE
  • SBT: Slow resolution and failures when doing builds within Docker containers
  • How to integrate sbt to existing scala eclipse project with TestSuit test Class?
  • Spark/sbt: Access denied, in windows 10 cmd
  • How generate play application with default SBT layout
  • How to set heap size for sbt?
  • sbt dist task fails with maximum delay error
  • How to trigger source generation with sbt
  • sbt docker:stage returns java.util.regex.PatternSyntaxException error
  • Building spark-jobserver Using SBT and Scala
  • Installing sbt-eclipse - unresolved dependency: com.typesafe.sbt
  • Is SBT incremental compilation reliable for java and scala?
  • No Java installation was detected while sbt update
  • IntelliJ with SBT plugin: Error Resolving [com.mycompany.mypackage]
  • sbt-proguard issue with Java 1.8
  • How to Compile Apache Spark with Scala 2.11.1 using SBT?
  • How can I publish obfuscated with ProGuard jar using sbt?
sbt list of languages used
sbt latest release notes
v1.1.1 1.1.1

Fixes

  • Fixes Modified names for (class) is empty error. zinc#292 / zinc#484 by @jvican
  • Fixes tab completion in console while running in batch mode as sbt console. #3841/#3876 by @eed3si9n
  • Fixes file timestamp retrieval of missing files on Windows. #3871 / io#120 by @cunei
  • Aligns the errors thrown by file timestamp implementations. Fixes #3894 / io#121 by @j-keck
  • Adds file timestamps native support for FreeBSD. #3894 / io#124 by @cunei
  • Fixes JDK 10 version string parsing. https://github.com/sbt/sbt-launcher-package/pull/209 by @2m

Improvements

  • Deprecates Extracted#append in favour of appendWithSession or appendWithoutSession. #3865 by @dwijnand
  • Adds a new global Boolean setting called autoStartServer. See below.
  • Upgrades Scala versions used for sbt cross building ^^. #3923 by @dwijnand
  • Many documentation maintenance changes by @xuwei-k

autoStartServer setting

sbt 1.1.1 adds a new global Boolean setting called autoStartServer, which is set to true by default. When set to true, sbt shell will automatically start sbt server. Otherwise, it will not start the server until startSever command is issued. This could be used to opt out of server for security reasons.

#3922 by @swaldman

v0.13.17 0.13.17

Improvements

  • Updates Scala version to 2.10.7 for Java 9 support. #3848 by @eed3si9n

Bug fixes

Internal

v1.1.0 1.1.0

Lightbend Tooling team is happy to announce sbt 1.1.0. This is the first feature release of sbt 1, a binary compatible release focusing on new features.

sbt 1 is released under Semantic Versioning, and the plugins are expected to work for sbt 1.x series.

The headline features of sbt 1.1 are unified slash syntax and sbt server. They are both features that I have been involved in for a while, but ultimately had to postpone for sbt 1.0. This makes it all the more exciting to see these finally come out.

Unified slash syntax of setting keys

As a user of sbt, I've long thought having different notations for setting/task keys, one for sbt shell and another for build.sbt made the tool harder to learn. After lots of discussions with the community, and a few prototypes, sbt 1.1.0 will support unified slash syntax (the sbt 0.13 notations will continue to work, so don't worry).

Both in build.sbt and in sbt shell, the settings can be written like this, scope axis delimited by slashes:

ref / Config / intask / key

In the above, ref typically is subproject name or ThisBuild, and Config is the Scala identifier for configurations such as Compile and Test. Each axis might be omitted and can also be substituted with a special Zero value, so it's actually:

((ref | "Zero") "/") ((Config | "Zero") "/") ((intask | "Zero") "/") key

For example, in sbt 0.13:

  • to compile just the Test configuration, in sbt 0.13 you'd write (compile in Test).value in build.sbt and test:compile in the sbt shell.
  • cancelable setting at the Global level is written as (cancelable in Global).value in build.sbt and */*:cancelable in the sbt shell.

In sbt 1.1.0:

  • compile task scoped to Test is written as (Test / compile).value in build.sbt, and Test / compile in the sbt shell.
  • cancelable setting scoped to Global is written as (Global / cancelable).value in build.sbt and Global / cancelable in the sbt shell.

For more details, see Migrating to slash syntax and Scopes docs.

Note: One caveat to the plugin authors is that if you use the new syntax in your plugin it will push the minimum required sbt version to 1.1.0-RC for your users.

#1812/#3434/#3617/#3620 by @eed3si9n and @dwijnand

sbt server

When people hear the name sbt server, they might imagine it to be something that runs on remote servers, and does great things. But, sbt server is not that for now. Instead, sbt server adds network access to the sbt shell. The primary use case we have in mind is local coordination between IDEs and sbt. sbt 1.1 reworked this feature to use Language Server Protocol 3.0 (LSP) as the wire protocol, a protocol created by Microsoft originally for Visual Studio Code.

Not just Visual Studio Code, but there are LSP clients available for most modern editors and IDEs such as IntelliJ, Eclipse, Sublime Text 3, NeoVim, Emacs, and Atom. On the provider side, there are language servers available for Go, Python, Haskell etc. Because sbt is able to compile, test, package, and deploy your code, these various tasks can potentially be integrated with the frontend.

To discover a running server, sbt 1.1 creates a port file at ./project/target/active.json relative to a build:

{"uri":"local:///Users/foo/.sbt/1.0/server/0845deda85cb41abcdef/sock"}

local: indicates a UNIX domain socket. Here's how we can say hello to the server using nc. (^M can be sent Ctrl-V then Return):

$ nc -U /Users/foo/.sbt/1.0/server/0845deda85cb41abcdef/sock
Content-Length: 99^M
^M
{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "initializationOptions": { } } }^M

Here's how we can call compile:

Content-Length: 93^M
^M
{ "jsonrpc": "2.0", "id": 2, "method": "sbt/exec", "params": { "commandLine": "compile" } }^M

The running sbt session should now queue compile, and return back with compiler warnings and errors, if any:

Content-Length: 296
Content-Type: application/vscode-jsonrpc; charset=utf-8

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:/Users/foo/work/hellotest/Hello.scala","diagnostics":[{"range":{"start":{"line":2,"character":26},"end":{"line":2,"character":27}},"severity":1,"source":"sbt","message":"object X is not a member of package foo"}]}}

This allows multiple clients to connect to a single session of sbt. For more details, see sbt server docs.

#3524/#3556 by @eed3si9n

VS Code extension

As a proof of concept for editor integration, we created a Visual Studio Code extension called Scala (sbt). To try it out, install Visual Studio Code, search for Scala (sbt) in Extensions tab, run sbt 1.1.0 on some project, and open it using VS Code.

Currently this extension is able to:

  • Run compile at the root project when *.scala files are saved. #3524 by Eugene Yokota (@eed3si9n)
  • Display compiler errors.
  • Display log messages. #3740 by Alexey Alekhin (@laughedelic)
  • Jump to class definitions. #3660 by Wiesaw Popielarski at VirtusLab (@wpopielarski)

Sublime Text 3 integration

Using LSP plugin, Sublime Text 3 can also be setup with the same feature. See sbt server with Sublime Text 3:

Also Neovim too. I think you get the idea here.

Other bug fixes and improvements

  • Fixes ClasspathFilter that was causing Class.forName to not work in run. zinc#473 / #3736 / #3733 / #3647 / #3608 by @ravwojdyla
  • Fixes Java compilation causing NullPointerException by making PositionImpl thread-safe. zinc#465 by @eed3si9n
  • Fixes PollingWatchService by preventing concurrent modification of keysWithEvents map. io#90 by @mechkg, which fixes ~ related issues #3687, #3695, and #3775.
  • Provides workaround for File#lastModified() losing millisecond-precision by using native code when possible. io#92/io#106 by @cunei
  • Fixes IO.relativize not working with relative path. io#108 by @dwijnand
  • Fixes warning message when multiple instances are detected. #3828 by @eed3si9n
  • Changes version setting default to 0.1.0-SNAPSHOT for compatibility with Semantic Versioning. #3577 by @laughedelic
  • Fixes over-compilation bug with Java 9. zinc#450 by @retronym
  • Fixes handling of deeply nested Java classes. zinc#423 by @romanowski
  • Fixes JavaDoc not printing all errors. zinc#415 by @raboof
  • Preserves JAR order in ScalaInstance.otherJars. zinc#411 by @dwijnand
  • Fixes used name when it contains NL. zinc#449 by @jilen
  • Fixes handling of ThisProject. #3609 by @dwijnand
  • Escapes imports from sbt files, so if user creates a backquoted definition then task evalution will not fail. #3635 by @panaeon
  • Removes reference to version 0.14.0 from a warning message. #3693 by @saniyatech
  • Fixes screpl throwing Not a valid key: console-quick. #3762 by @xuwei-k
  • Filters scripted tests based on optional project/build.properties. #3564/#3566 by @jonas
  • Adds Project#withId to change a project's id. #3601 by @dwijnand
  • Adds reboot dev command, which deletes the current artifact from the boot directory. This is useful when working with development versions of sbt. #3659 by @eed3si9n
  • Adds a check for a change in sbt version before reload. #1055/#3673 by @RomanIakovlev
  • Adds a new setting insideCI, which indicates that sbt is likely running in an Continuous Integration environment. #3672 by @RomanIakovlev
  • Adds nameOption to Command trait. #3671 by @miklos-martin
  • Adds POSIX persmission operations in IO, such as IO.chmod(..). io#76 by @eed3si9n
  • Treat sbt 1 modules using Semantic Versioning in the eviction warning. lm#188 by @eed3si9n
  • Uses kind-projector in the code. #3650 by @dwijnand
  • Make displayOnly etc methods strict in Completions. #3763 by @xuwei-k
  • Restores Scala 2.13.0-M1 support. sbt/zinc#461 by @dwijnand

Participation

Thanks again to everyone who's helped improve sbt and Zinc 1 by using them, reporting bugs, improving our documentation, porting builds, porting plugins, and submitting and reviewing pull requests.

sbt 1.1.0 was brought to you by 33 contributors, according to git shortlog -sn --no-merges v1.0.4..v1.1.0 on sbt, zinc, librarymanagement, util, io, and website: Eugene Yokota, Dale Wijnand, Antonio Cunei, Kenji Yoshida (xuwei-k), Alexey Alekhin, Simon Schfer, Jorge Vicente Cantero (jvican), Miklos Martin, Jeffrey Olchovy, Jonas Fonseca, Andrey Artemov, Arnout Engelen, Dominik Winter, Krzysztof Romanowski, Roman Iakovlev, Wiesaw Popielarski, Age Mooij, Allan Timothy Leong, Ivan Poliakov, Jason Zaugg, Jilen Zhang, Long Jinwei, Martin Duhem, Michael Stringer, Michael Wizner, Nud Teeraworamongkol, OlegYch, PanAeon, Philippus Baalman, Pierre Dal-Pra, Rafal Wojdyla, Saniya Tech, Tom Walford, and many others who contributed ideas. Thank you!

Other projects in Scala