Previously, the configuration metadata annotation processor relied
upon an additional metadata file have been copied to an output
location. When building with Gradle, it's the processResources task
that performs this copy and there is no guarantee that it will have
run before the compileJava task unless an explicit dependency betwee
the two tasks has been configured. If a project is built using
Gradle's parallel build support, the likelihood of this required
ordering not occurring increases.
This commit updates the configuration metadata annotation processor to
consider a new annotation processor option when looking for the
additional config metadata file. The Gradle plugin has been updated
to provide this option as a compiler argument. The option is only
provided when the annotation processor is found on the compilation
classpath to avoid a warning from javac's annotation processing about
the use of an option that is not supported by any of the available
annotation processors.
Closes gh-9755
This commit adds a new customizer interface, `NettyServerCustomizer` for
customizing Reactor Netty server instances while they're being built.
Closes gh-10418
Exceptions inside AbstractReactiveHealthIndicator.doHealthCheck()
method, outside of Mono pipeline, could fail whole endpoint
response instead of returning `DOWN` status from indicator.
See gh-10822
This commit updates `WebFluxSecurityConfiguration` to look for a
`WebFilterChainProxy` rather than the default configuration that
`@EnableWebFluxSecurity` triggers. The latter is now package private.
Previously, ConfigurationPropertiesBindingPostProcessor had a number
of setter methods that implied that its configuration was more mutable
than it actually is and would only have an effect when called early
on in the post-processor's lifecycle.
This commit clarifies how the post-processor can be configured by
removing the misleading setters.
Closes gh-10598
Previously, configuration properties binding would only see changes to
the environment if there was no PropertySourcesPlaceholderConfigurer
in the context. This happened because
PropertySourcesPlaceholderConfigurer wrapped the Environment in a
PropertySource, effectively hiding it from the change tracking
performed by SpringConfigurationPropertySources.
This commit updates ConfigurationPropertiesBindingPostProcessor so
that it ignores the environment property source contained by
PropertySourcesPlaceholderConfigurer and uses a composite of
the PropertySourcesPlaceholderConfigurer's other property sources and
the Environment's PropertySources instead.
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
- New repeatable tag query parameter to refine a query by one or more
tag key/value pairs.
- Selecting a metric by name (and optionally a set of tags) reports
statistics that are the sum of the statistics on all time series
containing the name (and tags).
Closes gh-10524
Travis is terminating builds as they are producing too much logging.
A major contributor to the volume of logging is the Gradle plugin's
build. This commit switches off debug logging for the build and
enables test event logging. This considerably reduces the volume of
logging that is produced while still providing some insight into the
build's tests.
Update `LoggingMainClassTimeWarningListener` to import individual
`Layout` inner classes. This fixes an odd javac parse issue that
otherwise occurs.
See gh-9316
Move projects to better reflect the way that Spring Boot is released.
The following projects are under `spring-boot-project`:
- `spring-boot`
- `spring-boot-autoconfigure`
- `spring-boot-tools`
- `spring-boot-starters`
- `spring-boot-actuator`
- `spring-boot-actuator-autoconfigure`
- `spring-boot-test`
- `spring-boot-test-autoconfigure`
- `spring-boot-devtools`
- `spring-boot-cli`
- `spring-boot-docs`
See gh-9316