Back to Intellij Community

Validation Rules

platform/build-scripts/product-dsl/docs/validation-rules.md

2025.3-rc-24.7 KB
Original Source

Validation Rules

Validation ensures module and plugin dependencies are resolvable at runtime and that descriptors remain consistent with the graph. The authoritative, validator-level specs live in docs/validators/.

Rule Index

#ValidatorScopeSpec
1Self-contained module setModule setself-contained-module-set.md
2Product module setProductproduct-module-set.md
3Pluginized module-set referencesProduct / module setpluginized-module-set-reference.md
4Content module dependenciesBundled pluginscontent-module-dependency.md
5Plugin content dependenciesPluginplugin-content-dependency.md
6Plugin-to-plugin dependenciesPluginplugin-plugin-dependency.md
7Plugin dependency declaration duplicatesPluginplugin-dependency-declaration.md
8Test plugin plugin dependenciesTest plugintest-plugin-plugin-dependency.md
9Duplicate plugin content modulesProductplugin-content-duplicates.md
10Test plugin descriptor ID conflictsProductplugin-descriptor-id-conflicts.md
11Library module replacementModulelibrary-module.md
12Test library scopeModuletest-library-scope.md
13Suppression config keysConfigsuppression-config.md
14Plugin content structural validationPluginplugin-content-structure.md

When Validation Runs

  • IDE: run configuration "Generate Product Layouts"
  • CLI: UltimateModuleSets.main() or CommunityModuleSets.main()
  • Bazel: bazel run //platform/buildScripts:plugin-model-tool

Terminology

  • plugin: a plugin entity in the graph (plugin node) with a descriptor; plugin.xml is the file format.
  • content module: a module declared as content in a plugin, module set, or product.
  • target/JPS module: build-time module from .iml or Bazel target; not validated directly.
  • plugin dependency: dependency on another plugin (plugin-to-plugin).
  • content module dependency: dependency on a module descriptor (module-to-module).

See docs/validators/README.md for the full glossary.

Global Semantics

Graph-first validation

Validation uses the plugin graph after generation, filtering, and suppression. If a dependency is not represented as a graph edge, it is not validated.

Loading modes

LoadingMeaningValidation scope
embeddedCore module, main classloaderPer-product (must resolve in bundling product)
requiredRequired at startupPer-product (must resolve in bundling product)
optionalLoaded if deps availableGlobal existence
on_demandLoaded when requestedGlobal existence
(default)Defaults to optionalGlobal existence

Critical modules are those with embedded/required loading on any incoming content edge.

Resolved vs orphan modules

  • Resolved: module has at least one content source edge (plugin, module set, or product).
  • Orphan: module is referenced by dependency edges but has no content source.

Orphan dependencies are always errors. For non-critical modules, availability is checked globally; for critical modules, availability must be within the bundling product.

Suppression contract

Suppressions are explicit contracts: dependencies intentionally omitted from XML (via suppressions.json or allowlists) must not produce validation errors. Validators operate on the graph after filtering and suppression, not on raw JPS dependencies.

Configuration knobs

  • allowMissingDependencies (product): allow missing module deps in a product.
  • pluginAllowedMissingDependencies (config): allow missing module deps for a plugin.
  • allowedMissingPluginIds (DSL test plugins): allow missing plugin IDs for specific DSL-defined test modules or the whole test plugin.
  • suppressions.json (contentModules.<module>.suppressPlugins): allow missing plugin IDs for non-DSL content modules.
  • suppressions.json: suppress module deps, plugin deps, library replacements, or test-library scope fixes.

See also