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:
@Conditionalbeans and profile-activated beans- Beans created by factory methods and
@Beanconfiguration - Complex or custom
@ComponentScansetups - XML configuration, with no extra setup required
- Library beans — beans contributed by your dependencies, not just project sources
- Projects with multiple
ApplicationContextinstances
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
- You link a Spring Boot run configuration in the Explyt Spring tool window, using Link Explyt Spring Boot Project From RunConfiguration.
- The plugin attaches a lightweight javaagent and starts a minimal load of your application.
- The agent uses declarative bytecode patching to intercept Spring startup and read
BeanDefinitionmetadata. - 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:
| Action | What it does |
|---|---|
| Link Spring Boot Project From selected RunConfiguration | The + 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 RunConfiguration | The same operation, available from the main IDE toolbar. |
| Refresh | Re-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 Projects | Drops 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 analysis | Native context mode | |
|---|---|---|
| Availability | Immediately on project open | After linking a run configuration, which compiles and loads |
| Accuracy | Good for quick feedback | Highest — resolves conditional, profile, factory, and library beans |
| Best for | Fast iteration, Quarkus projects | Authoritative 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
- Stop playing catch-up with Spring — Explyt Spring for IDEA Community
- Patching Spring bytecode to enhance application context recognition
See also: Tool windows · Quickstart · Troubleshooting