Rename `@ConfigurationPropertiesImport` to
`@ImportAsConfigurationPropertiesBean` and also refine the registrar
so that it can be used with type directly annotated with
`@ConfigurationProperties`.
Closes gh-23172
Prior to this commit, Actuator would sanitize properties values when
serializing them on the dedicated endpoint. Keys like "password" or
"secret" are entirely sanitized, but other keys like "uri" or "address"
are considered as URI types and only the password part of the user info
is sanitized.
This commit fixes the sanitization process where lists of such URI types
would not match the first entries of the list since they're starting
with `'['`. This commit improves the regexp matching process to sanitize
all URIs within a collection.
The documentation is also updated to better underline the processing
difference between complete sanitization and selective sanitization for
URIs.
Fixes gh-23037
This commit updates the Maven Plugin to filter dependencies based on
the Spring-Boot-Jar-Type entry in their manifest. Jars with a
Spring-Boot-Jar-Type of dependencies-starter or annotation-processor
are excluded.
See gh-22036
Add repeatable `@ImportConfigurationPropertiesBean` annotation that can
be used to import types and treat them as `@ConfigurationProperties`
beans. This annotation is specifically designed to support third-party
classes that can't contain any Spring annotations.
Closes gh-23172
With the introduction of health indicators that only require the
CqlSession, this commit deprecates the health indicators that require
Spring Data since the latter build on top of the former.
Closes gh-23226
Prior to this commit, Spring Boot would auto-configure both
Elasticsearch variants: `RestClient` ("Low Level" client) and
`RestHighLevelClient` ("High Level" client).
Since one can be derived from the other, this would create complex and
unclear situations depending on what developers provided with their
configuration.
`RestHighLevelClient` is mostly for actual use of the Elasticsearch API,
with support for specific methods and (de)serialization. On the other
hand, `RestClient` is merely wrapping the Apache HTTP client for
load-balancing support and low level HTTP features.
This commit completely removes the support for `RestClient` in Spring
Boot and now requires the presence of the
`org.elasticsearch.client:elasticsearch-rest-high-level-client`
dependency for REST client support with Elasticsearch.
Closes gh-22358
This commit builds on top of gh-22603 and exposes data collected by the
`BufferingApplicationStartup` on a dedicated `"/startup"` Actuator
endpoint.
Closes gh-23213
As of spring-projects/spring-framework#24878, Spring Framework provides
an `ApplicationStartup` infrastructure that applications can use to
collect and track events during the application startup phase.
This commit adds a new `BufferingApplicationStartup` implementation that
buffer `StartupStep`s and tracks their execution time. Once buffered,
these steps can be pushed to an external metrics system or drained
through a web endpoint, to a file...
Closes gh-22603
Support a `spring.config.all-locations-optional` property which can be
set to `true` if all config data locations should be considered
optional.
Closes gh-23097
Update config data processing code so that import locations are
mandatory by default. Any import request will now throw a
`ConfigDataLocationNotFoundException` if the specified import
location cannot be found. For optional imports, the user can
use the `optional:` prefix to indicate that the application should
continue to start, even if the location does not exist.
Closes gh-23032
This commit adds a check to the `layertools extract` command to
ensure that the jar file being processed is readable and has a
valid directory.
Fixes gh-22993
Prior to this commit, values from MongoProperties would always
overwrite matching fields in MongoClientSettings. This commit
preserves all values in MongoClientSettings if the client app
provides the MongoClientSettings bean, and only overwrites from
MongoProperties if no MongoClientSettings bean is provided.
Fixes gh-22321
With the upgrade to the new Couchbase SDK and the related changes in
Spring Data Couchbase, CacheManagerCustomizer can no longer be used to
customize the Couchbase cache manager as it is an immutable class.
This commit introduces a dedicated callback for the
CouchbaseCacheManagerBuilder that is used by the auto-configuration and
update the documentation to refer to it with a sample usage.
Closes gh-22573
Prior to this commit, the HTTP/2 server auto-configuration for Jetty
would require Conscrypt as a hard dependency.
This commit updates the auto-configuration for more flexibility and now
allows the following deployments:
* JDK9+ with the JDK ALPN implementation
* JDK8u252+ with the backported ALPN implementation
* Conscrypt with no JDK requirement
The auto-configuration now improves detection and guides developers in
case there is a missing `jetty-alpn-*-server` dependency.
The reference docs in the HOWTO section has been updated accordingly.
Closes gh-22188
This commit adapts the auto-configuration for the new core r2dbc support
in Spring Framework and provides auto-configuration for
R2dbcEntityOperations.
Closes gh-22708
Add support for volume mounted directories where the filename becomes
the property key and the file contents becomes the value.
Support is provided via a dedicated `VolumeMountDirectoryPropertySource`
class which can either be used directly, or via a "volumemount:/..."
`spring.config.import` location.
Closes gh-19990
Co-authored-by: Phillip Webb <pwebb@vmware.com>
Prior to this commit, the application availability infrastructure
would mix the `AvailabilityState`, the `HealthIndicator` and the
`HealthGroup` concepts and would not align with the rest.
This commit auto-configures the livenessState and readinessState
health indicators with the relevant configuration properties.
Unlike other indicators, they are not enabled by default but might
be in future versions.
This also moves the `management.health.probes.enabled` property
to `management.endpoint.health.probes.enabled` since "probes" here
is not a health indicator but rather a configuration flag for the
health endpoint.
Finally, the probes auto-configuration is refined to automatically
add liveness and readiness indicators for the probes group if
they're not already present.
Closes gh-22107
As of Spring Framework 5.3, it is now possible to use `PathPatternParser`
to parse and match request mapping path patterns, as an alternative to
the current default `AntPathMatcher`.
This new implementation has been used for a while in Spring WebFlux and
it’s been designed for consistency and performance.
This commit introduces a new configuration property for opting-in this
new variant:
`spring.mvc.pathmatch.matching-strategy=path_pattern_parser`
The default option is still `ant_path_matcher` for now, but we might
change the default in future versions since Spring Framework considers
it the best choice for modern applications.
There are several behavior differences with this new variant:
* double wildcards `"**"` are rejected when used in the middle patterns,
this is only allowed as the last matching segment in a pattern.
* it is incompatible with some path matching options, like
suffix-pattern, registered-suffix-pattern or configuring a Servlet
prefix on the `DispatcherServlet` (`spring.mvc.servlet.path=/test`)
This commit introduces two `FailureAnalyzer` implementations to guide
developers when facing those issues.
Closes gh-21694
Previously, spring-boot-docs used the java-base-plugin and then added
configuration on top. This has proven to be error prone, with the most
recent problem being that the tests were not being compiled and run.
This commit changes approach and applies the java plugin to the project
instead of the java-base plugin. Now, rather than adding the necessary
configuration to the base, the unwanted pieces of the java plugin's
configuration – specifically the jar and javadoc tasks – are disabled
instead. The DeployedPlugin has also been updated so that it does not
create a publication from the java component for projects that have a
disabled jar task.
Closes gh-22284
Previously, the configuration property table generation was reading
both the main metadata and the additional metadata from each project.
This was unnecessary as the annotation processor will have already
merged the additional metadata into the main metadata before writing
it to disk. Processing both the main and additional metadata led to
a clash as the metadata overlapped. When the entry in the additional
metadata won the clash, the resulting entry in the configuration
property table would lose any details that aren't contained in the
additional metadata.
This commit updates the property table generation code to only use
the main metadata files.
Fixes gh-21131
Previously, Spring Boot's modules published Gradle Module Metadata
(GMM) the declared a platform dependency on spring-boot-dependencies.
This provided versions for each module's own dependencies but also had
they unwanted side-effect of pulling in spring-boot-dependencies
constraints which would influence the version of other dependencies
declared in the same configuration. This was undesirable as users
should be able to opt in to this level of dependency management, either
by using the dependency management plugin or by using Gradle's built-in
support via a platform dependency on spring-boot-dependencies.
This commit reworks how Spring Boot's build uses
spring-boot-dependencies and spring-boot-parent to provide its own
dependency management. Configurations that aren't seen by consumers are
configured to extend a dependencyManagement configuration that has an
enforced platform dependency on spring-boot-parent. This enforces
spring-boot-parent's version constraints on Spring Boot's build without
making them visible to consumers. To ensure that the versions that
Spring Boot has been built against are visible to consumers, the
Maven publication that produces pom files and GMM for the published
modules is configured to use the resolved versions from the module's
runtime classpath.
Fixes gh-21911
This commit mentions the `management.health.probes.enabled`
configuration property in the Kubernetes Probes section of the Actuator
chapter.
Enabling this property is required if we need to expose Kubernetes
Probes in a non-Kubernetes environment.
Fixes gh-21505
This commit adds the support for static and templated welcome pages with
Spring WebFlux. The implementation is backed by a `RouterFunction`
that's serving a static `index.html` file or rendering an `index` view.
Closes gh-9785
Prior to this commit, the published Maven POMs would not pass the Maven
Central mandatory checks.
This commit adds the missing project name and description metadata for
most artifacts. The Spring Boot Gradle plugin artifact was also missing
this information and this is now added in the plugin metadata itself.
This is also updating the project page URL which is now hosted directly
on spring.io.
Fixes gh-21457
This commit restricts how wildcards can be used in search
locations for property files. If a search location contains
a pattern, there must be only one '*' and the location should
end with a '*/'. For search locations that specify the file
name, the pattern should end with '*/<filename>'.
The list of files read from wildcard locations are now sorted
alphabetically according to the absolute path of the file.
Closes gh-21217
Previously, the developmentOnly configuration, typically used for
Devtools, had to be declared manually. The BootJar and BootWar tasks
then had a property, excludeDevtools, that could be used to control
whether or not Devtools would be excluded from the executable archive.
This commit updates the reaction to the Java plugin being applied to
automatically create the developmentOnly configuration. The classpaths
of bootJar and bootWar are then configured not to include the contents
of the developmentOnly configuration. As a result of this, the
excludeDevtools property is no longer needed and has been deprecated.
Its default has also been changed from true to false to make it easy
to opt in to Devtools, when configured as a development-only
dependency, being included in executable jars and wars by adding
developmentOnly to the classpath of the archive task.
Closes gh-16599
This commit removes the support for Reactor Netty metrics since it
seems that Spring Boot should not use this feature:
* HTTP metrics are already covered by WebFlux
* TCP metrics are only meant to TCP server/clients
* allocator metrics are already provided by Netty and there is
no specific API to enable them here.
Closes gh-19388
This commit enables the production of TCP and buffer allocator metrics
for Reactor Netty, client and server.
When applications use auto-configured server
(`NettyReactiveWebServerFactory`) and client (through
`WebClient.Builder`) instances, metrics will be enabled.
Note that HTTP metrics are not enabled here, since similar metrics are
already produced at the WebFlux level. Also, to avoid cardinality
explosion of metrics (through the URI tag), Reactor Netty offers
configurable infrastructure to deduplicate URI tags by turning expanded
URI instances into templated URIs. This is not targeted for Spring
usage.
Closes gh-19388