Skip to main content

Native Context Mode

Native context mode is the capability that sets Explyt Spring apart. Instead of analyzing source code only, the plugin runs a lightweight version of your application and uses a javaagent with 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 Spring applications. A tool that only reads source code has to guess what the container will actually create, and it guesses wrong in exactly the cases that are hardest to reason about by hand.

Native context mode gives the IDE the actual bean model, so the plugin correctly understands:

  • @Conditional beans and profile-activated beans
  • Beans created by factory methods and @Bean configuration
  • Complex or custom @ComponentScan setups
  • XML configuration, with no extra setup required
  • Library beans — beans contributed by your dependencies, not just project sources
  • Projects with multiple ApplicationContext instances

The practical payoff is threefold: accurate bean detection including conditionally loaded and dynamically defined beans, fewer false warnings from inspections because they run against real data, and navigation and completion driven by actual bean definitions.

How it works

  1. You link a Spring Boot run configuration in the Explyt Spring tool window, using Link Explyt Spring Boot Project From RunConfiguration.
  2. The plugin attaches a lightweight javaagent and starts a minimal load of your application.
  3. The agent uses declarative bytecode patching to intercept Spring startup and read BeanDefinition metadata.
  4. That metadata flows back into the IDE, where it powers the bean tree, inspections, navigation, and completion.

Your build and run configuration are patched automatically for the duration of the load and reverted afterwards.

Loading the model

Open the Explyt Spring tool window and use the toolbar:

ActionWhat it does
Link Spring Boot Project From selected RunConfigurationThe + button inside the tool window. Associates a run configuration with the native model, compiles the project, and performs the load. Do this once per application.
Link Explyt Spring Boot Project From RunConfigurationThe same operation, available from the main IDE toolbar.
RefreshRe-reads the model after code changes, without re-linking. Also available as a floating editor button on Ctrl+Shift+O (Cmd+Shift+O on macOS).
Detach All Spring Boot ProjectsDrops the native model when you temporarily do not need it.

A compile is required because the agent reads metadata from compiled classes. The gutter marker that starts a load describes it as "Load all bean definitions info to Explyt Spring Tool Window (Required compile)".

Native context mode compared with static analysis

Both modes are active. Static analysis works from the moment you open the project; native context mode adds an authoritative layer on top once you load it.

Static analysisNative context mode
AvailabilityImmediately on project openAfter linking a run configuration, which compiles and loads
AccuracyGood for quick feedbackHighest — resolves conditional, profile, factory, and library beans
Best forFast iteration, Quarkus projectsAuthoritative autowiring checks, bean navigation, tool window data

Quarkus support is built entirely on static analysis and does not require a load — see Quarkus support.

Tips for large projects

  • Link only the run configurations you actually need.
  • Prefer Refresh over re-linking when the project structure has not changed.
  • Use Detach All Spring Boot Projects to drop the model when you are working elsewhere in the codebase.
  • On Spring Boot versions older than 2.4, try enabling the registry key explyt.spring.native.old. See Troubleshooting.

Further reading

See also: Tool windows · Quickstart · Troubleshooting