Commit Graph

2251 Commits

Author SHA1 Message Date
Andy Wilkinson a580e3a370 Merge branch '2.2.x' into 2.3.x
Closes gh-22641
2020-07-29 14:10:25 +01:00
Andy Wilkinson 72551242fd Allow XADataSource auto-config with no spring.datasource properties
Fixes gh-20229
2020-07-29 13:57:50 +01:00
Andy Wilkinson d0c75aef19 Merge branch '2.2.x' into 2.3.x
Closes gh-22580
2020-07-27 11:29:14 +01:00
Andy Wilkinson 16eaae0b2f Defer background pre-init till the environment is prepared
Previously, background pre-init was started in response to the
application starting event. This meant that it would be running while
the logging turbo filter was in place and was rejecting all logging.
As a result, any logging performed during pre-init would be lost.

This commit changes background pre-init so that it is now started
in response to the application environment prepared event. By this
point, the logging turbo filter has been removed as the logging levels
have been configured from the environment.

Closes gh-21897
2020-07-27 11:24:36 +01:00
Andy Wilkinson f0d90020e5 Merge branch '2.2.x' into 2.3.x
Closes gh-22578
2020-07-27 10:57:58 +01:00
Andy Wilkinson b98c3dccfd Fix property-based configuration of Undertow socket options
Previously, only UndertowOptions was used as the source of options for
both server and socket options, but it only contains server options.
As a result, attempting to configure any socket options defined by
XNIO's Options class would fail.

This commit updates the property-based configuration of options to use
UndertowOptions as the source for server options and XNIO's Options as
the source for socket options.

Fixes gh-22502
2020-07-27 10:47:14 +01:00
Stephane Nicoll 6b32e62142 Fix CacheAutoConfiguration relative order for Couchbase
This commit fixes the auto-configuration of the Couchbase caching
support by configuring the cache once Spring Data Couchbase has gotten
a chance to be processed.

Closes gh-22542
2020-07-26 17:24:24 +02:00
Andy Wilkinson c605a6e34b Override other variant of registerBeanDefintions
Fixes gh-22480
2020-07-24 10:33:16 +01:00
Phillip Webb 187d3af7fc Update copyright year of changed files 2020-07-22 17:25:17 -07:00
Phillip Webb 217b2eff89 Merge branch '2.2.x' into 2.3.x 2020-07-22 17:03:23 -07:00
Phillip Webb b5e70157dc Update copyright year of changed files 2020-07-22 17:01:36 -07:00
Andy Wilkinson f88038f00d Upgrade to Couchbase Client 3.0.6
Closes gh-22456
2020-07-21 13:37:19 +01:00
dreis2211 267283e3cd Handle null items as advertized in the Javadoc
See gh-22344
2020-07-16 14:17:53 +02: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
dreis2211 de30e5c6ac Avoid unnecessary allocations in ConditionMessage for NORMAL style
See gh-22330
2020-07-14 18:12:17 +02:00
Stephane Nicoll 603e65a629 Polish 2020-07-14 16:57:42 +02: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 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 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 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
Andy Wilkinson 1b85ce0769 Streamline OAuth2 resource server auto-config class conditions
Fixes gh-22233
2020-07-07 12:22:27 +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
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
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 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
Eddú Meléndez 54e0a61b42 Reinstate metrics for Kafka Streams
See gh-21921
2020-07-01 14:03:11 +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 4566ac5c25 Add package info to o.s.b.autoconfigure.elasticsearch.rest
Closes gh-22147
2020-06-30 17:01:21 +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
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 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 a480f6e2ee Polish 2020-06-15 18:21:36 +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 ca5afb6e90 Fix flaky integration test
Closes gh-21487
2020-06-11 11:20:49 +02: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
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