Previously, AutoConfigureMockMvc used Spring Security's default filter
ordering, ignoring the value configured by SecurityProperties that is
used at runtime. This resulted in different ordering at runtime and in
tests.
This commit updates the configuration for AutoConfigureMockMvc to
import the Spring Security filter auto-configuration, thereby ensuring
that the ordering configured via SecurityProperties is applied.
Fixes gh-21801
Previously, when lazy initialization was enabled, STOMP-based WebSocket
messaging would not work as the stompWebSocketHandlerMapping bean was
not initialized and CONNECT requests would go unanswered.
This commit adds a LazyInitializationExcludeFilter that causes the
stompWebSocketHandlerMapping bean to always be initialized eagerly.
This triggers initialization of the WebSocket transport allowing
requests to be received and processed.
Fixes gh-19611
This commit improves the tests for BasicErrorController by decoupling
coverage for the include-message and include-binding-errors
parameters to ensure the options operate properly independent of
each other.
See gh-21702
Alter the logic of `MustacheEnvironmentCollector` so that the
native fetcher is always consulted if it exists.
When the context is a map (as it is in a web View for instance) you
can't assume a non-null fetcher actually contains the property you are
searching for.
See gh-21060
Previously, the spring bash script added . to the classpath but the
Windows spring.bat script did not. This commit aligns the classpath
of the two scripts by removing . from the classpath in the bash
script.
Fixes gh-19910
Allow `BeanDefinitionLoader` to load classes that don't have public
constructors. The constraint was first introduced in d82c50804f to
solve an issue with anonymous Groovy classes but causes particular
problems with `@SpringBootTest`.
See gh-20929
Update `LaunchedURLClassLoader` so that packages defined from exploded
archive folders have manifest attributes applied to them. Prior to this
calling `package.getImplementationTitle()` would only return the a
manifiest attribute when running non-exploded.
The root cause of this issue is the way that `URLClassLoader` handles
the different URL types. For URLs that reference a jar the manifest is
available. For URLs that reference a folder it isn't. When running
exploded we use a URL that references to the `BOOT-INF/classes` folder
directly. To fix the issue we now attempt to detect when `definePackage`
is being called directly, and replace `null` entries with actual
manifest values.
Fixes gh-21705
Update `SpringBootServletInitializer` to use the `ServletContext` that
was provided to the initial `onStartup` call rather than the
one from the `ServletContextEvent`. This allows the `getClassLoader()`
call to complete without throwing an `UnsupportedOperationException`.
Fixes gh-21684
This commit improves the error messages returned by the Spring Boot
build plugins when a 5xx status code is returned from the Docker
API while attempting to build an image. If the error response has
contents containing a JSON structure with a "message" key, the value
associated with that key will be included in the exception message
and in the build plugin output error.
Fixes gh-21515
Update `SpringConfigurationPropertySource` so that wrapped random
property sources can be used. It's assumed that wrapped random
sources will use the name of the source as the prefix.
Closes gh-21595
Previously, if the Spring Boot build plugins got a connection error
when attempting to communicate with a Docker daemon (for example,
when the daemon isn't running), the error message made it appear that
the daemon returned an HTTP error code. This commit makes a connection
error distinct from an HTTP error response code to make it easier for
the user to diagnose the root cause of the problem.
Fixes gh-21554
Previously, an AvailabilityChangeEvent was published when the servlet
and reactive web server application contexts were closed, irrespective
of whether or not the context was active. This caused problems when
the context was not active due to a refresh failure as the event
publication could then trigger bean creation and post-processing that
relied upon beans that had been destroyed when cleaning up after the
refresh failure. The most commonly seen symptom was a missing
importRegistry bean that is required by ImportAwareBeanPostProcessor.
This commit updates the two web server application contexts to only
publish the availability change event if the context is active.
Fixes gh-21588
Previously, the productionRuntimeClasspath configuration was created
without any attributes. This caused problems with multi-project
dependency resolution as there was insufficient information for Gradle
to determine which variant of a dependency should be used by the
productionRuntimeClasspath configuration.
This commit updates the configuration to have three attributes, each
configured with the same values as those of Gradle's own
runtimeClasspathConfiguration.
Fixes gh-21549
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
Prior to this commit, Spring Boot would auto-configure Spring MVC and
would keep the default `UrlPathHelper` configuration.
Since Spring Boot is in charge of configuring the `DispatcherServlet`
and its mapping, it is in a position to optimally configure the
`UrlPathHelper` depending on the chosen mapping.
This commit sets the `alwaysUseFullPath` property of `UrlPathHelper` if
the Servlet mapping is `"/"`. This is more efficient since this
configuration requires less processing of the request path.
Closes gh-21499
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, a default tag of 'latest' was used when no tag
was included in the builder image name used when building an image in
the Maven and Gradle plugins, but the tag for the run image was left
empty if it was not provided. This resulted in errors when pulling
the run image from an image repository. This commit applies the
same tag defaulting logic to the run image name.
Fixes gh-21532