You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/detectors/sbt.md
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,24 @@
4
4
5
5
SBT detection depends on the following to successfully run:
6
6
7
-
- SBT CLI as part of your PATH. `sbt` should be runnable from a given command line.
8
-
- sbt-dependency-graph plugin (recommended to be added globally or in the project's `project/plugins.sbt`).
9
-
- One or more `build.sbt` files.
7
+
- SBT CLI available via system PATH or Coursier distribution
8
+
- On Windows, detector checks: `sbt` command, then `C:\Users\{user}\AppData\Local\Coursier\data\bin\sbt.bat`
9
+
- On other platforms, checks system PATH for `sbt` command
10
+
- One or more `build.sbt` files
11
+
12
+
**Note**: The `sbt-dependency-graph` plugin is no longer required. The detector uses SBT's built-in `dependencyTree` task.
10
13
11
14
## Detection strategy
12
15
13
-
SBT detection is performed by running `sbt "dependencyTree; export compile:dependencyTree > bcde.sbtdeps"` for each build.sbt file and parsing the results. The detector leverages the same Maven-style dependency graph parser used by the Maven detector, as SBT dependencies use Maven coordinates (groupId:artifactId:version).
16
+
SBT detection is performed by running `sbt dependencyTree` for each `build.sbt` file and parsing the tree output. The detector applies a multi-stage filtering process to clean the output:
2. Removes Scala version suffixes from artifact names (e.g., `_2.13`)
20
+
3. Removes root component markers (`[S]` suffix)
21
+
4. Validates Maven coordinates (requires at least one dot in groupId per Maven convention)
22
+
5. Inserts default `jar` packaging to match Maven coordinate format: `group:artifact:jar:version`
23
+
24
+
The detector leverages the same Maven-style dependency graph parser used by the Maven detector, as SBT dependencies use Maven coordinates (groupId:artifactId:version) and output in a compatible tree format.
14
25
15
26
Components are registered as Maven components since Scala projects publish to Maven repositories and use the same artifact coordinate system.
16
27
@@ -20,13 +31,10 @@ Full dependency graph generation is supported.
20
31
21
32
## Known limitations
22
33
23
-
- SBT detection will not run if `sbt` is unavailable in the PATH.
24
-
- The sbt-dependency-graph plugin must be available. For best results, install it globally in `~/.sbt/1.0/plugins/plugins.sbt`:
- Only the `compile` configuration is scanned by default. Test dependencies may be detected as development dependencies if they appear in the dependency tree output.
29
-
- Multi-project builds (nested `build.sbt` files) are detected, with parent projects taking precedence.
34
+
- SBT detection will not run if `sbt` CLI is not available in the system PATH or Coursier distribution
35
+
- Only the compile-scope dependencies are scanned by default (test dependencies may be detected as development dependencies if they appear in the dependency tree output)
36
+
- Multi-project builds (nested `build.sbt` files) are detected, with parent projects taking precedence
37
+
- First invocation of SBT may be slow due to JVM startup and dependency resolution; subsequent runs benefit from cached dependencies
0 commit comments