English | 中文
Support available since IntelliJ IDEA 2023.1 (231.9392.1)
- View Dependency Tree
- Show Conflicts
- Search Dependencies
- Locate Dependency (multi-module)
- Show Dependencies Between Modules
- Show JAR Size
This plugin will automatically generate project/sdap.sbt
when the first analysis fails and insert the addDependencyTreePlugin
(or addSbtPlugin(...)
) statement into it. If generated, please do not modify or delete project/sdap.sbt
.
This plugin relies on sbt-dependency-tree
, a third-party plugin, which is now integrated into sbt by default (although it won't be enabled by default, as explained in this sbt issue).
Let's explore how to use it!
Simply click on the icon and wait for the analysis to complete:
Default shortcut: Ctrl + Shift + L
Once the analysis is finished:
The plugin utilizes the following sbt tasks. However, rest assured that the plugin has been optimized to minimize redundant executions:
organization
moduleName
dependencyDot
reload
update
If you are uncertain, you can safely skip these configurations!
By utilizing configurations, analysis wait times can be significantly reduced:
File Cache Timeout
If a file remains unchanged for more than 3600 seconds, the plugin will execute the dependencyDot
task. Otherwise, it will use the existing one, unless you opt for a Refresh
.
Organization
If you specify this value, the organization
task will not be used to retrieve your project's organization.
Disable Scopes
If you do not need to analyze all scopes, simply disable the scope(s) you wish to skip.
Configurations are persistent and associated with each IntelliJ project.
Like other plugins, this one maintains its own storage in .idea/bitlap.sbt.dependency.analyzer.xml
. Deleting this file will clear the cache.
Due to the plugin's requirement to use sbt shell, opening the dependency analysis view and subsequently using IntelliJ IDEA to reload or build the project may lead to the following issue:
Caused by: java.io.IOException: Could not create lock for \\.\pipe\sbt-load5964714308503584069_lock, error 5
To avoid this problem, utilize sbt shell for reloading or building the project:
Ensure that you have applied one of the following settings to help identify the correct module:
- The
organization
in Advanced Setup has been configured. - The
organization
value has been set inbuild.sbt
viaThisBuild
orinThisBuild
.