Commit Graph

2495 Commits

Author SHA1 Message Date
Julien Eyraud f068f9fc52 Add properties for Netty HttpDecoderSpec
See gh-22367
2020-07-17 20:19:31 +01:00
Stephane Nicoll 0cd83007e9 Merge branch '2.3.x'
Closes gh-22357
2020-07-16 14:24:20 +02:00
dreis2211 267283e3cd Handle null items as advertized in the Javadoc
See gh-22344
2020-07-16 14:17:53 +02:00
Andy Wilkinson 18a3459dc3 Polish "Avoid using reflection when configuring Tomcat listener"
See gh-22329
2020-07-15 11:19:52 +01:00
Filip Hanik be7048b58f Avoid using reflection when configuring Tomcat listener
This benefits native image building and AOT compilation,
as reflection requires manual configuration.

See gh-22329
2020-07-15 11:19:27 +01:00
Andy Wilkinson 177b3918ee Merge branch '2.3.x'
Closes gh-22340
2020-07-15 10:49:27 +01:00
Andy Wilkinson 259ea65388 Merge branch '2.2.x' into 2.3.x
Closes gh-22339
2020-07-15 10:49:01 +01:00
Andy Wilkinson d9882f2c88 Clarify the effects of ordering auto-configuration classes
Closes gh-22337
2020-07-15 10:48:01 +01:00
Andy Wilkinson 8abcb1b125 Polish 2020-07-14 17:22:31 +01:00
Andy Wilkinson c9eead31d1 Avoid reflection when creating manual RootBeanDefinitions
Closes gh-22318
2020-07-14 17:21:44 +01:00
Stephane Nicoll fe39a91290 Merge branch '2.3.x'
Closes gh-22331
2020-07-14 18:15:02 +02:00
dreis2211 de30e5c6ac Avoid unnecessary allocations in ConditionMessage for NORMAL style
See gh-22330
2020-07-14 18:12:17 +02:00
Stephane Nicoll 3ceae84176 Merge branch '2.3.x' 2020-07-14 16:58:02 +02:00
Stephane Nicoll 603e65a629 Polish 2020-07-14 16:57:42 +02:00
Stephane Nicoll c8b67becce Polish "Add additional properties to configure R2DBC pool"
See gh-21219
2020-07-14 16:52:07 +02:00
Rodolpho Couto 0d41596a42 Add additional properties to configure R2DBC pool
See gh-21219
2020-07-14 16:52:07 +02:00
Andy Wilkinson 2642b04073 Merge branch '2.3.x'
Closes gh-22327
2020-07-14 15:00:51 +01:00
dreis2211 60e7146326 Reduce started threads in OnClassCondition
Prior to this commit, OnClassCondition started a thread even if the number of
passed autoconfiguration class candidates never exceeded 1. This commit only
starts a thread if there is actually work to split in half.

See gh-22294
2020-07-14 14:59:53 +01:00
Andy Wilkinson 2af550ef73 Avoid using reflection with manual bean definitions
Closes gh-22318
2020-07-14 14:11:51 +01:00
Brian Clozel 0f264b68e8 Add option to configure PathPatternParser
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
2020-07-09 21:34:00 +02:00
Andy Wilkinson 553d58a234 Merge branch '2.3.x'
Closes gh-22283
2020-07-09 10:37:18 +01:00
Andy Wilkinson c765df6e5d Merge branch '2.2.x' into 2.3.x
Closes gh-22282
2020-07-09 10:37:01 +01:00
Andy Wilkinson afa5b12bdb Make reactive Jetty auto-config back off without jetty-servlet
Fixes gh-22275
2020-07-09 10:36:32 +01:00
Scott Frederick 6b7640ba2e Merge branch '2.3.x'
Closes gh-22272
2020-07-08 15:10:42 -05:00
Scott Frederick 1e2176b6c9 Improve Redis URL validation
This commit improves the validation of URLs provided in the property
'spring.redis.url' used to auto-configure a Spring Data Redis
connection. In particular, only the URL schemes 'redis://' and
'rediss://' are allowed, and any other scheme will result in a
configuration error. A failure analyzer is also provided to improve
diagnostics for common mis-configurations detected by this validation.

Fixes gh-21999
2020-07-08 14:50:26 -05:00
Andy Wilkinson 3e33b6c854 Merge branch '2.3.x'
Closes gh-22263
2020-07-08 17:23:13 +01:00
Andy Wilkinson 502ccb6586 Honor spring.autoconfigure.exclude in test slices
Previously, the import selector for `@ImportAutoConfiguration` did not
consider the spring.autoconfigure.exclude property when determining
which auto-configurations to exclude. This meant that tests using a
slice that included a particular auto-configuration would include it
even if the application's configuration excluded it via
spring.autoconfigure.exclude. Confusingly, this could result in a
sliced test using an auto-configuration that would be excluded in a
broader `@SpringBootTest`.

This commit updates the ImportAutoConfigurationImportSelector to
consider the spring.autoconfigure.exclude property so that sliced tests
will use a subset of the auto-configurations that a `@SpringBootTest`
would use.

Fixes gh-21736
2020-07-08 17:22:32 +01:00
Johnny Lim df34d26f4f Replace ReflectionUtils with AssertJ's extracting()
See gh-22261
2020-07-08 13:57:59 +02:00
Andy Wilkinson 9894be8f1e Merge branch '2.3.x'
Closes gh-22255
2020-07-07 17:29:20 +01:00
Andy Wilkinson 0af8c35428 Auto-configure Rabbit CF with credentials provider and refresh service
Closes gh-22016
2020-07-07 13:07:40 +01:00
Andy Wilkinson 1b85ce0769 Streamline OAuth2 resource server auto-config class conditions
Fixes gh-22233
2020-07-07 12:22:27 +01:00
Andy Wilkinson 247fd59422 Merge branch '2.3.x'
Closes gh-22252
2020-07-07 11:52:50 +01:00
Andy Wilkinson b8bc219b25 Merge branch '2.2.x' into 2.3.x
Closes gh-22251
2020-07-07 11:52:34 +01:00
Andy Wilkinson 4e79bb1cff Disable bean method proxying in SpringBootJdbcConfiguration
Closes gh-22231
2020-07-07 11:51:07 +01:00
dreis2211 507eb9498b Use Class.getDeclaredConstructor().newInstance()
See gh-21913
2020-07-07 11:12:35 +01:00
Andy Wilkinson fbfb7df3e1 Merge branch '2.3.x'
Closes gh-22247
2020-07-07 10:54:00 +01:00
Andy Wilkinson 24e1a1dddf Merge branch '2.2.x' into 2.3.x
Closes gh-22246
2020-07-07 10:53:45 +01:00
Andy Wilkinson a8d3f9af31 Polish "Rename NoneOfNestedConditions to NoneNestedConditions in example docs"
See gh-22207
2020-07-07 10:46:32 +01:00
Clayton Walker 7fee70a625 Rename NoneOfNestedConditions to NoneNestedConditions in example docs
See gh-22207
2020-07-07 10:46:20 +01:00
XenoAmess 7c73ed69e1 Use valueOf rather than parseInt as result is assigned to an int
See gh-22209
2020-07-07 10:26:25 +01:00
XenoAmess 90d8480ffe Use new ArrayList(Collection) rather than new, iterate, and add
See gh-22210
2020-07-07 10:04:13 +01:00
Andy Wilkinson aca609c4c5 Merge branch '2.3.x'
Closes gh-22235
2020-07-06 14:25:13 +01:00
Andy Wilkinson 2007490ce7 Merge branch '2.2.x' into 2.3.x
Closes gh-22234
2020-07-06 14:24:53 +01:00
Andy Wilkinson 4301580095 Improve testing of PropertyPlaceholderAutoConfiguration
Since Spring Framework 4.3.0.RC2, a default embedded value resolver
has been registered with the bean factory when one is not otherwise
configured. This meant that placeholders in `@Value` would be resolved
with or without PropertyPlaceholderAutoConfiguration defining a
PropertySourcesPlaceholderConfigurer bean. However, placeholders in
bean definitions would only be resolved if a
PropertySourcesPlaceholderConfigurer was defined.

This commit updates PropertyPlaceholderAutoConfigurationTests to align
with this change in Framework. We now test that placeholders are
resolved in `@Value` annotations with or without the auto-configuration
and that placeholders in bean definitions are only resolved with the
auto-configured.

Closes gh-22230
2020-07-06 14:24:36 +01:00
Andy Wilkinson ecc50d179d Merge branch '2.3.x'
Closes gh-22198
2020-07-02 10:41:09 +01:00
Andy Wilkinson f6b3666b16 Merge branch '2.2.x' into 2.3.x
Closes gh-22197
2020-07-02 10:40:54 +01:00
Andy Wilkinson 21453b5016 Ignore scoped targets when finding matching beans
Fixes gh-22038
2020-07-02 10:39:56 +01:00
Andy Wilkinson 81d6751ba7 Use ApplicationContextRunner in ConditionalOnSingleCandidateTests 2020-07-02 10:10:28 +01:00
Andy Wilkinson d85774ea77 Merge branch '2.3.x'
Closes gh-22196
2020-07-02 09:32:11 +01:00
Eddú Meléndez 54e0a61b42 Reinstate metrics for Kafka Streams
See gh-21921
2020-07-01 14:03:11 +01:00
Andy Wilkinson 8c341df73b Polish "Add properties to control exceptions ignored by LdapTemplate"
See gh-21289
2020-07-01 10:03:34 +01:00
Filip Hrisafov 6853320661 Add properties to control exceptions ignored by LdapTemplate
See gh-21289
2020-07-01 09:33:39 +01:00
Andy Wilkinson 568f41e8e2 Merge branch '2.3.x'
Closes gh-22176
2020-06-30 17:40:02 +01:00
Andy Wilkinson 0e1ded6893 Merge branch '2.2.x' into 2.3.x
Closes gh-22175
2020-06-30 17:39:52 +01:00
dreis2211 8c0e302f2e Accept empty filter dispatcher types in auto-configurations
Prior to this commit, the usage of EnumSet.copyOf resulted in exceptions when
the underlying collection was empty.

See gh-22138
2020-06-30 17:39:21 +01:00
Andy Wilkinson 6da52a0d08 Suggest iso-offset as value for WebFlux time and date-time properties
Closes gh-22174
2020-06-30 17:35:45 +01:00
Andy Wilkinson 9230ea4ab7 Polish "Support iso-offset for date-time and time formatting with MVC"
See gh-21630
2020-06-30 17:25:16 +01:00
Gaurav Pareek c3b1172aea Support iso-offset for date-time and time formatting with MVC
See gh-21630
2020-06-30 17:05:17 +01:00
Andy Wilkinson bb1a0ffbd5 Merge branch '2.3.x'
Closes gh-22173
2020-06-30 17:02:10 +01:00
Andy Wilkinson 4566ac5c25 Add package info to o.s.b.autoconfigure.elasticsearch.rest
Closes gh-22147
2020-06-30 17:01:21 +01:00
Andy Wilkinson 27c458ca26 Merge branch '2.3.x'
Closes gh-22160
2020-06-30 10:53:49 +01:00
Andy Wilkinson f86831da9c Use TCCL at time of access for resource loading
Fixes gh-22119
2020-06-30 10:51:13 +01:00
Kedar Joshi 6c29b29bd5 Upgrade to Flyway 6.5.0 and support createSchemas
See gh-22120
2020-06-29 09:40:16 +01:00
Andy Wilkinson 7c1a8c1041 Drop back to Spring Security 5.4.0-M1
See gh-21932
2020-06-26 23:11:25 +01:00
Andy Wilkinson a92d64cb80 Start building against Spring Security 5.4.0-M2 snapshots
See gh-21932
2020-06-24 11:36:53 +01:00
Andy Wilkinson 0d6ea79007 Start building against Spring Framework 5.3.0 snapshots
See gh-21929
2020-06-22 18:02:21 +01:00
Andy Wilkinson a0946c8923 Start building against Reactor 2020.0.0 snapshots
See gh-21927
2020-06-22 17:34:56 +01:00
Andy Wilkinson c37fd865c0 Merge branch '2.3.x'
Closes gh-22019
2020-06-19 08:22:48 +01:00
Andy Wilkinson 1e97ff834e Only consider current context when finding lifecycle processor
Previously, LifecycleAutoConfiguration would check the current context
and all of its ancestors for a lifecycle processor bean, only
configuring a custom processor if one was not found. Every context
has a lifecycle processor so this check meant that lifecycle processing
timeout could not be customized in any context with a parent.

This commit updates the auto-configuration to only check the current
context.

Closes gh-22014
2020-06-19 08:19:57 +01:00
Andy Wilkinson 9e08490522 Merge branch 'gh-21271'
Closes gh-21271
2020-06-16 12:52:17 +01:00
Andy Wilkinson 753bea64c6 Enable varargs compilation warnings
See gh-21271
2020-06-16 12:50:53 +01:00
Andy Wilkinson 9636350b0b Enable rawtypes compilation warnings
See gh-21271
2020-06-16 12:50:50 +01:00
Andy Wilkinson 056d5f3120 Enable deprecation compilation warnings
See gh-21271
2020-06-16 12:50:47 +01:00
Andy Wilkinson c64649a6d9 Enable unchecked compilation warnings
See gh-21271
2020-06-16 12:50:44 +01:00
Andy Wilkinson 07fb4b065d Merge branch '2.3.x'
Closes gh-21940
2020-06-16 10:10:38 +01:00
Andy Wilkinson 0de466e06e Require dependency on s-b-dependencies to use its constraints
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
2020-06-16 08:50:21 +01:00
Brian Clozel 33b61e698e Merge branch '2.3.x' 2020-06-15 18:22:05 +02:00
Brian Clozel a480f6e2ee Polish 2020-06-15 18:21:36 +02:00
Brian Clozel e438864ad9 Merge branch '2.3.x'
Closes gh-21925
2020-06-15 18:08:51 +02:00
Brian Clozel af2666df79 Fix welcome page support in WebFlux
Prior to this commit, the welcome page support implemented in gh-9785
would override existing index views in both annotation and functional
variants.

This comes from the fact that the feature was implemented as a
`RouterFunction` configured in the main `RouterFunctionMapping` bean.
Due to ordering issues between mappings, this would override existing
application mappings in some cases.

This commit ensures that the welcome page `RouterFunction` is
contributed to the context in its own handler mapping, ordered after the
application ones.

Fixes gh-21909
2020-06-15 18:03:55 +02:00
Stephane Nicoll 9e2902130c Polish 2020-06-15 16:34:34 +02:00
Stephane Nicoll bf96b0c57b Polish "Add support for webAdminPassword property of H2 Console"
See gh-21533
2020-06-15 16:19:56 +02:00
Radek Koubsky 1d40234737 Add support for webAdminPassword property of H2 Console
See gh-21533
2020-06-15 16:19:40 +02:00
Stephane Nicoll ca44e83279 Merge branch '2.3.x'
Closes gh-21802
2020-06-11 11:22:37 +02:00
Stephane Nicoll ca5afb6e90 Fix flaky integration test
Closes gh-21487
2020-06-11 11:20:49 +02:00
Andy Wilkinson dd93b523a4 Merge branch '2.3.x'
Closes gh-21869
2020-06-10 19:02:29 +01:00
Andy Wilkinson 90bd433083 Allow child contexts to configure server properties
Previously, HttpMessageConvertersAutoConfiguration registered
ServerProperties. When this happened in a parent context, any child
contexts would skip registering ServerProperties due to its presence
in the parent context. This prevents the child contexts from
configuring their own server properties.

This commit updates HttpMessageConvertersAutoConfiguration to
bind server.servlet.encoding directly instead of enabling
ServerProperties. With ServerProperties no longer enabled in a parent
context, child contexts are now able to configure their own server
properties.

Fixes gh-21789
2020-06-10 18:56:57 +01:00
Stephane Nicoll a8da75a396 Merge branch '2.3.x'
Closes gh-21867
2020-06-10 18:13:57 +02:00
Tomek Szmytka 8890660a71 Back-off if a custom ReactiveSessionFactory is defined
This commit makes sure that CassandraReactiveDataAutoConfiguration does
not create a reactiveCassandraSessionFactory bean if the user has
provided their own.

See gh-21769
2020-06-10 18:10:05 +02:00
Andy Wilkinson 3e5fcee187 Upgrade to Spring Security 5.3.3.RELEASE
Closes gh-21863
2020-06-10 17:04:04 +01:00
Stephane Nicoll 6534a9abaf Configure password-based authentication with Cassandra
This commit updates the Cassandra auto-configuration to configure
password-based authentication on the CqlSession directly.

Closes gh-21487
2020-06-10 09:57:47 +02:00
Stephane Nicoll 7fe85750fb Merge branch '2.2.x' into 2.3.x 2020-06-09 16:30:07 +02:00
Stephane Nicoll cc3575b3f4 Merge branch '2.1.x' into 2.2.x 2020-06-09 16:26:44 +02:00
Stephane Nicoll 9a457527fd Polish test 2020-06-09 16:00:50 +02:00
Andy Wilkinson 8155cc5f23 Merge branch '2.2.x' into 2.3.x
Closes gh-21786
2020-06-09 11:02:23 +01:00
Andy Wilkinson a0f29edd4d Always initialize stompWebSocketHandlerMapping eagerly
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
2020-06-09 11:02:02 +01:00
Scott Frederick 73aff08535 Improve tests for BasicErrorController
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
2020-06-08 15:00:55 -05:00
Aurdo e2e52a11cc Fix BasicErrorController include parameter parsing
This commit fixes an error in BasicErrorController where the wrong
property was referenced for binding error inclusion.

See gh-21702
2020-06-08 15:00:55 -05:00
Phillip Webb ddbecf62b3 Polish 'Fix Mustache to not ignore native fetcher'
See gh-21060
2020-06-08 11:10:57 -07:00
Dave Syer 5199c11e37 Fix Mustache to not ignore native fetcher
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
2020-06-08 11:02:04 -07:00
Andy Wilkinson 82b531b49e Merge branch '2.2.x' into 2.3.x 2020-06-08 11:35:53 +01:00
Andy Wilkinson 8da1e3addb Merge branch '2.1.x' into 2.2.x 2020-06-08 11:35:10 +01:00
Andy Wilkinson 6a9450ee8b Polish 2020-06-08 11:34:56 +01:00
Phillip Webb f8982bdc14 Polish 'Support userInfo in elasticsearch URI'
See gh-21381
2020-06-07 11:56:18 -07:00
Evgeniy Cheban a72179aa4f Support userInfo in elasticsearch URI
See gh-21381
2020-06-07 10:38:41 -07:00
Phillip Webb abaca95467 Merge branch '2.2.x' into 2.3.x
Closes gh-21744
2020-06-07 10:27:35 -07:00
Phillip Webb bfe1c281f0 Merge branch '2.1.x' into 2.2.x
Closes gh-21743
2020-06-07 10:25:33 -07:00
Phillip Webb 70e0a27949 Drop the use of the term "white list"
Closes gh-21737
2020-06-07 10:22:35 -07:00
Phillip Webb 0a05b4c9fd Update copyright year of changed files 2020-06-05 15:36:09 -07:00
Stephane Nicoll 400a168ce9 Merge branch '2.2.x' into 2.3.x
Closes gh-21720
2020-06-05 16:41:24 +02:00
dreis2211 9bb22ffb69 Remove usages of deprecated Connector.setAttribute()
See gh-21671
2020-06-05 16:32:42 +02:00
Madhura Bhave 1f28141f3e Use the right property in test 2020-06-01 15:15:53 -07:00
dreis2211 b498d3903f Upgrade to Testcontainers 1.14.2
See gh-21581
2020-05-27 14:49:09 +02:00
Stephane Nicoll 9cf448863a Restore RestClientBuilderCustomizer in its original location
This commit restores RestClientBuilderCustomizer in the rest package in
a deprecated fashion so that the upgrade from 2.2 is smoother.

Closes gh-21572
2020-05-26 16:55:09 +02:00
Toshiaki Maki b4817c85b1 Fix default value for spring.data.jpa.repositories.bootstrap-mode
See gh-21492
2020-05-25 15:11:17 +02:00
Stephane Nicoll b9a1a70fcc Merge branch '2.2.x'
Closes gh-21562
2020-05-25 14:59:19 +02:00
Stephane Nicoll 77981ac2ae Polish "Use the container IP address for tests using TestContainer"
See gh-21480
2020-05-25 14:29:24 +02:00
olivier lamy 0c2bf70bb8 Use the container IP address for tests using TestContainer
See gh-21480
2020-05-25 14:03:18 +02:00
Brian Clozel a12a3054c9 Optimize UrlPathHelper configuration for Spring MVC
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
2020-05-22 18:50:24 +02:00
Brian Clozel 525e03d3b5 Add welcome page support for Spring WebFlux
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
2020-05-22 14:20:06 +02:00
Phillip Webb eb3b0f82a3 Use http liquibase XSDs
Update the lquibase test to use `http://` rather than `https://` so that
it can be resolved from the local jar.
2020-05-14 17:55:10 -07:00
Madhura Bhave 5acd115cb3 Add redis sentinel password property
Closes gh-21353
2020-05-13 16:55:51 -07:00
Phillip Webb 038ae93406 Update copyright year of changed files 2020-05-13 16:48:51 -07:00
Madhura Bhave 4d521e712f Merge branch '2.2.x' 2020-05-13 13:55:44 -07:00
Madhura Bhave 27ada029b5 Revert "Expose property to configure OAuth2 provider configurationMetadata"
This reverts commit 7b79029949.

See gh-21375
2020-05-13 13:53:46 -07:00
Phillip Webb 6a1f61c1bf Merge branch '2.2.x' 2020-05-13 12:23:10 -07:00
Phillip Webb daed512076 Restore getUseRelativeRedirects in deprecated form
Restore the `getUseRelativeRedirects` method with a `Boolean` object
result and introduce `isUseRelativeRedirects` for the primitive boolean
variant.

See gh-20796
2020-05-13 11:36:24 -07:00
Stephane Nicoll a5f826fc78 Fix typo 2020-05-13 15:57:29 +02:00
Madhura Bhave 453ca01338 Merge branch '2.2.x'
Closes gh-21429
2020-05-12 13:43:17 -07:00
Madhura Bhave 7b79029949 Expose property to configure OAuth2 provider configurationMetadata
Closes gh-21375
2020-05-12 13:42:03 -07:00
Andy Wilkinson 0bb687717c Auto-configure a lifecycle processor with configurable timeout
Closes gh-21347
2020-05-12 19:59:52 +01:00
Andy Wilkinson 240898121f Use SmartLifecycle for graceful web server shutdown
Closes gh-21325
2020-05-12 19:59:52 +01:00
Johnny Lim 6022d4cac7 Fix ClientHttpConnectorConfigurationTests.shouldApplyHttpClientMapper()
See gh-21390
2020-05-12 17:13:27 +02:00
Stephane Nicoll deb2322457 Remove wrong replacement key in deprecated metadata 2020-05-12 15:37:50 +02:00
Stephane Nicoll 8c4f185b98 Remove outdated metadata for spring.data.cassandra.port
Closes gh-21418
2020-05-12 09:56:49 +02:00
Scott Frederick 158933c3e5 Improve API of ErrorAttributes and DefaultErrorAttributes
This commit improves the backward-compatibility of the ErrorAttributes
interfaces by providing a default implementation of a new method. It
also encapsulates several parameters that control the inclusion or
exclusion of error attributes into a new ErrorAttributeOptions type to
make it easier and less intrusive to add additional options in the
future. This encapsulation also makes the handling of the
includeException option more similar to other options.

Fixes gh-21324
2020-05-11 15:36:24 -05:00
Stephane Nicoll 09815cc99d Merge branch '2.2.x'
Closes gh-21352
2020-05-07 14:19:41 +02:00
Stephane Nicoll 31f9a965f0 Merge branch '2.1.x' into 2.2.x
Closes gh-21351
2020-05-07 14:12:53 +02:00
Stephane Nicoll 1a4f6df0a3 Upgrade to Spring Ldap 2.3.3.RELEASE
Closes gh-21342
2020-05-07 14:11:24 +02:00
Madhura Bhave 8e7f816f48 Merge branch '2.2.x'
Closes gh-21344
2020-05-06 16:37:25 -07:00
Madhura Bhave 5583f64b1f Add tests to verify Jetty's thread pool defaults match server defaults
Closes gh-21213
2020-05-06 16:35:00 -07:00
Madhura Bhave 01404aa27b Merge branch '2.2.x'
Closes gh-21343
2020-05-06 16:00:24 -07:00
Madhura Bhave f29bce657e Harmonize default for server.tomcat.use-relative-redirects
Prior to this commit, the property was a Boolean with a null default.
If it was explicitly set by the user, a context customizer would use
that value to set it on the context. However, if it was not set, the default
wouldn't be tomcat's default but `false` because it was explicitly set to
`false` in `TomcatServletWebServerFactory`. This commit defaults the property
itself to `false` so that the default is more obvious to the user.

Fixes gh-20796
2020-05-06 15:54:27 -07:00
Phillip Webb d52bf83ab2 Polish 2020-04-30 16:40:05 -07:00
Andy Wilkinson 04c7132eb3 Rename customize to reflect type that it customizes
See gh-20961
2020-04-30 19:43:52 +01:00
dreis2211 dd11b8adba Fix checkstyle violation
See gh-21266
2020-04-30 12:43:51 +02:00
Andy Wilkinson 1abe0f16d0 Apply gridFsDatabase to auto-configured ReactiveGridFsTemplate
Closes gh-18284
2020-04-30 10:46:10 +01:00
Madhura Bhave 6007a71b9c Polish "Add support for customizing RSocketMessageHandler"
See gh-21081
2020-04-29 17:15:09 -07:00
Aarti Gupta 456d6e78fe Add support for customizing RSocketMessageHandler
See gh-21081
2020-04-29 17:11:19 -07:00
Scott Frederick a30740f8d2 Separate server properties for message and errors
Prior to this commit, there was a property server.error.include-details
that allowed configuration of the message and errors attributes in a
server error response.

This commit separates the control of the message and errors attributes
into two separate properties named server.error.include-message and
server.error.include-binding-errors. When the message attribute is
excluded from a servlet response, the value is changed from a
hard-coded text value to an empty value.

Fixes gh-20505
2020-04-29 17:56:47 -05:00
Andy Wilkinson d65d951318 Polish "Add support for customizing Spring Session's cookie serializer"
See gh-20961
2020-04-29 20:53:58 +01:00
Vedran Pavic 32454b83b4 Add support for customizing Spring Session's cookie serializer
This commit introduces a CookieSerializerCustomizer callback that
allows the customization of the auto-configured
DefaultCookieSerializer bean. This is particularly useful for
configuring cookie serializer's capabilities, such as SameSite, that
are not supported by the Servlet API and therefore not exposed via
server.servlet.session.cookie.* properties.

See gh-20961
2020-04-29 20:53:58 +01:00
Stephane Nicoll d16074d8fd Bind and unbind Kafka metrics as consumers and producers come and go
Fixes gh-21008

Co-authored-by: Andy Wilkinson <awilkinson@pivotal.io>
2020-04-29 17:53:08 +01:00
Brian Clozel 692a8c47cc Rename property for registering default Servlet
As a follow-up for gh-21214, this commit renames the property to:

`"server.servlet.register-default-servlet=false"`

Closes gh-21214
2020-04-29 18:42:50 +02:00
Brian Clozel c7c01f8ab4 Add property for registering default Servlet
This commit adds a new configuration property for configuring the
registration of the default Servlet in Servlet containers.

`"server.servlet.default-servlet.registered=false"`

The default of this property is still `true`, as it's been the case in
previous releases.

Closes gh-21214
2020-04-29 18:02:33 +02:00
dreis2211 c1c90b11b8 Fix some deprecations
See gh-21212
2020-04-29 15:10:30 +02:00
Andy Wilkinson d167bb472d Allow base packages to be specified on @AutoConfigurationPackage
Closes gh-19023
2020-04-29 13:00:22 +01:00
Andy Wilkinson d63e492906 Add support for enabling ISO date, time, and date-time formatting
Closes gh-20579
2020-04-29 11:47:33 +01:00
Andy Wilkinson 95e5d4e045 Polish "Enable users to provide custom time and datetime formats"
See gh-18772
2020-04-29 11:46:56 +01:00
Daniel Knittl-Frank 69b51cd64d Enable users to provide custom time and datetime formats
Extend WebFlux and WebMvc properties with timeFormat and
dateTimeFormat properties to allow users to customize format of
LocalTime and LocalDateTime instances.

See gh-18772
2020-04-29 11:46:24 +01:00
Stephane Nicoll 6921fdacac Expand configuration class eager filtering to imports
Previously, only root auto-configuration classes could be excluded
eagerly via an AutoConfigurationImportFilter. Any configuration class
loaded as a result of processing a particular auto-configuration were
parsed and checked as usual.

This commit makes use of the `getExclusionFilter` callback to expand
this filter to all candidates that are considered. The annotation
processor has also be expanded to generate metadata for non-root
configuration classes.

Closes gh-12157
2020-04-29 10:45:28 +02:00
Andy Wilkinson 69a25e4d80 Stop relying on transitive com.nimbusds:oauth2-oidc-sdk dependency 2020-04-29 09:17:57 +01:00
Phillip Webb ad1248e4ec Replace "folder" with "directory"
Consistently use the term "directory" instead of "folder"

Closes gh-21218
2020-04-28 19:20:24 -07:00
Brian Clozel dac62476a0 Merge branch '2.2.x'
Closes gh-21208
2020-04-28 11:33:50 +02:00
Brian Clozel a63ab468a3 Upgrade to RSocket 1.0.0-RC7
This commit upgrades to RSocket 1.0.0-RC7.
This new RC brings API changes we have to adapt to. As of this commit,
we're introducing a new `RSocketServerCustomizer` which replaces the now
deprecated `ServerRSocketFactoryProcessor`.

Closes gh-21046
2020-04-28 11:09:37 +02:00
Brian Clozel b337f67f93 Add ReactorNettyHttpClientMapper
This new customizer-like interface make it possible to configure the
Reactor Netty `HttpClient` that is going to be used by the
`WebClient.Builder` provided by Spring Boot.

Closes gh-21135
2020-04-26 22:10:39 +02:00
dreis2211 5eb5bf0a2d Polish
See gh-21009
2020-04-25 08:54:47 +02:00
Stephane Nicoll 85e9f713b0 Update copyright year of changed files
See gh-21007
2020-04-25 08:50:51 +02:00
Johnny Lim 29717423a3 Remove this keyword on member method invocations
See gh-21007
2020-04-25 08:49:44 +02:00
Andy Wilkinson d5b944140a Attempt to stabilise CouchbaseAutoConfigurationIntegrationTests
Starting the CouchbaseContainer fails intermittently when creation
of the primary index for the bucket fails with a read timeout. The
test doesn't require a primary index for the bucket so this commit
disables it creation in the hope that it will help to stabilise the
test.
2020-04-24 16:21:08 +01:00
Andy Wilkinson dc75ca3942 Avoid capturing TCCL when creating DefaultResourceLoaders
Previously, DefaultResourceLoader instances were created using the
default constructor. This causes the resource loader to capture the
TCCL that was in place at that time. This can lead to a class loader
leak if the resource loader is referenced directly or indirectly from
a static field of a class loaded by a different class loader.

This commit updates the creation of DefaultResourceLoader instances
in main code so that the resource load will use the class loader of
the creating class. In almost all cases this will be the same class
loader as was the thread context class loader that was being captured
so the change in behavior is minimal. Crucially, it will still address
the situation where the TCCL was different.

Note the DevTools' ApplicationContextResourceLoader has been updated
to explicitly use the TCCL. This ensures that it uses the restart
class loader which is required for DevTools to function correctly.

Fixes gh-20900
2020-04-24 13:29:29 +01:00
Andy Wilkinson d53be18582 Deprecate support for Bitronix
Closes gh-20823
2020-04-24 11:37:44 +01:00
Stephane Nicoll ddcd1bc7bb Remove metadata for configuration keys that were removed in 2.0
Closes gh-19706
2020-04-23 16:14:13 +02:00
Stephane Nicoll 623fbcbf8c Polish 2020-04-23 15:20:47 +02:00
Stephane Nicoll 1019dbbc47 Merge branch '2.2.x'
Closes gh-21100
2020-04-23 15:00:22 +02:00
Stephane Nicoll 8ac3ab5551 Add missing metadata for removed configuration keys
Closes gh-20846
2020-04-23 14:39:10 +02:00
Stephane Nicoll 6c02daf2bc Merge branch '2.2.x'
Closes gh-21098
2020-04-23 14:12:37 +02:00
Stephane Nicoll 311952730e Merge branch '2.1.x' into 2.2.x
Closes gh-21097
2020-04-23 14:07:31 +02:00
Stephane Nicoll 291165f060 Order additional metadata according to lexicographic order
Closes gh-21095
2020-04-23 13:58:49 +02:00
Phillip Webb 56711d678a Merge branch '2.2.x'
Closes gh-21083
2020-04-22 11:59:22 -07:00
Phillip Webb 102729b5e1 Merge branch '2.1.x' into 2.2.x
Closes gh-21082
2020-04-22 11:58:39 -07:00
Phillip Webb b3d33754a5 Remove outdated FIXMEs from tests
Closes gh-19782
2020-04-22 11:55:35 -07:00
Phillip Webb bf41da5322 Update copyright year of changed files 2020-04-21 18:12:27 -07:00
Phillip Webb e83c3b87c0 Merge branch '2.2.x'
Closes gh-21071
2020-04-21 11:45:05 -07:00
Phillip Webb 7d0b14fe1c Merge branch '2.1.x' into 2.2.x
Closes gh-21070
2020-04-21 11:43:09 -07:00
Phillip Webb 6011470ba6 Auto-configure cors on WelcomePageHandlerMapping
Update `WebMvcAutoConfiguration` to automatically apply cors
configuration to the `WelcomePageHandlerMapping`.

Fixes gh-21048
2020-04-21 11:40:26 -07:00
Stephane Nicoll e26f3e2a65 Review Cassandra's timeout options
This commit reviews the current timeout options. It creates a connection
and request sub-namespace to separate concerns a bit more.

Closes gh-19673
2020-04-21 17:29:38 +02:00
Brian Clozel f103966743 Polish
See gh-20994
2020-04-21 15:51:11 +02:00
Vedran Pavic f701d97b92 Improve Elasticsearch RestClient customization capabilities
At present, RestClientBuilderCustomizer allows general customization of RestClientBuilder.
This is troublesome for users that want to customize `HttpAsyncClientBuilder` and
`RequestConfig.Builder` since those are set on the `RestClientBuilder`. By customizing
those two builders user lose out on Spring Boot's support for binding username, password,
connection-timeout and read-timeout properties from `"spring.elasticsearch.rest"` namespace.

This commit enhances the `RestClientBuilderCustomizer` with support for customizing
`HttpAsyncClientBuilder` and `RequestConfig.Builder` by providing additional `customize`
methods that accept the aforementioned builders. Both new methods are optional as they have
no-op default implementations.

See gh-20994
2020-04-21 15:50:59 +02:00
Andy Wilkinson 3605235c67 Merge branch '2.2.x'
Closes gh-21041
2020-04-20 17:12:47 +01:00
Andy Wilkinson 439d9beecb Test that gridFsDatabase is honored by auto-configured GridFsTemplate
Closes gh-21039
2020-04-20 17:09:37 +01:00
Stephane Nicoll 415dcd899d Configure Cassandra's request throttling
Closes gh-19674
2020-04-20 15:56:09 +02:00
Stephane Nicoll 8787e749c4 Add IsolationLevel regression test with Kafka 2.4
This commit makes sure that our copy of the IsolationLevel enum is
consistent with what Kafka 2.4 provides

Closes gh-20822
2020-04-20 14:54:09 +02:00
Stephane Nicoll 2c72350cd8 Upgrade to Kafka 2.5.0
Closes gh-21032
2020-04-20 12:33:33 +02:00
Stephane Nicoll 6a8aaa7b99 Merge branch '2.2.x'
Closes gh-21017
2020-04-19 16:37:06 +02:00
Stephane Nicoll 90c0378a7d Apply configuration properties deprecation consistently
This commit makes sure that both the getter and the setter of a
deprecated configuration properties is flagged with `@Deprecated`.

Closes gh-20812
2020-04-19 16:35:16 +02:00
Stephane Nicoll 5afe4743cb Remove deprecated configuration properties
This commit removes the following deprecated properties:

* `server.connection-timeout`
* `server.use-forward-headers`
* `server.jetty.max-http-post-size`
* `server.tomcat.max-http-post-size`

Closes gh-20991
2020-04-19 15:49:05 +02:00
Phillip Webb e3b8478621 Polish 2020-04-17 16:12:11 -07:00
Phillip Webb dc56608651 Merge branch '2.2.x'
Closes gh-21004
2020-04-17 15:20:38 -07:00
Phillip Webb 1a8aa72afd Merge branch '2.1.x' into 2.2.x
Closes gh-21003
2020-04-17 15:19:45 -07:00
Phillip Webb 822d9f6a31 Allow empty URIs to create embedded datasource
Refine `DataSourceAutoConfiguration` conditions so that an empty
`spring.datasource.url` property can be used to enable the embedded
source.

Fixed gh-20996
2020-04-17 15:07:50 -07:00
K Zoli 0d532042cb Use RequestDispatcher.ERROR_STATUS_CODE constant
See gh-20923
2020-04-17 16:01:11 +02:00
Scott Frederick 1caca6e3d0 Deprecate unused ErrorController interface method
This commit marks as deprecated an interface method that is no longer
used, and changes all internal implementations to return `null` to
make the fact that the return value is not used more obvious.

Fixes gh-19844
2020-04-16 16:50:03 -05:00
Scott Frederick 70d4994502 Disable exception details on default error views
Prior to this commit, default error responses included the message
from a handled exception. When the exception was a BindException, the
error responses could also include an errors attribute containing the
details of the binding failure. These details could leak information
about the application.

This commit removes the exception message and binding errors detail
from error responses by default, and introduces a
`server.error.include-details` property that can be used to cause
these details to be included in the response.

Fixes gh-20505
2020-04-16 10:46:36 -05:00
Stephane Nicoll 71ecadeaee Polish "Optimize AutoConfigurationImportSelector.filter()"
See gh-20928
2020-04-16 14:13:05 +02:00
dreis2211 2158fadb35 Optimize AutoConfigurationImportSelector.filter()
See gh-20928
2020-04-16 14:12:56 +02:00
Stephane Nicoll 04544f9842 Polish 2020-04-15 15:11:28 +02:00
dreis2211 5b9d8bfc17 Upgrade to Testcontainers 1.14.0
See gh-20936
2020-04-15 09:20:31 +02:00
Stephane Nicoll 17e5b08cba Polish 2020-04-15 09:09:27 +02:00
Stephane Nicoll 8fa6ec36f4 Remove @ConditionalOnMissingBean check on deprecated class
Closes gh-20968
2020-04-15 08:49:37 +02:00
Phillip Webb bb79c847b2 Allow custom availability states
Create a general purpose `AvailabilityState` interface and refactor
the existing `LivenessState` and `ReadinessState` to use it. A single
`AvailabilityChangeEvent` is now used to carry all availability state
updates.

This commit also renames `ApplicationAvailabilityProvider` to
`ApplicationAvailabilityBean` and extracts an `ApplicationAvailability`
interface that other beans can inject. The helps to hide the event
listener method, which is really internal.

Finally the state enums have been renamed as follows:

 - `LivenessState.LIVE` -> `LivenessState.CORRECT`
 - `ReadinessState.READY` -> `ReadinessState.ACCEPTING_TRAFFIC`
 - `ReadinessState.UNREADY` -> `ReadinessState.REFUSING_TRAFFIC`

See gh-20962
2020-04-14 16:40:36 -07:00
Johnny Lim cb320288a4 Polish
See gh-20931
2020-04-13 14:35:21 +02:00
Stephane Nicoll 73ca703007 Merge branch '2.2.x'
Closes gh-20919
2020-04-11 10:28:43 +02:00
Stephane Nicoll 60f726a080 Polish 2020-04-11 10:27:05 +02:00
Stephane Nicoll 3cdb5a690a Polish "Align Kafka's missingTopicsFatal default value"
See gh-20917
2020-04-11 10:20:09 +02:00
dhimathu a12eace2a8 Align Kafka's missingTopicsFatal default value
See gh-20917
2020-04-11 10:03:21 +02:00
Vedran Pavic fec386b574 Harmonize naming of Elasticsearch auto-configuration classes 2020-04-11 10:00:42 +02:00
Brian Clozel 0611b6d3eb Fix startup failure when WebFlux auto-config is skipped
Prior to this commit, the `HttpHandlerAutoConfiguration` would rely on
the `WebFluxProperties` bean being present - this is most of the time
true when the appplication is using the WebFlux auto-configuration.

If the application is overriding the WebFlux auto-configuration and
providing its own setup, the properties bean is not present and we
should skip its usage.

Fixes gh-20891
2020-04-10 14:16:16 +02:00
Madhura Bhave 1342e4970a Provide a condition for detecting war deployments
Closes gh-19421
2020-04-09 18:52:06 -07:00
Phillip Webb ed2d90248c Rename `singleSignOn` property to `singlesignon`
Rename the SAML `singleSignOn` nested property to `singleSignOn` so
that we don't get problems when using uppercase environment variable
names.

See gh-20584
2020-04-07 14:14:58 -07:00
Phillip Webb 3ca896e63f Polish 2020-04-07 12:10:49 -07:00
Stephane Nicoll 885ad1b720 Merge branch '2.2.x'
Closes gh-20868
2020-04-07 15:05:47 +02:00
dreis2211 2f93196fbb Polish ConditionMessage#because()
See gh-20847
2020-04-07 15:04:50 +02:00
Stephane Nicoll 5c69534827 Remove direct dependency on Kafka's IsolationLevel
Closes gh-20811
2020-04-03 16:27:40 +02:00
Stephane Nicoll f963180ab8 Polish 2020-04-03 10:05:05 +02:00
Madhura Bhave 577bc1ce88 Fix formatting 2020-04-02 21:51:49 -07:00
Madhura Bhave c2e95ee7ee Support both JWT and Opaque token configuration for resource server
Closes gh-19426
2020-04-02 19:16:34 -07:00
Madhura Bhave 8659102650 Add configuration options for SAML authentication requests
Closes gh-20584
2020-04-02 13:19:56 -07:00
Brian Clozel bbbf8c527d Polish
See gh-20205
2020-04-02 15:16:54 +02:00
wonwoo a7e57e0909 Configure codec buffer size in ES Reactive Rest client
This commit adds a new configuration property
`"spring.data.elasticsearch.client.reactive.max-in-memory-size"`
which configures the maximum amount of memory buffered by the
`WebClient` used by the Reactive ElasticSearch client.

See gh-20205
2020-04-02 15:14:38 +02:00
Stephane Nicoll 617786e06f Polish "Disable Hazelcast auto-configuration when Jet is present"
See gh-20729
2020-04-01 15:46:42 +02:00
Ali Gurbuz 002a7c6e87 Disable Hazelcast auto-configuration when Jet is present
See gh-20729
2020-04-01 15:30:14 +02:00
Stephane Nicoll dfac3a282b Add configuration to enable Redis Cluster topology refresh
This commit adds two options to enable a refresh of the cluster
topology using Lettuce.

Closes gh-15630
2020-04-01 14:31:29 +02:00
Stephane Nicoll 0616ecfa5c Make sure Liquibase works with only spring-jdbc on the classpath
This commit improves the Liquibase auto-configuration to only rely on
spring-jdbc when a `DataSource` should be created on-the-fly for the
purpose of its initialization.

Previously, a connection pool implementation must be added as well, now
we're fallbacking on `SimpleDriverDataSource` if necessary. This
improves the database initialization use case with R2DBC.

Closes gh-20715
2020-03-31 13:10:37 +02:00
Andy Wilkinson c282f76633 Merge branch '2.2.x'
Closes gh-20741
2020-03-31 11:59:22 +01:00
dreis2211 798e21fd3e Polish GroovyTemplateAutoConfiguration
See gh-20708
2020-03-31 11:58:49 +01:00
Stephane Nicoll fd05bc2a4a Expose MongoDB's replica set name
Closes gh-20391
2020-03-30 15:39:24 +02:00
Stephane Nicoll 722d37468b Rationalize RabbitProperties
Closes gh-18830
2020-03-30 15:04:52 +02:00
dreis2211 674f1e77b5 Fix typos
See gh-20704
2020-03-28 08:42:59 +01:00
Stephane Nicoll 7a64b3f761 Restore Cassandra port option
This commit restores the port option that was removed in an earlier
milestone. Contact points that do not define a port already are
automatically transformed to include the one configured, with a default
matching Cassandra's default port.

This makes upgrades easier in the case a cluster uses consistent ports
everywhere.

Closes gh-19672
2020-03-27 12:20:40 +01:00
Madhura Bhave b66ca0016a Merge branch '2.2.x' 2020-03-26 16:35:01 -07:00
Madhura Bhave 042a02e0da Update copyright of changed files 2020-03-26 16:34:52 -07:00
Madhura Bhave 3ad1aa7b32 Merge branch '2.2.x'
Closes gh-20694
2020-03-26 16:23:00 -07:00
Anastasiia Losieva a55c3e4ab7 Use jws-algorithm property in ReactiveOAuth2ResourceServerJwkConfiguration
See gh-20681
2020-03-26 16:20:31 -07:00
Stephane Nicoll ff15d136db Merge branch '2.2.x'
Closes gh-20687
2020-03-26 10:42:31 +01:00
Stephane Nicoll ab01c55d8e Deprecate use of path extensions for request mapping and content negotiation
Closes gh-20528
2020-03-26 10:41:08 +01:00
Stephane Nicoll b3517a0771 Merge branch '2.2.x'
Closes gh-20671
2020-03-25 11:37:44 +01:00
Stephane Nicoll 009361d38c Merge branch '2.1.x' into 2.2.x
Closes gh-20670
2020-03-25 11:34:51 +01:00
Stephane Nicoll 18353231a0 Do not fail if "spring.datasource.url" cannot be resolved
Previously, a condition checked the value of "spring.datasource.url" to
determine if an embedded database has to be created as a fallback. When
the value is set with an unresolved placeholder, this fails even if
the DataSource is going to created by another mean ultimately.

This commit makes a more conservative check by only checking the
presence of the property rather than its value.

Closes gh-20438
2020-03-25 11:25:47 +01:00
Brian Clozel 87de8a5e15 Fix checkstyle issue 2020-03-24 23:11:05 +01:00
Brian Clozel cbe83f8db5 Make base path configurable for WebFlux applications
This commit adds the `"spring.webflux.base-path"` configuration
property. Configuring this property will gather all `HttpHandlers` into
a single composite and prefix all requests with a shared base path.

Closes gh-10129
2020-03-24 22:19:19 +01:00
Stephane Nicoll 97bf3ecf1c Polish "Migrate off deprecated Spring Data Cassandra API"
See gh-20662
2020-03-24 18:28:33 +01:00
Mark Paluch 8355d30456 Migrate off deprecated Spring Data Cassandra API
Configure UserTypeResolver and CodecRegistry on
MappingCassandraConverter. Configure on CassandraMappingContext only the
simple type holder instead of custom conversions.

See gh-20662
2020-03-24 18:28:33 +01:00
Phillip Webb 9a33a723fe Update copyright year of changed files 2020-03-23 14:15:08 -07:00
Phillip Webb 16b5ea3414 Update copyright year of changed files 2020-03-23 14:13:33 -07:00
Stephane Nicoll 1a9065f46f Merge branch '2.2.x'
Closes gh-20621
2020-03-23 14:38:03 +01:00
Stephane Nicoll 8f265f8d57 Polish "Fix @FlywayDataSource with multiple data sources"
See gh-20617
2020-03-23 14:37:23 +01:00
Shimbo Takaaki 2410d6bbd1 Fix @FlywayDataSource with multiple data sources
See gh-20617
2020-03-23 14:25:57 +01:00
Stephane Nicoll ec8d2c5843 Merge branch '2.2.x'
Closes gh-20616
2020-03-23 12:57:00 +01:00
Stephane Nicoll 39b965e1fd Merge branch '2.1.x' into 2.2.x
Closes gh-20615
2020-03-23 12:55:44 +01:00
Stephane Nicoll f5761bd508 Auto-configure listener container factory without consumer factory
Previously, the presence of a `ConsumerFactory` bean would make the
auto-configured one to back off, leading to a failure down the line if
no available instance matches the generics criterion. This commit
improves the auto-configuration to create a `ConsumerFactory<?,?>`
behind the scenes if none is available.

Closes gh-19221
2020-03-23 12:52:33 +01:00
Stephane Nicoll 3735771f9c Merge branch '2.2.x'
Closes gh-20612
2020-03-23 11:17:52 +01:00
Stephane Nicoll 08a89b6288 Polish "Configure signature algorithm when using public key jwt decoder"
See gh-20523
2020-03-23 11:17:22 +01:00
Michael Kreis 69e33d6e62 Configure signature algorithm when using public key jwt decoder
See gh-20523
2020-03-23 10:56:59 +01:00
dreis2211 ef9f1d39a3 Remove redundant MockitoAnnotations.initMocks()
See gh-20601
2020-03-22 08:43:50 +01:00
Brian Clozel ffdf9a422f Polish Liveness and Readiness support
This commit moves the core Liveness and Readiness support to its own
`availability` package. We've made this a core concept independent of
Kubernetes.

Spring Boot now produces `LivenessStateChanged` and
`ReadinessStateChanged` events as part of the typical application
lifecycle.

Liveness and Readiness Probes (`HealthIndicator` components and health
groups) are still configured only when deployed on Kubernetes.

This commit also improves the documentation around Probes best practices
and container lifecycle considerations.

See gh-19593
2020-03-20 23:54:00 +01:00
Stephane Nicoll 579a6ac254 Adapt tests for support for Java 14
See gh-20576
2020-03-19 14:54:33 +01:00
Brian Clozel fd0b2f6695 Add Kubernetes Liveness and Readiness Probes support
Prior to this commit and as of Spring Boot 2.2.0, we would advise
developers to use the Actuator health groups to define custom "liveness"
and "readiness" groups and configure them with subsets of existing
health indicators.

This commit addresses several limitations with that approach.

First, `LivenessState` and `ReadinessState` are promoted to first class
concepts in Spring Boot applications. These states should not only based
on periodic health checks. Applications should be able to track changes
(and adapt their behavior) or update states (when an error happens).

The `ApplicationStateProvider` can be injected and used by applications
components to get the current application state. Components can also
track specific `ApplicationEvent` to be notified of changes, like
`ReadinessStateChangedEvent` and `LivenessStateChangedEvent`.
Components can also publish such events with an
`ApplicationEventPublisher`. Spring Boot will track startup event and
application context state to update the liveness and readiness state of
the application. This infrastructure is available in the
main spring-boot module.

If Spring Boot Actuator is on the classpath, additional
`HealthIndicator` will be contributed to the application:
`"LivenessProveHealthIndicator"` and `"ReadinessProbeHealthIndicator"`.
Also, "liveness" and "readiness" Health groups will be defined if
they're not configured already.

Closes gh-19593
2020-03-19 14:11:00 +01:00
Stephane Nicoll 5893786cbb Polish "Add 'threads' configuration group for embedded containers"
See gh-19475
2020-03-19 13:13:45 +01:00
cbono 208f58104a Add 'threads' configuration group for embedded containers
See gh-19475
2020-03-19 12:12:11 +01:00
dreis2211 7924dd62b0 Add security.protocol to KafkaProperties
See gh-20360
2020-03-19 10:36:20 +01:00
Stephane Nicoll f470f27666 Merge branch '2.2.x'
Closes gh-20549
2020-03-17 18:15:19 +01:00
dreis2211 d9171d0afe Use @Configuration(proxyBeanMethods=false) wherever possible
See gh-20541
2020-03-17 17:17:38 +01:00
Stephane Nicoll 58eb0ba4d3 Add additional timeout settings
This commit expands the `spring.couchbase.env.timeouts` configuration
namespace with timeouts for disconnect, key-value operations with a
durability level, search, analytics and management.

Closes gh-19893

Co-authored-by: Michael Nitschinger <michael@nitschinger.at>
2020-03-17 17:00:34 +01:00
Stephane Nicoll abe43b2e83 Upgrade to Couchbase SDK v3
This commit upgrades to the Couchbase SDK v3 which brings the following
breaking changes:

* Bootstrap hosts have been replaced by a connection string and the
authentication is now mandatory.
* A `Bucket` is no longer auto-configured. The
`spring.couchbase.bucket.*` properties have been removed
* `ClusterInfo` no longer exists and has been replaced by a dedicated
API on `Cluster`.
* `CouchbaseEnvironment` no longer exist in favour of
`ClusterEnvironment`, the customizer has been renamed accordingly.
* The bootstrap-related properties have been removed. Users requiring
custom ports should supply the seed nodes and initialize a Cluster
themselves.
* The endpoints-related configuration has been consolidated in a
single IO configuration.

The Spring Data Couchbase provides an integration with the new SDK. This
leads to the following changes:

* A convenient `CouchbaseClientFactory` is auto-configured.
* Repositories are configured against a bucket and a scope. Those can
be set via configuration in `spring.data.couchbase.*`.
* The default consistency property has been removed in favour of a more
flexible annotation on the repository query methods instead. You can now
specify different query consistency on a per method basis.
* The `CacheManager` implementation is provided, as do other stores for
consistency so a dependency on `couchbase-spring-cache` is no longer
required.

See gh-19893

Co-authored-by: Michael Nitschinger <michael@nitschinger.at>
2020-03-17 17:00:09 +01:00
Stephane Nicoll e3899df22c Configure Spring Data Couchbase explicitly
This commit configures Spring Data Couchbase explicitly rather than
relying on the abstract configuration class. This has the advantage of
simplifying the auto-configuration and let it us proxy-free
configuration classes.

Spring Boot no longer uses or interacts with CouchbaseConfigurer. Users
relying on that to teach Spring Boot which components to use should
rely on `@Primary` flag instead in case of multiple beans of the same
type.

`CouchbaseConfiguration` is no longer public as extending from it is
no longer necessary. If the `CouchbaseEnvironment` has to be
customized, a `CouchbaseEnvironmentBuilderCustomizer` bean can be
registered to tune the auto-configured environment.

Closes gh-20533
2020-03-17 16:20:21 +01:00
dreis2211 5975e7bd8d Fix some deprecation warnings
See gh-20527
2020-03-15 16:33:47 +01:00
Andy Wilkinson 77dbe999b9 Polish "Add clearChecksums to Liquibase auto-configuration"
See gh-20417
2020-03-11 17:14:38 +00:00
ferengra a2680efadb Add clearCheckSums to Liquibase auto configuration
Liquibase auto configuration is extended with clearCheckSums to allow
to clear all checksums in the current changelog, so they will be
recalculated upon the next update.

See gh-20417
2020-03-11 17:11:43 +00:00
Andy Wilkinson c917b61484 Reinstate leading / in default value for spring.liquibase.change-log
Unfortunately, while redundant for new applications, removing the
leading slash adversely affected existing application upon upgrades as
it caused Liquibase to re-apply every change log.

Closes gh-20177
2020-03-10 21:22:27 +00:00
Andy Wilkinson d2ebd77861 Upgrade to Flyway 6.3.0
Closes gh-20445
2020-03-10 15:38:45 +00:00
Andy Wilkinson 308e1d3675 Add support for gracefully shutting down the web server
This commit adds support for gracefully shutting down the embedded
web server. When a grace period is configured
(server.shutdown.grace-period), upon shutdown, the web server will no
longer permit new requests and will wait for up to the grace period
for active requests to complete.

Closes gh-4657
2020-03-09 18:12:20 +00:00
dreis2211 9481f2c68d Remove hardcoded version from VersionOverridingElasticsearchContainer
See gh-20428
2020-03-09 18:33:47 +01:00
dreis2211 6036df5f33 Upgrade to Elasticsearch 7.6.1
See gh-20423
2020-03-08 13:30:06 +01:00
Stephane Nicoll e5394ceac2 Polish "Handle new Annotation.toString() behaviour in JDK 14"
See gh-20180
2020-03-07 16:55:02 +01:00
dreis2211 e22aca85e9 Handle new Annotation.toString() behaviour in JDK 14
See gh-20180
2020-03-07 16:34:40 +01:00
Stephane Nicoll 89805fdb61 Fix checkstyle violations 2020-03-04 15:04:47 +01:00
Stephane Nicoll aa4dad1d73 Polish "Allow Embedded directory to be used without spring-data-ldap"
See gh-20223
2020-03-04 14:46:04 +01:00
Frank Schmager a92c57c07d Allow Embedded directory to be used without spring-data-ldap
See gh-20223
2020-03-04 10:09:34 +01:00
Brian Clozel ea45d8ef25 Fix "spring.integration.rsocket" canonical name
See gh-18834
2020-03-03 15:50:43 +01:00
Artem Bilan 3967e76b9b Auto-Configure RSocket support for Spring Integration
This commit adds a new auto-configuration for RSocket support in Spring
Integration.

Given an application with `spring-messaging`, `spring-integration-rsocket`
and RSocket dependencies, developers are now able to leverage Spring
Integration features with RSocket.

It is now possible to configure an RSocket server with
`"spring.rsocket.server.*"` properties and let it use
`IntegrationRSocketEndpoint` or `RSocketOutboundGateway` components to
handle incoming RSocket messages. This infrastructure can handle Spring
Integration RSocket channel adapters and `@MessageMapping` handlers
(given `"spring.integration.rsocket.server.message-mapping-enabled"`is
configured.

If the `"spring.integration.rsocket.client.host"` and
`"spring.integration.rsocket.client.port"` (for TCP protocol), or
`"spring.integration.rsocket.client.uri"`  (for WebSocket) is configured
then a `ClientRSocketConnector` will be configured accordingly.

Closes gh-18834

Co-authored-by: Brian Clozel <bclozel@pivotal.io>
2020-03-03 15:15:24 +01:00
Johnny Lim 98738d22f4 Polish tests
See gh-20318
2020-02-28 09:36:19 -05:00
Stephane Nicoll 19fbac7d59 Add auto-configuration for Spring Data R2DBC
This commit adds auto-configuration support for Spring Data R2DBC. If a
`ConnectionFactory` and Spring Data are available, scanning of reactive
repositories is enabled.

This commit also adds a starter to bring R2DBC and the necessary Spring
Data libraries.

See gh-19988

Co-authored-by: Mark Paluch <mpaluch@pivotal.io>
Co-authored-by: Oliver Drotbohm <odrotbohm@pivotal.io>
2020-02-25 09:14:08 -05:00
Stephane Nicoll 5c174feb65 Add auto-configuration for R2DBC's ConnectionFactory
This commit adds auto-configuration for R2DBC. If R2DBC is on the
classpath, a `ConnectionFactory` is created similarly to the algorithm
used to create a `DataSource`.

If an url is specified, it is used to determine the R2DBC driver and
database location. If not, an embedded database is started (with only
support of H2 via r2dbc-h2). If none of those succeed, an exception is
thrown that is handled by a dedicated FailureAnalyzer.

To clearly separate reactive from imperative access, a `DataSource` is
not auto-configured if a `ConnectionFactory` is present. This makes sure
that any auto-configuration that relies on the presence of a
`DataSource` backs off.

There is no dedicated database initialization at the moment but it is
possible to configure flyway or liquibase to create a local `DataSource`
for the duration of the migration. Alternatively, if Spring Data R2DBC
is on the classpath, a `ResourceDatabasePopulator` bean can be defined
with the scripts to execute on startup.

See gh-19988

Co-authored-by: Mark Paluch <mpaluch@pivotal.io>
2020-02-25 09:12:28 -05:00
Stephane Nicoll 402eb87847 Upgrade to Tomcat 9.0.31
Closes gh-20277
2020-02-21 14:33:22 +01:00
Stephane Nicoll a7f3b801ae Upgrade to Sendgrid 4.4.5
Closes gh-20268
2020-02-21 14:33:15 +01:00
Stephane Nicoll a039f6328d Start building against Spring Framework 5.2.4 snapshots
See gh-20240
2020-02-20 14:29:15 +01:00
Stephane Nicoll 67d2258e76 Start building against Spring Framework 5.2.4 snapshots
See gh-20199
2020-02-20 14:24:55 +01:00
Scott Frederick 8f84dbe3cf Harmonize MongoDB client factories
This commit brings MongoClientFactory and ReactiveMongoClientFactory
into functional alignment and reduces duplication in the classes
and their tests.

There are no behavior changes to ReactiveMongoClientFactory.
MongoClientFactory now throws an exception when a URI is configured
along with a host, port, or credentials, where it previousy ignored
host, port, and credentials silently. MongClientFactory now also
supports MongoClientSettingsBuilderCustomizers.

Fixes gh-20019
2020-02-19 10:15:40 -06:00
Stephane Nicoll d65e06081f Update copyright year of changed files
See gh-20226
2020-02-19 09:35:28 +01:00