Skip to content

Native Context Mode

Ilya Muromtsev edited this page Jun 16, 2026 · 2 revisions

Native Context Mode

Native context mode is what sets Explyt Spring apart. Instead of analyzing source code only, the plugin runs a lightweight version of your application and uses a javaagent + declarative bytecode patching to hook into Spring's startup and extract bean metadata early — without fully starting the app.

Why it matters

Static analysis breaks down on real-world Spring applications. Native context mode gives you the actual bean model, so the plugin understands:

  • @Conditional beans and profile-activated beans
  • Beans created by factory methods and @Bean configuration
  • Complex / custom @ComponentScan setups
  • XML configuration (no extra setup required in native mode)
  • Library beans — beans contributed by your dependencies, not just project sources
  • Projects with multiple ApplicationContexts

The payoff:

  • Accurate bean detection, including conditionally loaded and dynamically defined beans.
  • Better inspections — real bean data means fewer false warnings.
  • Improved navigation & completion based on actual bean definitions.

How it works

  1. Link a Spring Boot run configuration in the Explyt Spring tool window (Link Explyt Spring Boot Project From RunConfiguration).
  2. The plugin attaches a lightweight javaagent and starts a minimal load of your app.
  3. The agent uses declarative bytecode patching to intercept Spring startup and read BeanDefinition metadata.
  4. Metadata flows back into the IDE to power the bean tree, inspections, navigation, and completion.

Build/run configuration is patched automatically for the load and reverted afterwards.

Native context mode vs static analysis

Static analysis Native context mode
Availability Immediately on project open After a compile + lightweight load (Load Beans)
Accuracy Good for quick feedback; Quarkus Highest — conditional, profile, factory, library beans
Best for Fast iteration, Quarkus projects Authoritative autowiring checks, bean navigation, tool-window data

Tips for large projects

  • Link only the run configurations you actually need.
  • Prefer Refresh over re-linking when possible.
  • Use Detach All Spring Boot Projects when you temporarily don't need native data.
  • For Spring Boot < 2.4, try enabling the registry key explyt.spring.native.old.

See it

A short video of native context mode loading beans in the Explyt Spring tool window:

ExplytSpringBoot.mp4

Learn more

See also: Usage · Features · Installation Guide

Clone this wiki locally