Referenced element in plugin descriptor not reachable from module dependencies
Reports references in plugin XML descriptors whose targets are not reachable through the containing module's compile and runtime dependencies.
The following references are checked:
Extension points referenced from
<extensions>entries.Implementation and interface classes referenced from plugin descriptor attributes and tags (excluding registrations, which are handled by
PluginXmlRegistrationCheckInspection).Action and group IDs referenced by other actions and groups (e.g.
add-to-group'sgroup-id,<reference>, group children). Positioning-only attributes (relative-to-action,use-shortcut-of) are not checked, because the runtime degrades gracefully: an unresolvable anchor falls back to the end of the group, and a missing shortcut base action only leaves the action without a shortcut.Resource bundle references (e.g.
resource-bundle, actionbundle).
A plugin may be assembled from several modules. Such modules share a registration scope at runtime, so extension points, actions, and groups declared in a sibling module's production roots are reachable even without a module dependency and are not reported. Classes and resource bundles resolve through classloaders instead and are exempt only between sibling modules loaded by the plugin's main classloader: content modules included with loading="embedded" everywhere, or modules packaged into the main plugin jar without an own content-module descriptor. A content module with any other loading mode gets its own classloader, which sees only declared dependencies, so its classes and bundles are still reported. The multi-module plugin configuration is picked from the Plugin DevKit | Plugin descriptor | Plugin.xml registration check inspection.
A quick fix is available to add a build system dependency on the module that contains the referenced element, and, when applicable, the corresponding <depends>, <dependencies>/<plugin>, or <dependencies>/<module> entry in the plugin descriptor. A descriptor in a test root gets a test-scoped dependency instead, since it is only loaded on the test classpath. A production descriptor referencing a test root of another module gets no fix, since test output is not packaged into a plugin.
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
PluginXmlReferencesModuleReachability- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
Inspection ID: PluginXmlReferencesModuleReachability
Suppressing Inspection
You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:
More detailed instructions as well as other ways and options that you have can be found in the product documentation:
Inspection Details | |
|---|---|
By default bundled with: |