plugin_dependencies.md: cleanup

This commit is contained in:
Yann Cébron 2025-03-25 13:34:33 +01:00
parent 2995f00157
commit aced22c977

View File

@ -29,8 +29,8 @@ To express a dependency on classes from other plugins or modules, perform the fo
> If `java.lang.NoClassDefFoundError` occurs at runtime, most likely Step 3 was omitted.
>
> Otherwise, loading the plugin dependency may have failed, please check log files from
> the [Development Instance](ide_development_instance.md#development-instance-settings-caches-logs-and-plugins)).
> Otherwise, loading the plugin dependency may have failed, check log files from
> the [Development Instance](ide_development_instance.md#development-instance-settings-caches-logs-and-plugins).
>
{title="Getting java.lang.NoClassDefFoundError"}
@ -71,7 +71,8 @@ Use [`listBundledPlugins`](tools_gradle_intellij_plugin.md#tasks-listbundledplug
<tab title="Other">
Locate the plugin's main JAR file containing <path>META-INF/plugin.xml</path> descriptor with [`<id>`](plugin_configuration_file.md#idea-plugin__id) tag (use [`<name>`](plugin_configuration_file.md#idea-plugin__name) if `<id>` is not specified).
Locate the plugin's main JAR file containing the <path>META-INF/plugin.xml</path> descriptor with the [`<id>`](plugin_configuration_file.md#idea-plugin__id) tag
(use [`<name>`](plugin_configuration_file.md#idea-plugin__name) if `<id>` is not specified).
Bundled plugins are located in <path>\$PRODUCT_ROOT\$/plugins/\$PLUGIN_NAME\$/lib/\$PLUGIN_NAME\$.jar</path>.
@ -106,7 +107,7 @@ See also [](plugin_compatibility.md#modules-specific-to-functionality).
### Preparing Sandbox
If the plugin is not bundled with the target IDE, run the (sandbox) [IDE Development Instance](ide_development_instance.md) of your target IDE and install the plugin there.
If the plugin is not bundled with the target IDE, run the (sandbox) [](ide_development_instance.md) of your target IDE and install the plugin there.
## 2. Project Setup
{#project-setup}
@ -140,7 +141,7 @@ See [](tools_intellij_platform_gradle_plugin_dependencies_extension.md#plugins)
<include from="tools_gradle_intellij_plugin.md" element-id="gradlePluginObsolete"/>
> Please see the [`intellij.plugins`](tools_gradle_intellij_plugin.md#intellij-extension-plugins) property for acceptable values.
> See the [`intellij.plugins`](tools_gradle_intellij_plugin.md#intellij-extension-plugins) property for acceptable values.
>
{style="note"}
@ -185,12 +186,12 @@ Add the JARs of the plugin on which the project depends to the <control>Classpat
>
{style="warning"}
<procedure title="Adding a plugin dependency in DevKit-based plugin">
<procedure title="Adding a plugin dependency in a DevKit-based plugin">
1. Open the <control>Project Structure</control> dialog and go to <ui-path>Platform Settings | SDKs</ui-path> section.
2. Select the SDK used in the project.
3. Click the <control>+</control> button in the <control>Classpath</control> tab.
4. Select the plugin JAR depending on whether it is bundled or non-bundled plugin:
4. Select the plugin JAR depending on whether it is a bundled or non-bundled plugin:
- For bundled plugins, the plugin JAR files are located in <path>plugins/\$PLUGIN_NAME\$</path> or <path>plugins/\$PLUGIN_NAME\$/lib</path> under the main installation directory.
- For non-bundled plugins, depending on the platform version, the plugin JAR files are located in:
- [plugins directory for versions 2020.1+](https://www.jetbrains.com/help/idea/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#plugins-directory)
@ -201,14 +202,14 @@ Add the JARs of the plugin on which the project depends to the <control>Classpat
## 3. Dependency Declaration in plugin.xml
{#dependency-declaration-in-pluginxml}
Regardless of whether a plugin project uses [](plugin_compatibility.md#modules-available-in-all-products), or [](plugin_compatibility.md#modules-specific-to-functionality), the correct module must be listed as a dependency in <path>plugin.xml</path>.
Regardless of whether a plugin project uses [](plugin_compatibility.md#modules-available-in-all-products) or [](plugin_compatibility.md#modules-specific-to-functionality), the correct module must be listed as a dependency in <path>plugin.xml</path>.
If a project depends on another plugin, the dependency must be declared like a [module](plugin_compatibility.md#modules).
If only general IntelliJ Platform features (APIs) are used, then a default dependency on `com.intellij.modules.platform` must be declared.
To display a list of available IntelliJ Platform modules, invoke the [code completion](https://www.jetbrains.com/help/idea/auto-completing-code.html#4eac28ba) feature for the [`<depends>`](plugin_configuration_file.md#idea-plugin__depends) element contents while editing the plugin project's <path>plugin.xml</path> file.
In the <path>plugin.xml</path>, add a `<depends>` tag with the dependency plugin's ID as its content.
Continuing with the example from [Project Setup](#project-setup) above, the dependency declaration in <path>plugin.xml</path> would be:
Continuing with the example from the [Project Setup](#project-setup) above, the dependency declaration in <path>plugin.xml</path> would be:
```xml
<depends>com.example.another-plugin</depends>