Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sbt/sbt/llms.txt
Use this file to discover all available pages before exploring further.
Keys API
TheKeys object (defined in sbt.Keys) provides all the core settings and task keys used throughout sbt. These keys are the fundamental building blocks for configuring your build.
Project Identity Keys
name
The name of the project. This is used for dependency management, artifact naming, and display purposes.
Keys.scala:402
organization
The organization or group identifier, typically in reverse domain notation (e.g., “com.example”).
Keys.scala:408
version
Semantic version string for the project (e.g., “1.0.0”, “0.1.0-SNAPSHOT”).
Keys.scala:599
Scala Configuration Keys
scalaVersion
Scala version for compilation (e.g., “2.13.12”, “3.3.1”).
Keys.scala:228
scalaBinaryVersion
Binary version used for cross-building (e.g., “2.13” for Scala 2.13.x, “3” for Scala 3.x).
Keys.scala:230
crossScalaVersions
List of Scala versions to build against when running
+compile, +publish, etc.Keys.scala:232
scalaOrganization
Default value is
"org.scala-lang". Advanced setting for Scala language clones.Keys.scala:227
Dependency Management Keys
libraryDependencies
List of library dependencies for the project. Use
%, %%, or %%% operators to declare dependencies.Keys.scala:627
resolvers
Custom Maven or Ivy repositories to search for dependencies.
Keys.scala:608
Compilation Keys
compile
Main compilation task that processes Scala and Java sources.
Keys.scala:262
scalacOptions
Command-line flags passed to the Scala compiler (e.g.,
-deprecation, -feature).Keys.scala:209
javacOptions
Command-line flags passed to the Java compiler.
Keys.scala:210
Directory and Path Keys
baseDirectory
Root directory of the project, typically where
build.sbt is located.Keys.scala:147
sourceDirectory
Defaults to
src in the base directory.Keys.scala:154
scalaSource
Defaults to
src/main/scala for Compile configuration, src/test/scala for Test.Keys.scala:156
target
Output directory for compiled classes, packaged JARs, and other generated artifacts.
Keys.scala:150
classDirectory
Defaults to
target/scala-<version>/classes for main sources.Keys.scala:189
Package and Publish Keys
packageBin
Creates the primary packaged artifact for the project.
Keys.scala:314
publish
Uploads artifacts to the resolver specified by
publishTo.Keys.scala:588
publishLocal
Installs artifacts in the local Ivy cache (
~/.ivy2/local).Keys.scala:589
publishTo
Specifies the repository where artifacts will be published.
Keys.scala:639
Test Keys
test
Runs tests incrementally based on changes.
Keys.scala:378
testOnly
Selective test execution by test class name or pattern.
Keys.scala:380
testFrameworks
Test framework implementations (ScalaTest, specs2, JUnit, etc.).
Keys.scala:386
Run Keys
run
Executes the application’s main method.
Keys.scala:337
mainClass
Fully qualified name of the main class to execute.
Keys.scala:336
fork
Controls process isolation for running applications and tests.
Keys.scala:343
Logging Keys
logLevel
Values:
Level.Error, Level.Warn, Level.Info, Level.DebugKeys.scala:56
Clean Keys
clean
Removes all build artifacts and intermediate files.
Keys.scala:258
Additional Keys
description
Human-readable description of the project.
Keys.scala:404
licenses
Open source or proprietary licenses for the project.
Keys.scala:407
homepage
URL to the project website or repository.
Keys.scala:405
Key Operators
Keys support various operators for setting and modifying values::=- Sets a value+=- Appends a single value to a sequence++=- Appends multiple values to a sequence--=- Removes values from a sequence