Since Kotlin extensions do not apply to static
methods, this commit introduces a runApplication()
Kotlin top level function that acts as a Kotlin
shortcut for SpringApplication.run().
This shortcut avoids to require using non-idiomatic
code like SpringApplication.run(FooApplication::class.java)
and provides a runApplication<FooApplication>() alternative
(as well as an array of KClass based alternative when
multiple classes need to be passed as parameter).
It is possible to customize the application with the
following syntax:
runApplication<FooApplication>() {
setEnvironment(environment)
}
See gh-10511
This commit adds Kotlin main artifacts to Spring
Boot dependency management and will be replaced by
Kotlin BOM when it will be available (see KT-18398).
See gh-9486
This commit renames spring.datasource.initialize to
spring.datasource.initialization-mode and use the
DataSourceInitializationMode enum. By default, only an embedded
datasource is initialized.
Closes gh-10773
This commit introduces a endpoints.<id>.web.path generic property that
allows to customize the path of an endpoint. By default the path is the
same as the id of the endpoint.
Such customization does not apply for the CloudFoundry specific
endpoints.
Closes gh-10181
This commit makes sure that the `replyTemplate` is set if a
KafkaTemplate is available in the context which effectively add support
for `@SendTo`.
Closes gh-10669
When building a flattened map, the YamlProcessor from
Spring Framework, converts a null value to an empty string.
We want the null value to also keep track of its origin,
which is why this commit creates an `OriginTrackedValue`
for an empty string if the original value is null.
Fixes gh-10656
This commit removes the cleanup of the javax.validator.Validator that
can be created to validate @ConfigurationProperties binding as the
memory effect can no longer be reproduced.
Closes gh-10573
Following some changes in the latest snapshot this includes:
- Some updates to oauth2 client auto-config
- Security auto-config no longer relies on GlobalAuthenticationConfigurerAdapter
- Remove reactive security starter
Closes gh-10704
Regardless of whether the web endpoints have been enabled or not,
all endpoints for which beans are created need to be exposed in a
CF environment under /cloudfoundryapplication.
Closes gh-10673
This commit introduces a new mainClassName property on the springBoot
DSL provided by the Gradle plugin. It can be used to explicitly
configure the mainClassName of the default bootRun, bootJar, and
bootWar tasks in a single place. Previously, the only mechanism
provided to do so was the mainClassName property that's only available
when the application plugin has been applied.
Closes gh-10623
Previously, BootRun used the main property to configure the name of
the main class to run while BootJar and BootWar used the mainClass
property. Both were different to the application plugin which provides
a mainClassName project property.
This commit updates BootRun, BootJar, and BootWar to change the name
of the property used to configure the name of the main class to be
mainClassName. This makes the three Boot-specific tasks consistent
with each other, and also aligns them with Gradle's own application
plugin.
Closes gh-10622
Previously, we relied on Mockito's internals to bypass any Spring AOP
proxy during verification of a spy. Thanks to a new API in Mockito,
we can replace the use of Mockito's internals with a
VerificationStartedListener. This listener changes Mockito's view of
the mock to be the ultimate target of the AOP proxy, i.e. to be the
actual Mockito-created spy, allowing Mockito's verification of the
spy to proceed successfully.
This above-described change will mean that we require a very
up-to-date version of Mockito so the tests that verify our
compatibility with 2.5 have been removed as we will no longer support
it when using @MockBean or @SpyBean.
Lastly, two tests have been updated to replace their usage of the
internal MockUtil class with the equivalent public API calls.
Closes gh-10352
Previously, the media types that are consumed and produced by
endpoints were configured in the web stack-specific configuration.
Furthermore, these configured media types were not used for the
discovery "endpoint" that links to all the available endpoints.
This commit introduces EndpointMediaTypes that is configred in a
single, central location and then used to configure the consumed and
produced media types for endpoints exposed via WebFlux, Web MVC, and
Jersey as well as the discovery "endpoint" provided by each.
Closes gh-10659
Starting with Hibernate 5.2.10, the JPA property
`hibernate.connection.provider_disables_autocommit` should be set to true
when the datasource has autocommit disabled in order to improve
performance.
See gh-9737
The current documentation references mechanisms for OpenShift 2, which
has been changed significantly with the latest releases, specifically the
OpenShift 3 release.
Closes gh-10609
This commit adds support for Spring Boot error conventions with WebFlux.
The Spring MVC support for that is based on an `Controller` that's
mapped on a specific `"/error"` path and configured as an error page in
the Servlet container. With WebFlux, this support leverages a
`WebExceptionHandler`, which catches exceptions flowing through the
reactive pipeline and handles them.
The `DefaultErrorWebExceptionHandler` supports the following:
* return a JSON error response to machine clients
* return error HTML views (templates, static or default HTML view)
One can customize the error information by contributing an
`ErrorAttributes` bean to the application context.
Spring Boot provides an `ErrorWebExceptionHandler` marker interface and a
base implementation that provides high level constructs to handle
errors, based on the Spring WebFlux functional flavor.
The error handling logic can be completely changed by providing a custom
`RouterFunction` there.
Fixes gh-8625
Update `Binder` so that Maps containing references to themselves may
be bound. The existing stack-overflow protection (required when binding
a bean to a non enumerable source) now only applies to bean properties.
Fixes gh-9801