English | 中文
⭐ Found this plugin useful? Please give it a Star on GitHub to show your support!
The Sbt Dependency Analyzer plugin for IntelliJ IDEA provides powerful visual tools to help you understand, manage, and troubleshoot your Sbt project's dependencies with ease. Gain clear insights into your library dependencies and their relationships, directly within your IDE.
Compatible with IntelliJ IDEA 2023.1 and later (Community Edition, Ultimate, and Android Studio).
- Dependency Tree Visualization: View a hierarchical tree of all your project's dependencies.
- Conflict Identification: Quickly spot and resolve version conflicts between libraries.
- Dependency Search: Easily find specific dependencies across your project.
- Inter-Module Dependency Analysis: Visualize how different modules in your project depend on each other.
- JAR Size Indicators: See the size of dependency JARs to better manage your project's footprint.
- Navigate to Declaration: Click on a user-defined dependency to jump directly to its declaration in
build.sbt
. - Dependency Exclusion (Experimental):
- Select a transitive dependency to exclude it from a user-defined dependency.
- Select a user-defined dependency to remove it entirely.
- Available since plugin version
0.5.0-242.21829.142
.
- Install the Plugin: Go to
Settings/Preferences
>Plugins
>Marketplace
, search for "Sbt Dependency Analyzer", and install it. - Automatic Setup: Upon first analysis, the plugin will automatically generate a
project/sdap.sbt
file if needed. This file adds the requiredaddDependencyTreePlugin
statement. Please do not modify or delete this file once created. - Plugin Dependency: This plugin leverages the
sbt-dependency-tree
functionality, which is bundled with recent sbt versions (though not be enabled by default, sbt issue).
Default Keyboard Shortcut:
Ctrl
+Shift
+L
(Windows/Linux) /Command
+Shift
+L
(MacOS)
Simply open your Sbt project in IntelliJ IDEA and use the shortcut to generate and view the dependency analysis.
The interactive dependency graph provides a clear overview of your project's structure.
Fine-tune the plugin's behavior and potentially speed up analysis via Settings/Preferences
> Tools
> Sbt Dependency Analyzer
:
- File Cache Timeout: Adjust how long (in seconds) the plugin uses cached dependency graph files (
.dot
) before re-running thedependencyDot
command. (Default:3600
). - Organization: Predefine your project's organization value here to avoid the plugin needing to query sbt for it.
- Disable Scopes: Improve analysis speed by disabling dependency scopes (e.g.,
Test
,Provided
) you are not interested in.
These settings are stored per IntelliJ project in .idea/bitlap.sbt.dependency.analyzer.xml
. Deleting this file will reset settings and clear the cache.
This error can occur due to conflicts between the plugin's use of the sbt shell and IntelliJ IDEA's internal project reload/build mechanisms.
- Solution: Use the sbt shell within IntelliJ IDEA for reloading (
sbt reload
) or building (sbt compile
) your project, instead of the IDE's built-in buttons.
The plugin may fail to correctly parse inter-module dependencies if it cannot determine the project organization.
- Solution: Ensure the plugin knows your project's organization by either:
- Setting the Organization value in the plugin's settings.
- Defining the
organization
setting in yourbuild.sbt
globally usingThisBuild / organization
orinThisBuild(...)
.
Note: Submodules not declared within the
dependsOn
clause of the root project will not be parsed.
- The plugin executes several sbt commands (
organization
,moduleName
,dependencyDot
,reload
,update
) to gather dependency information. Significant optimizations are in place to minimize the number and impact of these commands. - The plugin has replicated the Kotlin code from the intellij-community project on the UI and compiles it using the kotlin-plugin.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests on GitHub.
JetBrains Support: This project is developed using JetBrains IntelliJ IDEA. We extend our gratitude to JetBrains for providing a free license, which significantly supports its development.