Plugins
Edit pageLast modified: 02 October 2024tip
The IntelliJ Platform Gradle Plugin consists of sub-plugins which should be applied depending on the project structure.
Subplugins architecture allows applying a subset of features, for example, to provide the IntelliJ Platform dependency to a project submodule without creating unnecessary tasks.
The following diagram describes dependencies between plugins provided with the IntelliJ Platform Gradle Plugin.
Platform
Plugin ID: org.jetbrains.intellij.platform
This is a top-level plugin that applies all the tooling for plugin development for IntelliJ-based IDEs. It should be used only with the root module (for submodules, see Module).
build.gradle.kts
plugins {
id("org.jetbrains.intellij.platform") version "2.2.1"
}
build.gradle.kts
plugins {
id("org.jetbrains.intellij.platform") version "2.2.1"
}
Available tasks
buildPlugin
, buildSearchableOptions
, composedJar
, generateManifest
, initializeIntelliJPlatformPlugin
, instrumentCode
, instrumentedJar
, jarSearchableOptions
, patchPluginXml
, prepareSandbox
, prepareTest
, printBundledPlugins
, printProductsReleases
, publishPlugin
, runIde
, setupDependencies
, signPlugin
, testIdePerformance
, testIde
, testIdeUi
, verifyPluginProjectConfiguration
, verifyPluginSignature
, verifyPluginStructure
, verifyPlugin
Module
Plugin ID: org.jetbrains.intellij.platform.module
This plugin applies a smaller set of functionalities for compiling and testing submodules when working in a multi-module architecture.
Compared to the main plugin, it doesn't contain tasks related to publishing or running the IDE for testing purposes.
settings.gradle.kts
rootProject.name = "..."
include(":submodule")
submodule/build.gradle.kts
plugins {
id("org.jetbrains.intellij.platform.module")
}
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
dependencies {
intellijPlatform {
intellijIdeaCommunity("2024.3.3")
}
}
build.gradle.kts
plugins {
id("org.jetbrains.intellij.platform") version "2.2.1"
}
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
dependencies {
intellijPlatform {
intellijIdeaCommunity("2024.3.3")
pluginModule(implementation(project(":submodule")))
}
}
settings.gradle
rootProject.name = '...'
include ':submodule'
submodule/build.gradle
plugins {
id 'org.jetbrains.intellij.platform.module'
}
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
dependencies {
intellijPlatform {
intellijIdeaCommunity '2024.3.3'
}
}
build.gradle
plugins {
id 'org.jetbrains.intellij.platform' version '2.2.1'
}
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
dependencies {
intellijPlatform {
intellijIdeaCommunity '2024.3.3'
pluginModule(implementation(project(':submodule')))
}
}
Note that the :submodule
is added both to the implementation
configuration and intellijPlatformPluginModule
using the Plugins helper method. This guarantees that the submodule content will be merged into the main plugin JAR file.
Available tasks
composedJar
, generateManifest
, initializeIntelliJPlatformPlugin
, instrumentCode
, instrumentedJar
, prepareSandbox
, prepareTest
, printBundledPlugins
, printProductsReleases
, setupDependencies
, testIde
, verifyPluginProjectConfiguration
Settings
Plugin ID: org.jetbrains.intellij.platform.settings
If you define project repositories within the settings.gradle.kts using the dependencyResolutionManagement
, make sure to include the Settings plugin in settings.gradle.kts.
This approach allows for omitting the repositories {}
definition in the build.gradle.kts files. See Dependency Resolution Management for more details.
settings.gradle.kts
import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform
plugins {
id("org.jetbrains.intellij.platform.settings") version "2.2.1"
}
rootProject.name = "..."
dependencyResolutionManagement {
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
}
include(":submodule")
build.gradle.kts
plugins {
id("org.jetbrains.intellij.platform")
}
dependencies {
intellijPlatform {
intellijIdeaCommunity("2024.3.3")
pluginModule(implementation(project(":submodule")))
}
}
tip
Note that build.gradle.kts doesn't define the IntelliJ Platform Gradle Plugin version anymore as it was earlier declared in the settings.gradle.kts file. Specifying the version in two places may result in the following Gradle exception:
The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
submodule/build.gradle.kts
plugins {
id("org.jetbrains.intellij.platform.module")
}
dependencies {
intellijPlatform {
intellijIdeaCommunity("2024.3.3")
}
}
settings.gradle
import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform
plugins {
id 'org.jetbrains.intellij.platform.settings' version '2.2.1'
}
rootProject.name = '...'
dependencyResolutionManagement {
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
}
include ':submodule'
build.gradle
plugins {
id 'org.jetbrains.intellij.platform'
}
dependencies {
intellijPlatform {
intellijIdeaCommunity '2024.3.3'
pluginModule(implementation(project(':submodule')))
}
}
tip
Note that build.gradle doesn't define the IntelliJ Platform Gradle Plugin version anymore as it was earlier declared in the settings.gradle file. Specifying the version in two places may result in the following Gradle exception:
The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
submodule/build.gradle
plugins {
id 'org.jetbrains.intellij.platform.module'
}
dependencies {
intellijPlatform {
intellijIdeaCommunity '2024.3.3'
}
}
Migration
Plugin ID: org.jetbrains.intellij.platform.migration
The Migration plugin is designed to assist in upgrading projects that use Gradle IntelliJ Plugin 1.x to the 2.x version. To prevent Gradle failing due to breaking changes, the org.jetbrains.intellij.platform.migration
plugin was introduced to fill missing gaps and provide migration hints.
It loads the Platform plugin with additional mocks and checks applied — after the successful migration, the org.jetbrains.intellij.platform.migration
identifier shoud be replaced with org.jetbrains.intellij.platform
.
See Migrating from Gradle IntelliJ Plugin (1.x) for more details.
Base
Plugin ID: org.jetbrains.intellij.platform.base
Prepares all the custom configurations, transformers, and base tasks needed to manage the IntelliJ Platform dependency, JetBrains Runtime, CLI tools, and others.
It also introduces the IntelliJ Platform Extension to the build.gradle.kts file along with Dependencies Extension and Repositories Extension to help preconfigure project dependencies:
repositories {
...
// Repositories Extension
intellijPlatform { ... }
}
dependencies {
...
// Dependencies Extension
intellijPlatform { ... }
}
// IntelliJ Platform Extension
intellijPlatform { ... }
repositories {
...
// Repositories Extension
intellijPlatform { ... }
}
dependencies {
...
// Dependencies Extension
intellijPlatform { ... }
}
// IntelliJ Platform Extension
intellijPlatform { ... }
The plugin also introduces a task listener which allows for creating custom tasks decorated with Task Awares. See Recipes for more details.
Available tasks
initializeIntelliJPlatformPlugin
, printBundledPlugins
, printProductsReleases
, setupDependencies
,
Thanks for your feedback!