10 KiB
Publishing a Plugin
Publishing a plugin to JetBrains Marketplace manually or with Gradle IntelliJ Plugin.
When a plugin is ready, it can be published to the JetBrains Marketplace plugin repository so that other users can install it in their IDE.
When publishing a plugin to a repository other than the JetBrains Marketplace, refer to the documentation.
The first plugin publication must always be uploaded manually.
Before publishing a plugin, make sure it:
- follows all recommendations from
- follows all requirements from Plugin Overview page
The webinar Busy Plugin Developers. Episode 2 discusses 5 tips for optimizing JetBrains Marketplace plugin page in more detail.
See also about widgets and badges.
Uploading a Plugin to JetBrains Marketplace
Before publishing a plugin, make sure it is signed. For more details on generating a proper certificate and configuring the signing process, check the Plugin Signing article.
To upload a plugin to the JetBrains Marketplace, log in with your personal JetBrains Account.
- Open the JetBrains Account Center and click Create Account.
- Fill in all fields in the Create JetBrains Account form that opens and click Register.
To upload a plugin to JetBrains Marketplace:
- Log in to JetBrains Marketplace with your personal JetBrains account.
- On the Profile page that opens, click Add new plugin.
- Fill in the Add new plugin form that opens and click the Add the plugin button to upload the plugin.
See also Marketplace Docs.
Uploading a New Version
New versions can be uploaded manually on the plugin's detail page, see Marketplace Docs for details. See on how to publish new versions using Gradle.
Publishing Plugin With Gradle
Once Gradle support has been configured, and the plugin has been uploaded manually to the plugin repository at least once, it can be built and deployed to the JetBrains Marketplace automatically using dedicated Gradle tasks.
Building Distribution
For the initial upload, manual distribution, or local installation, invoke the buildPlugin
Gradle task
(Reference: 2.x, 1.x) to create the plugin distribution.
If the project is configured to rely on , use the signPlugin
task instead
(Reference: 2.x, 1.x).
The resulting ZIP file is located in build/distributions and can then be installed in the IDE via Install Plugin from Disk... action or uploaded to a .
Providing Your Personal Access Token to Gradle
To deploy a plugin to the JetBrains Marketplace, supply the Personal Access Token, which can be found on your profile page in the My Tokens section.
To create a new token, provide its name and click the Generate Token button. A new token will be created and displayed right below.
Copy it before closing this page and keep it in a secure location. This is the only time the token is visible.
{style="warning"}
This section describes two options to supply the Personal Access Token via Gradle using:
- Environment variables,
- Parameters to the Gradle task.
Using Environment Variables
Start by defining an environment variable such as:
export ORG_GRADLE_PROJECT_intellijPlatform.publishing.token='YOUR_TOKEN'
export ORG_GRADLE_PROJECT_intellijPublishToken='YOUR_TOKEN'
On macOS systems, environment variables set in .bash_profile are only visible to processes run from bash. Environment variables visible to all processes need to be defined in Environment.plist.
{style="note" title="macOS Note"}
Now provide the environment variable in the run configuration for running the publishPlugin
task locally
(Reference: 2.x, 1.x).
To do so, create a Gradle run configuration (if not already done), select the Gradle project, specify the
publishPlugin
task, and then add the environment variable.
IntelliJ Platform Gradle Plugin (2.x)
publishPlugin {
token.set(System.getenv("ORG_GRADLE_PROJECT_intellijPlatform.publishing.token"))
}
Gradle IntelliJ Plugin (1.x)
{collapsible="true" default-state="collapsed"}
publishPlugin {
token.set(System.getenv("ORG_GRADLE_PROJECT_intellijPublishToken"))
}
publishPlugin {
token = System.getenv("ORG_GRADLE_PROJECT_intellijPublishToken")
}
Note that it's still required to put some default values (can be empty) in the Gradle properties. Otherwise, there can be a compilation error.
Using Parameters for the Gradle Task
Like using environment variables, the token can also be passed as a parameter to the Gradle task. For example, provide the parameter on the command line or by putting it in the arguments of the Gradle run configuration.
-Dorg.gradle.project.intellijPlatform.publishing.token=YOUR_TOKEN
-Dorg.gradle.project.intellijPublishToken=YOUR_TOKEN
Note that in this case also, it's still required to put some default values (can be empty) in the Gradle properties
Deploying a Plugin with Gradle
The first step when deploying a plugin is to confirm that it works correctly. Verify this by installing the plugin from disk in a fresh instance of the target IDE(s).
Signing a Plugin
The Marketplace signing is designed to ensure that plugins are not modified over the course of the publishing and delivery pipeline.
The signPlugin
Gradle task
(Reference: 2.x, 1.x),
will be executed automatically right before the publishPlugin
task
(Reference: 2.x, 1.x).
For more details on generating a proper certificate and configuring the signPlugin
task, see .
Publishing a Plugin
Once the plugin works as intended, make sure the plugin version is updated, as the JetBrains Marketplace won't accept multiple artifacts with the same version.
To deploy a new version of the plugin to the JetBrains Marketplace, invoke the publishPlugin
Gradle task.
Now check the most recent version of the plugin on the JetBrains Marketplace. If successfully deployed, any users who currently have this plugin installed on an available version of the IntelliJ Platform are notified of a new update available as soon as the update has been verified.
Specifying a Release Channel
It's possible to deploy plugins to a chosen release channel by configuring the publishPlugin.channels
property
(Reference: 2.x, 1.x).
publishPlugin {
channels.set(listOf("beta"))
}
publishPlugin {
channels = ['beta']
}
When empty, this uses the default plugin repository, available to all JetBrains Marketplace users. However, it's possible to publish it to an arbitrarily named channel. These non-default release channels are treated as separate repositories.
When using a non-default release channel, users need to configure a new custom plugin repository in their IDE to install the plugin.
For example, when specifying 'canary'
as channel name, users will need to add the https://plugins.jetbrains.com/plugins/canary/list
repository to install the plugin and receive updates.
Popular channel names include: