sbt, the interactive build tool
Go to file
calm ebc11f04a7
[2.x] fix: Fix updateSbtClassifiers using wrong Scala version for cross-built plugins (#8495)
**Problem**

When cross-building sbt plugins with explicit `scalaVersion` set in `build.sbt`, the `updateSbtClassifiers` task fails because it uses the launcher's Scala version instead of the appropriate Scala version for the target sbt version.

For example, with this configuration:
```scala
lazy val root = (project in file("."))
  .enablePlugins(SbtPlugin)
  .settings(
    scalaVersion := "2.10.7",  // Explicit for IDE support
    crossSbtVersions := Seq("0.13.17", "1.0.0"),
  )
```

Running sbt "show updateSbtClassifiers" would fail with:
Error downloading org.scala-sbt:scripted-plugin_2.12:0.13.17

It should look for scripted-plugin_2.10:0.13.17 since sbt 0.13.x uses Scala 2.10.

**Solution**

Modified sbtClassifiersTasks in Defaults.scala to:
1. Check if the project is an sbt plugin (sbtPlugin.value)
2. For plugins, derive the Scala version from pluginCrossBuild / sbtBinaryVersion using PluginCross.scalaVersionFromSbtBinaryVersion
3. For non-plugins, continue using the launcher's Scala version (original behavior)
2026-01-12 16:19:24 -05:00
.github [2.x] ci: Integrate launcher package (#8485) 2026-01-11 20:57:59 -05:00
buildfile/src [2.x] fix: Fix snapshot sbt version invalidation 7713 (#8486) 2026-01-11 21:01:05 -05:00
client Bye jansi 2024-11-07 22:07:07 -08:00
contributing-docs Fix typo in link to CONTRIBUTING.md 2026-01-11 03:57:14 -05:00
core-macros/src Add tailrec annotation 2026-01-11 16:33:45 +09:00
internal Use SAM-conversion if possible (#8477) 2026-01-11 07:21:28 -05:00
launch Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
launcher-package [2.x] ci: Integrate launcher package (#8485) 2026-01-11 20:57:59 -05:00
licenses move remaining pieces of sbt subproject to sbt_pending and fix notices 2010-09-21 21:55:50 -04:00
lm-core [2.x] fix: Invalidate update cache across commands when dependencies change (#8501) 2026-01-12 16:17:51 -05:00
lm-coursier [2.x] fix: Invalidate update cache across commands when dependencies change (#8501) 2026-01-12 16:17:51 -05:00
lm-ivy/src [2.x] fix: Invalidate update cache across commands when dependencies change (#8501) 2026-01-12 16:17:51 -05:00
main [2.x] fix: Fix updateSbtClassifiers using wrong Scala version for cross-built plugins (#8495) 2026-01-12 16:19:24 -05:00
main-actions/src [2.x] Add testForkedParallelism setting for forked test thread count (#8453) 2026-01-09 12:43:50 -05:00
main-command/src feat: Set terminal window title when running applications (#8492) 2026-01-12 02:32:52 -05:00
main-settings/src [2.x] Fix ProjectMatrix invalid project ID with CrossVersion.full (#8484) 2026-01-11 19:17:26 -05:00
notes Spelling (#8028) 2025-02-04 01:11:28 -05:00
project refactor: Add parentheses to PathFinder.get (#8497) 2026-01-12 15:19:40 -05:00
protocol/src/main feat: Set terminal window title when running applications (#8492) 2026-01-12 02:32:52 -05:00
run Merge branch '1.12.x' into wip/merge-1.12.x 2025-11-24 02:14:17 -05:00
sbt-app/src [2.x] fix: Fix updateSbtClassifiers using wrong Scala version for cross-built plugins (#8495) 2026-01-12 16:19:24 -05:00
sbt-remote-cache/src/main/scala/sbt remove unnecessary `case` 2025-02-22 08:48:29 +09:00
scripted-sbt Fix #3746: Scripted should fail when no tests match the pattern 2026-01-09 13:57:58 -06:00
scripts Fix lm-coursier scripted 2024-10-11 14:30:55 +02:00
server-test/src Fix BuildServerTest (#8475) 2026-01-11 07:20:10 -05:00
src/main/conscript sbt 1.3.0 2019-09-04 01:24:08 -04:00
tasks Fix scaladoc (#8476) 2026-01-11 07:20:40 -05:00
tasks-standard Use SAM-conversion if possible (#8477) 2026-01-11 07:21:28 -05:00
testing Apply Contraband 2025-09-28 21:28:21 -04:00
util-cache [2.x] feat: Cache failed compilation to avoid repeated failures (#8490) 2026-01-12 16:03:05 -05:00
util-collection Fix scaladoc (#8476) 2026-01-11 07:20:40 -05:00
util-tracking Remove deprecated methods 2025-05-11 05:23:41 -04:00
worker/src [2.x] Add testForkedParallelism setting for forked test thread count (#8453) 2026-01-09 12:43:50 -05:00
zinc-lm-integration/src Merge branch '1.12.x' into wip/merge-1.12.x 2026-01-05 00:08:21 -05:00
.git-blame-ignore-revs Add .git-blame-ignore-revs 2024-10-09 13:38:02 +02:00
.gitattributes Fix line endings in msi 2021-11-19 20:41:39 -05:00
.gitignore Merge branch '1.11.x' into wip/merge-1.11.x 2025-08-25 02:29:12 -04:00
.gitmodules Move metadata to lm-coursier/metadata 2024-10-09 09:44:42 +02:00
.jvmopts Add .jvmopts 2023-11-25 01:06:30 -05:00
.mailmap Add mailmap 2019-06-11 09:30:14 +02:00
.sbtopts Restore .sbtopts file 2020-11-19 12:42:26 -08:00
.scala-steward.conf Pin slf4j-api 2023-01-02 22:06:46 -05:00
.scalafmt.conf update scalafmt config. re-format build files 2025-09-23 10:28:38 +09:00
AGENTS.md [2.x] docs: Minor tweaks to the docs (#8480) 2026-01-11 15:08:20 -05:00
CONTRIBUTING.md [2.x] docs: Minor tweaks to the docs (#8480) 2026-01-11 15:08:20 -05:00
LICENSE add LICENSE file 2023-06-25 09:53:06 +09:00
NOTICE Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
PROFILING.md docs: Update flamegraph guide --lines 2025-11-09 18:06:13 -05:00
README.md docs: Contributor's Guide 2026-01-11 03:24:30 -05:00
SUPPORT.md Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
build.sbt feat: Set terminal window title when running applications (#8492) 2026-01-12 02:32:52 -05:00
reset.sh 1.0.3-SNAPSHOT 2017-09-16 15:52:58 -04:00
sbt Fix --sbt-version to expand to -Dsbt.version 2026-01-08 20:51:27 +01:00
sbt-allsources.sh Merge remote-tracking branch 'lm/wip/sbt-2.x' into 2.x-lm-coursier 2024-10-09 08:50:03 +02:00
sbt.sh Implement sbt-launch.jar download 2021-04-19 23:43:15 -04:00
server.md setting query is "sbt/setting" 2017-10-03 01:45:06 -04:00

README.md

CI Latest version Discord

sbt

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

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

sbt 2.x

This is the 2.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/zinc hosts Zinc, an incremental compiler for Scala.
  • sbt/sbt, this repository hosts modules that implement the build tool.
  • 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, and Contributor's guide before opening a pull request.

If you're looking for an idea for a contribution, issues labeled with good first issue or help wanted might be good starting points.

If you would like to ask questions about sbt, there's sbt channel on Scala Discord, but it would be good to gather questions on Stackoverflow.

license

See LICENSE.