Dependencies Extension
IntelliJ Platform Gradle Plugin enhances the dependencies {}
configuration block by applying a nested dependencies.intellijPlatform {}
extension.
This class provides methods for adding dependencies to different IntelliJ Platform products and managing local dependencies.
It also includes methods for adding plugins (including bundled), JetBrains Runtime, as well as tools like IntelliJ Plugin Verifier and Marketplace ZIP Signer.
Example:
setup Maven Central and
defaultRepositories()
target IntelliJ IDEA Community 2025.2.1
add dependency on the bundled Java plugin
add IntelliJ Plugin Verifier, Marketplace ZIP Signer CLI, and code instrumentation tools
add JUnit4 test dependency
add Test Framework for testing plugin with JUnit4
Target Platforms
Default Target Platforms
See Custom Target Platforms for non-default targets.
Function | Description |
---|---|
| |
| |
| |
| |
| Fleet Backend |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Notes:
Writerside (
WRS
) is deprecated and no longer available as a target IntelliJ Platform.Aqua (
QA
) has also been removed as a target IntelliJ Platform.
Custom Target Platforms
Function | Description |
---|---|
| Adds a configurable dependency on the IntelliJ Platform. See Parametrize IntelliJ Platform Dependency. |
| Adds a configurable dependency on the IntelliJ Platform. See Parametrize IntelliJ Platform Dependency. |
| Adds a dependency on a local IntelliJ Platform instance. See Local IntelliJ Platform IDE Instance. |
Dependency Configuration Parameters
The last argument passed to the dependency helpers is a configure
closure that allows to configure the dependency. It allows you to specify the following parameters:
Parameter | Type | Description |
---|---|---|
|
| The type of the IntelliJ Platform dependency (target product). |
|
| The version of the IntelliJ Platform dependency. |
|
| Describes a mode in which a product may be started. Default: |
|
| Switches between resolving the IDE installer and a multi-OS archive from the IntelliJ Maven repository. Default: |
|
| Switches between the Gradle cache and a custom cache directory. Default: |
|
| The name of the configuration to add the dependency to. Default: |
All of the above parameters support assignment of direct values and Provider instances.
See also:
Target Versions
The IntelliJ Platform Gradle Plugin allows for using two types of IntelliJ Platform artifacts for development: installers and multi-OS ZIP archives. Both have advantages and drawbacks, but in the 2.x releases, installers are now the default choice when setting up the project.
Installers
When declaring a dependency on IntelliJ Platform, the IDE installer is resolved by default. The IntelliJ Platform installer is the IDE final distribution used by end-users for installing and running IDE in their machines. Those artifacts are resolved from JetBrains Download CDN (download.jetbrains.com) or Android Studio CDN.
The listing of all present installers can be resolved with updates XML files for JetBrains IDEs and Android Studio as well as by executing the printProductsReleases
task.
IntelliJ Platform installers are OS-specific and contain bundled JetBrains Runtime (JBR), but are limited to public releases only.
To apply required repositories, use Default Repositories or explicit IntelliJ Platform Installers helpers.
Multi-OS Archives
It is still possible to use Multi-OS ZIP archives resolved from IntelliJ Maven Repositories.
To enable resolving this kind of artifacts, opt-out from the installer dependencies by adding useInstaller = false
argument to helpers described in Target Platforms, like:
The Multi-OS Archives don't bundle JetBrains Runtime (JBR) needed to run the IDE locally, perform testing, and other crucial operations. Therefore, it is required to explicitly add a dependency on JetBrains Runtime (JBR) by adding extra jetbrainsRuntime()
repository and dependency entries.
It is advised to rely on installer releases, but targeting EAP multi-OS archives helps when making sure your plugin will work in the upcoming IDE releases.
To apply required repositories, use Default Repositories or explicit IntelliJ Maven Repositories helpers.
Plugins
Make sure that required plugin repositories are defined to access non-bundled plugins.
See also:
Bundled Plugin
Use bundledPlugin(id)
or bundledPlugins(ids)
to add a dependency on the bundled plugin within the currently targeted IntelliJ Platform. The list of bundled plugin IDs is available via printBundledPlugins
task.
Function | Description |
---|---|
| Adds a dependency on a bundled plugin. |
| Adds a dependency on multiple bundled plugins. |
Bundled Modules
Use bundledModule(id)
or bundledModules(ids)
to add a dependency on an IntelliJ Platform bundled module. This is useful when a specific platform module is required on the classpath.
Function | Description |
---|---|
| Adds a dependency on a bundled module. |
| Adds a dependency on multiple bundled modules. |
Non-Bundled Plugin
Use plugin(notation)
or plugins(notations)
to add a dependency on a non-bundled plugin (for example, hosted on JetBrains Marketplace).
Parameter notation
uses the following format:
pluginId:version
orpluginId:version@channel
.
Alternatively, use:
plugin(id, version, group)
– wheregroup
may define a release channel, like@eap
, or a full Maven coordinates group (defaults tocom.jetbrains.plugins
).plugins(vararg notations)
/plugins(List<String>)
– for multiple plugins.
The group
parameter can also describe the release channel by prefixing the value with @
character, like @eap
or @nightly
. The channel value is used to prepend the JetBrains Marketplace group and build nightly.com.jetbrains.plugins
.
If defined explicitly, can be used along with any custom plugin repository, like org.acme.plugins
.
Function | Description |
---|---|
| Adds a dependency on a plugin. |
| Adds a dependency on a plugin. |
| Adds a dependency on multiple plugins. |
Compatible Plugins
Helpers that automatically pick a version compatible with the currently configured IntelliJ Platform by requesting the JetBrains Marketplace API.
These resolve plugin versions against the target platform configured via this extension. Make sure the required plugin repositories are defined.
Function | Description |
---|---|
| Adds a dependency on a compatible plugin. |
| Adds a dependency on multiple compatible plugins. |
Multi-Module Setup
When working on a multi-module project, use pluginComposedModule(dependency)
to add a dependency on a plugin module to be bundled within the main plugin JAR. This will produce a single plugin Jar file with all submodules' classes composed:
In order to use the plugin model v2, use the pluginModule(dependency)
instead, which will move the submodule's jar into the lib/modules/
subdirectory.
Local Plugin
Use localPlugin(localPath)
to add a dependency on a local IntelliJ Platform plugin.
Testing
To implement tests for IntelliJ Platform plugin, it is necessary to explicitly add a dependency on the test-framework
library containing the necessary test base classes. In most cases, the TestFrameworkType.Platform
variant will be used:
See TestFrameworkType
reference for other test-frameworks, for example, Plugin.Java
when testing Java-based functionality.
The provided testFramework(type, version)
helper method makes it possible to add the base artifact to the test classpath or its variants, such as Java, Go, ReSharper, etc.
Function | Description |
---|---|
| Adds a dependency on Test Framework or its variant using |
There are two known issues related to Platform
and JUnit5
Test Frameworks:
See also:
Test-scope plugin and module helpers
The extension also provides helpers to add dependencies needed only for tests:
Function | Description |
---|---|
| Adds a test dependency on a non-bundled plugin using |
| Adds test dependencies on multiple non-bundled plugins. |
| Adds a test dependency on a bundled plugin by ID. |
| Adds test dependencies on multiple bundled plugins by IDs. |
| Adds a test dependency on a local plugin; accepts a path or a project dependency. |
| Adds a test dependency on a specific bundled platform module. |
| Adds test dependencies on multiple bundled platform modules. |
Provider and list-based overloads are available for the above helpers, mirroring their production-scope counterparts.
Tools
Function | Description |
---|---|
| Adds a dependency on IntelliJ Plugin Verifier. Applied by default and refers to the latest available tool's version. |
| Adds a dependency on Marketplace ZIP Signer. Applied by default and refers to the latest available tool's version. |
| SEE NOTE BELOW Adds a dependency on a bundled library JAR file of the current IntelliJ Platform, like lib/annotations.jar. |
| Adds a dependency on a custom IntelliJ Platform dependency available in the IntelliJ Maven Repositories. If version is omitted, the closest compatible version is used. |
| Adds a test dependency on a custom IntelliJ Platform dependency available in the IntelliJ Maven Repositories. If version is omitted, the closest compatible version is used. |
See also:
Java Runtime
Using the jetbrainsRuntime()
or jetbrainsRuntimeExplicit()
dependency helpers, it is possible to load a custom version of JetBrains Runtime. However, it is recommended to rely on the runtime bundled within the IntelliJ Platform dependency, if present.
The jetbrainsRuntime()
helper is applied by default and if JetBrains Runtime is not bundled within the currently used IntelliJ Platform, it refers the relevant runtime version automatically.
Function | Description |
---|---|
| Adds a dependency on JetBrains Runtime in version obtained with the current IntelliJ Platform if resolved from IntelliJ Maven Repository. |
| Adds a dependency on JetBrains Runtime. |
| Adds a dependency on a local JetBrains Runtime instance. |
| Adds a dependency on JetBrains Runtime in explicit version. |
See JetBrains Runtime (JBR) for more details.
Code Instrumentation
The code instrumentation process handled with the instrumentCode
task, requires extra dependencies to work and properly adjust the Java bytecode. There used to be an instrumentationTools()
convenience helper that applied the required dependencies using defaults; it is now deprecated and calling it is no longer necessary. You can still add and configure the dependencies separately if needed.
Adds a Java Compiler dependency for code instrumentation. The version is determined by the IntelliJ Platform build number. If the exact version is unavailable, the closest one is used, found by scanning all releases.
The javaCompiler()
helper is applied by default and refers to the tool version close to the currently used IntelliJ Platform.
Function | Description |
---|---|
| Deprecated: calling this helper is no longer necessary; previously applied |
| Adds a dependency on Java Compiler. |