Skip to content

Commit 19c88f2

Browse files
committed
Polish components indexer doc
Issue: SPR-15793
1 parent fb4ddb0 commit 19c88f2

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/docs/asciidoc/core/core-beans.adoc

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5864,12 +5864,12 @@ metadata is provided per-instance rather than per-class.
58645864

58655865

58665866
[[beans-scanning-index]]
5867-
=== Generating a index of candidate components
5868-
Rather than scanning the classpath to find components, it is also possible to generate an
5869-
index at compilation time. When the `ApplicationContext` detects such index it will
5870-
automatically use it rather than scanning the classpath. This can reduce the time required
5871-
to refresh the `ApplicationContext` as scanning large applications can take a significant
5872-
amount of time.
5867+
=== Generating an index of candidate components
5868+
While classpath scanning is very fast, it is possible to improve the startup performance
5869+
of large applications by creating a static list of candidates at compilation time. In this
5870+
mode, _all modules_ of the application must use this mechanism as, when the
5871+
`ApplicationContext` detects such index, it will automatically use it rather than scanning
5872+
the classpath.
58735873

58745874
To generate the index, simply add an additional dependency to each module that contains
58755875
components that are target for component scan directives:
@@ -5900,6 +5900,13 @@ Or, using Gradle:
59005900
That process will generate a `META-INF/spring.components` file that is going to be
59015901
included in the jar.
59025902

5903+
[NOTE]
5904+
====
5905+
When working with this mode in your IDE, the `spring-context-indexer` must be registered
5906+
as an annotation processor to make sure the index is up to date when candidate components
5907+
are updated.
5908+
====
5909+
59035910
[TIP]
59045911
====
59055912
The index is enabled automatically when a `META-INF/spring.components` is found on the

0 commit comments

Comments
 (0)