Document all supported SpringProperties keys in the reference manual

Closes gh-26554
This commit is contained in:
Sam Brannen
2021-02-24 17:18:04 +01:00
parent 262b7d7c27
commit a9240e0bac
6 changed files with 114 additions and 27 deletions

View File

@@ -7120,10 +7120,10 @@ metadata is provided per-instance rather than per-class.
While classpath scanning is very fast, it is possible to improve the startup performance
of large applications by creating a static list of candidates at compilation time. In this
mode, all modules that are target of component scan must use this mechanism.
mode, all modules that are targets of component scanning must use this mechanism.
NOTE: Your existing `@ComponentScan` or `<context:component-scan` directives must stay as
is to request the context to scan candidates in certain packages. When the
NOTE: Your existing `@ComponentScan` or `<context:component-scan/>` directives must remain
unchanged to request the context to scan candidates in certain packages. When the
`ApplicationContext` detects such an index, it automatically uses it rather than scanning
the classpath.
@@ -7152,12 +7152,10 @@ configuration, as shown in the following example:
compileOnly "org.springframework:spring-context-indexer:{spring-version}"
}
----
====
With Gradle 4.6 and later, the dependency should be declared in the `annotationProcessor`
configuration, as shown in the following example:
====
[source,groovy,indent=0subs="verbatim,quotes,attributes"]
----
dependencies {
@@ -7165,19 +7163,20 @@ configuration, as shown in the following example:
}
----
That process generates a `META-INF/spring.components` file that is
included in the jar file.
The `spring-context-indexer` artifact generates a `META-INF/spring.components` file that
is included in the jar file.
NOTE: When working with this mode in your IDE, the `spring-context-indexer` must be
registered as an annotation processor to make sure the index is up-to-date when
candidate components are updated.
TIP: The index is enabled automatically when a `META-INF/spring.components` is found
TIP: The index is enabled automatically when a `META-INF/spring.components` file is found
on the classpath. If an index is partially available for some libraries (or use cases)
but could not be built for the whole application, you can fallback to a regular classpath
arrangement (as though no index was present at all) by setting `spring.index.ignore` to
`true`, either as a system property or in a `spring.properties` file at the root of the
classpath.
but could not be built for the whole application, you can fall back to a regular classpath
arrangement (as though no index were present at all) by setting `spring.index.ignore` to
`true`, either as a JVM system property or via the
<<appendix.adoc#appendix-spring-properties,`SpringProperties`>> mechanism.

View File

@@ -433,9 +433,9 @@ interpreter and only 3ms using the compiled version of the expression.
The compiler is not turned on by default, but you can turn it on in either of two
different ways. You can turn it on by using the parser configuration process
(<<expressions-parser-configuration, discussed earlier>>) or by using a system
property when SpEL usage is embedded inside another component. This section
discusses both of these options.
(<<expressions-parser-configuration, discussed earlier>>) or by using a Spring property
when SpEL usage is embedded inside another component. This section discusses both of
these options.
The compiler can operate in one of three modes, which are captured in the
`org.springframework.expression.spel.SpelCompilerMode` enum. The modes are as follows:
@@ -496,10 +496,12 @@ It is important to ensure that, if a classloader is specified, it can see all th
the expression evaluation process. If you do not specify a classloader, a default classloader is used
(typically the context classloader for the thread that is running during expression evaluation).
The second way to configure the compiler is for use when SpEL is embedded inside some other
component and it may not be possible to configure it through a configuration object. In these
cases, it is possible to use a system property. You can set the `spring.expression.compiler.mode`
property to one of the `SpelCompilerMode` enum values (`off`, `immediate`, or `mixed`).
The second way to configure the compiler is for use when SpEL is embedded inside some
other component and it may not be possible to configure it through a configuration
object. In these cases, it is possible to set the `spring.expression.compiler.mode`
property via a JVM system property (or via the
<<appendix.adoc#appendix-spring-properties,`SpringProperties`>> mechanism) to one of the
`SpelCompilerMode` enum values (`off`, `immediate`, or `mixed`).
[[expressions-compiler-limitations]]