Skip to main content

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.

The CorePlugin is automatically enabled on all sbt projects and provides fundamental settings required for the sbt build engine to function. It controls task-level parallelism, logging, project structure, and other essential build operations.

Activation

Overview

CorePlugin provides the foundational settings layer that all sbt builds depend on. Without this plugin, the sbt build engine cannot operate. It includes both global settings (applied once per build) and project-level settings (applied to each project).

Global Settings

The plugin provides extensive global configuration through globalSbtCore:

Build Structure

SettingTypeDefaultDescription
buildStructureTask[BuildStructure]Derived from stateThe build’s project structure
settingsDataTask[Settings]From buildStructureAll settings in the build
sbtVersionStringFrom app configVersion of sbt running this build
sbtBinaryVersionStringComputedBinary-compatible sbt version

Task Execution

SettingTypeDefaultDescription
parallelExecutionBooleantrueEnable parallel task execution
concurrentRestrictionsSeq[Tags.Rule]Default rulesLimits on concurrent task execution
maxErrorsInt100Maximum compilation errors to display
cancelableBooleantrueWhether tasks can be cancelled
taskCancelStrategyState => TaskCancellationStrategySignal or NullHow to cancel running tasks

Logging & Output

SettingTypeDefaultDescription
logBufferedBooleanfalseBuffer logging until task completion
showSuccessBooleantrueShow success messages
showTimingBooleantrueDisplay task timing information
extraAppendersAppenderSupplierEmptyAdditional log appenders
outputStrategyOption[OutputStrategy]NoneStrategy for subprocess output

Environment & System

SettingTypeDefaultDescription
envVarsMap[String, String]Empty mapEnvironment variables for forked processes
forkBooleanfalseRun tasks in a forked JVM
connectInputBooleanfalseConnect standard input to forked processes
trapExitBooleantrueTrap System.exit calls

Performance

SettingTypeDefaultDescription
turboBooleanFrom system propertyEnable turbo mode optimizations
usePipeliningBooleanFrom system propertyEnable compilation pipelining
exportPipeliningBooleanusePipelining valueExport pipelining artifacts
forcegcBooleanPlatform-dependentForce garbage collection between tasks
minForcegcIntervalFiniteDurationDefault intervalMinimum time between forced GCs
fileCacheSizeString"128M"Size of file metadata cache

SuperShell

SettingTypeDefaultDescription
useSuperShellBooleanAuto-detectedEnable SuperShell UI
superShellThresholdIntFrom system propertyThreshold for SuperShell activation
superShellMaxTasksIntFrom system propertyMaximum tasks shown in SuperShell
superShellSleepFiniteDurationFrom system propertySuperShell refresh rate

File Watching

SettingTypeDefaultDescription
watchSourcesSeq[Source]NilSources to watch for changes (deprecated)
fileTreeViewFileTreeViewDefaultFile tree implementation for watching

Server

SettingTypeDefaultDescription
autoStartServerBooleantrueAutomatically start sbt server
serverHostString"127.0.0.1"Server host address
serverPortIntAuto-generatedServer port (5000 + hash)
serverIdleTimeoutOption[FiniteDuration]Some(7 days)Server idle timeout
serverConnectionTypeConnectionTypeLocalType of server connection
serverAuthenticationSet[ServerAuthentication]Context-dependentServer authentication methods
serverHandlersSeq[ServerHandler]NilCustom server request handlers

Build Management

SettingTypeDefaultDescription
checkBuildSourcesTask[Boolean]Auto-implementedCheck if build sources changed
onLoadState => StateIdentityFunction run when project loads
onUnloadState => StateCleanup tasksFunction run when project unloads
commandsSeq[Command]NilCustom commands available in build
aggregateBooleantrueAggregate tasks across projects

Templates

SettingTypeDefaultDescription
templateResolverInfosSeq[TemplateResolverInfo]NilTemplate resolver configurations
templateDescriptionsSeq[TemplateDescription]Default templatesAvailable project templates
templateRunLocalInputTask[Unit]Default implementationRun a local template

Progress Reporting

SettingTypeDefaultDescription
progressReportsSeq[TaskProgress]Timing & trace eventsProgress reporting implementations
commandProgressSeq[CommandProgress]NilCommand-level progress reporters

Temporary Files

SettingTypeDefaultDescription
taskTemporaryDirectoryFileAuto-createdDirectory for task temporary files
onComplete() => UnitCleanup functionCleanup after build completion

Project Settings

The plugin provides essential project-level settings through coreDefaultSettings:

Project Structure

ClassLoader Configuration

Publishing Skip Control

Logging

Tasks

The CorePlugin provides fundamental tasks through projectTasks:

Clean

Usage Examples

Disable Parallel Execution

Global / parallelExecution := false

Increase Max Errors

Global / maxErrors := 200

Configure Server Port

Global / serverPort := 6000

Disable SuperShell

Global / useSuperShell := false

Add Custom On-Load Hook

Global / onLoad := (Global / onLoad).value.andThen { state =>
  println("Build loaded!")
  state
}

Keep Specific Files During Clean

cleanKeepFiles += baseDirectory.value / "data" / "cache.db"
The CorePlugin is fundamental to sbt’s operation. Its settings control the build engine itself, so modifying them should be done carefully. Most settings have sensible defaults that work for typical builds.
  • IvyPlugin - Builds on CorePlugin to add dependency management
  • JvmPlugin - Adds JVM-specific compilation and execution capabilities

Source

CorePlugin implementation: sbt.plugins.CorePlugin