Commit Graph

1716 Commits

Author SHA1 Message Date
Madhura Bhave 06d870bdd0 Do not wrap CF JSON Keys containing special characters
This reverts commit 6828a15d31.
The commit has been reverted as it breaks backwards compatiblity.

Fixes gh-20343
2020-03-09 15:56:48 -07:00
Andy Wilkinson 6ec3865ed0 Polish spelling of elapsed
See gh-4657
2020-03-09 18:41:27 +00:00
Andy Wilkinson da06b38117 Polish
See gh-4657
2020-03-09 18:36:04 +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
Stephane Nicoll fa8a09d46d Merge branch '2.2.x'
Closes gh-20395
2020-03-05 10:31:17 +01:00
dreis2211 f08a9db984 Fix some deprecations
See gh-20388
2020-03-05 10:24:49 +01:00
dreis2211 9588188800 Use isEmpty() where possible
See gh-20370
2020-03-03 18:33:26 -05:00
Madhura Bhave 5bf1f7641b Merge branch '2.2.x' 2020-02-26 17:08:59 -08:00
Madhura Bhave ea8f2a7276 Fix tests following changes to EndpointRequest
See gh-20329
2020-02-26 17:05:16 -08:00
Madhura Bhave db1d923ad8 Merge branch '2.2.x' 2020-02-24 15:04:35 -08:00
Madhura Bhave 42bb56c1ba Merge branch '2.1.x' into 2.2.x 2020-02-24 15:04:24 -08:00
Madhura Bhave 88ee50601d Update copyright of changed files 2020-02-24 15:03:38 -08:00
Madhura Bhave 65c6f32428 Merge branch '2.2.x'
Closes gh-20307
2020-02-24 15:02:14 -08:00
Madhura Bhave 368a77f355 Merge branch '2.1.x' into 2.2.x
Closes gh-20306
2020-02-24 15:01:38 -08:00
Madhura Bhave 0957168626 Binding to collection of custom objects should not fail with unbound error
Fixes gh-20134
2020-02-24 14:48:10 -08:00
Stephane Nicoll 402eb87847 Upgrade to Tomcat 9.0.31
Closes gh-20277
2020-02-21 14:33:22 +01:00
Stephane Nicoll ac41bcbb66 Upgrade to Tomcat 9.0.31
Closes gh-20253
2020-02-21 14:17:30 +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
Stephane Nicoll d65e06081f Update copyright year of changed files
See gh-20226
2020-02-19 09:35:28 +01:00
Johnny Lim 8be8a8421d Polish
See gh-20226
2020-02-19 09:34:46 +01:00
Mustafa Ulu 2760426db0 Polish log4j2 configuration
See gh-20225
2020-02-19 09:18:41 +01:00
Stephane Nicoll 4ec30e1145 Add support for SimpleDriverDataSource
This commit makes sure that DataSourceBuilder can configure
SimpleDriverDataSource by adding an alias for the driver's class name.

Closes gh-20220

Co-authored-by: Dmytro Nosan <dimanosan@gmail.com>
2020-02-18 17:23:14 +01:00
Stephane Nicoll b56c4f1a4d Polish "Add support for configuring Jetty's backing queue"
See gh-19494
2020-02-14 14:54:28 +01:00
cbono 852734b129 Add support for configuring Jetty's backing queue
See gh-19494
2020-02-14 14:01:06 +01:00
Andy Wilkinson 09fa8255cd Upgrade to Tomcat 9.0.31
Closes gh-20167
2020-02-13 20:17:18 +00:00
Madhura Bhave fe325c06c2 Merge branch '2.2.x' 2020-02-11 19:43:42 -08:00
Madhura Bhave 4eb71fc424 Merge branch '2.1.x' into 2.2.x 2020-02-11 19:43:19 -08:00
Madhura Bhave 97ac6c9de7 Polish 2020-02-11 19:41:54 -08:00
Madhura Bhave 8d9b1d2988 Merge branch '2.2.x'
Closes gh-20133
2020-02-11 19:04:12 -08:00
Madhura Bhave 98a657fedb Merge branch '2.1.x' into 2.2.x
Closes gh-20132
2020-02-11 19:02:19 -08:00
Madhura Bhave ac91f14f05 Polish "Verify ssl key alias on server startup"
See gh-19202
2020-02-11 17:08:59 -08:00
cbono e351605962 Verify ssl key alias on server startup
See gh-19202
2020-02-11 17:04:31 -08:00
Madhura Bhave a5a2d52ee3 Merge branch '2.2.x' 2020-02-11 14:58:06 -08:00
Madhura Bhave 3bdd91a119 Merge branch '2.1.x' into 2.2.x 2020-02-11 14:57:49 -08:00
Madhura Bhave 747eab020d Update copyright of changed files 2020-02-11 14:57:17 -08:00
Madhura Bhave c5ffe198af Merge branch '2.2.x'
Closes gh-20130
2020-02-11 14:54:27 -08:00
Madhura Bhave d1c7699539 Merge branch '2.1.x' into 2.2.x
Closes gh-20129
2020-02-11 14:53:30 -08:00
Madhura Bhave 544dca7f1b Polish contribution
Along with surrounding map keys with dot from VCAP_SERVICES with `[ ]`,
this commit also does that for non-alphanumeric and `-` characters so that
they are not stripped off later.

See gh-18915
2020-02-11 14:50:55 -08:00
Hans Schulz 6828a15d31 Handle JSON keys containing a dot from CF environment as a single path segment
See gh-18915
2020-02-11 14:50:04 -08:00
dreis2211 aa0360e1ba Fix some deprecation warnings
See gh-20108
2020-02-10 15:28:30 +01:00
Stephane Nicoll 9d60afdbc4 Merge branch '2.2.x'
Closes gh-20100
2020-02-08 09:12:24 +01:00
Stephane Nicoll 76c21571b4 Remove unnecessary dependency on sendgrid
Closes gh-20099
2020-02-08 09:11:03 +01:00
Stephane Nicoll 6e3636d5ff Merge branch '2.2.x'
Closes gh-20059
2020-02-07 14:29:27 +01:00
Stephane Nicoll ddb5cc3f99 Polish "Make Kubernetes detection slightly more efficient"
See gh-19002
2020-02-07 14:24:39 +01:00
med-amine.dahmen aee22bfb51 Make Kubernetes detection slightly more efficient
See gh-19002
2020-02-07 13:45:50 +01:00
Stephane Nicoll 6213ff6aab Merge branch '2.2.x'
Closes gh-20029
2020-02-04 09:20:16 +01:00
Stephane Nicoll fa239a0628 Merge branch '2.1.x' into 2.2.x
Closes gh-20028
2020-02-04 09:18:22 +01:00
Stephane Nicoll 12b644d73c Polish contribution
See gh-19901
2020-02-04 09:03:55 +01:00
Dmytro Nosan aead3a7c44 Handle message of @ResponseStatus-annotated exception with WebFlux
See gh-19901
2020-02-04 09:03:45 +01:00
Madhura Bhave e64a145ef0 Add support for wildcard locations for properties and YAML files
Closes gh-19909
2020-02-03 13:01:01 -08:00
Stephane Nicoll 9b79208b60 Upgrade copyright date
See gh-19995
2020-02-01 09:26:50 +01:00
Johnny Lim e6d5f5a271 Polish
See gh-19995
2020-02-01 09:24:20 +01:00
Scott Frederick afb67887da Restore deprecated class required by Spring Cloud
See gh-19860
2020-01-31 17:13:09 -06:00
Phillip Webb 1eee83a07e Update copyright year of changed files 2020-01-30 17:09:49 -08:00
dreis2211 fac6f08ca3 Use new AssertJ duration assertions
See gh-19985
2020-01-30 08:14:49 +01:00
Andy Wilkinson 9882e749e9 Merge branch '2.2.x'
Closes gh-19971
2020-01-28 17:17:01 +00:00
Andy Wilkinson 553311c690 Merge branch '2.1.x' into 2.2.x
Closes gh-19970
2020-01-28 17:15:57 +00:00
Andy Wilkinson 140f5e7baf Unwraper handler to find ContextHandler when logging context path
Previously, only the top-level handlers were examined to find the
ContextHandlers and log the context path. If those handlers had
been wrapped, this prevented the ContextHandlers from being found
and an empty string was always logged.

When finding the context path, this commit unwraps the handler held
by a HandlerWrapper until the ContextHandler is found.

Fixes gh-19969
2020-01-28 17:01:11 +00:00
Andy Wilkinson 66d4319abd Deprecate refresh(ApplicationContext) and add refresh(ConfigurableAC)
refresh can only ever be called with a ConfigurableApplicationContext
and we want to evolve the refresh API to reflect that. This commit
takes the first step by overloading refresh(ApplicationContext) with
a new refresh(ConfigurationApplicationContext) method and deprecating
refresh(ApplicationContext). Where the call to refresh is made, the
argument is cast to ApplicationContext to ensure that
refresh(ApplicationContext) is called. This ensures that any existing
override of the method is still effective.

Closes gh-18519
2020-01-26 11:39:58 +00:00
Stephane Nicoll e044817fe7 Migrate remaining use of ClassLoader.loadClass to Class.forName
Closes gh-19824
2020-01-23 13:15:45 +01:00
Phillip Webb 77bbe089b2 Update copyright year of changed files 2020-01-22 20:24:23 -08:00
Phillip Webb e0013454b5 Use parentheses when declaring dependencies
Update all dependencies declarations to use the form `scope(reference)`
rather than `scope reference`.

Prior to this commit we declared dependencies without parentheses unless
we were forced to add them due to an `exclude`.
2020-01-22 16:02:38 -08:00
Phillip Webb 0209cd3e4c Polish quote form used in Gradle scripts
Replace Gradle single quote strings with the double quote form
whenever possible. The change helps to being consistency to the
dependencies section where mostly single quotes were used, but
occasionally double quotes were required due to `${}` references.
2020-01-22 15:49:52 -08:00
Andy Wilkinson bfdb49f2a2 Retry when findAvailableTcpPort returns an unavailable port
Closes gh-19801
2020-01-18 12:25:13 +00:00
Scott Frederick 8f102aee68 Remove deprecated 2.2 code
See gh-19699
2020-01-16 14:44:52 +01:00
Stephane Nicoll 03139f066b Polish "Remove deprecated logging properties"
See gh-19699
2020-01-16 14:42:38 +01:00
Scott Frederick 7031a3b17d Remove deprecated logging properties
See gh-19699
2020-01-16 14:35:41 +01:00
Andy Wilkinson 9b5af810dd Merge branch '2.2.x'
Closes gh-19774
2020-01-16 10:06:24 +00:00
Andy Wilkinson 4c8626ea56 Allow Boot's Jetty error handler to be overridden
Fixes gh-19520
2020-01-16 09:33:22 +00:00
Andy Wilkinson 443d1a6a21 Upgrade to Liquibase 3.8.5
Closes gh-19754
2020-01-15 15:09:58 +00:00
Andy Wilkinson 285ae01691 Upgrade to Netty 4.1.45.Final
Closes gh-19741
2020-01-15 14:53:03 +00:00
Andy Wilkinson f73c4a837c Upgrade to Netty 4.1.45.Final
Closes gh-19722
2020-01-15 13:12:30 +00:00
Andy Wilkinson 714a187d8f Rework dep mgmt again to avoid consumers picking up strict constraints
This paves the way for publishing Gradle module metadata once the
problem caused by snapshot versions and our two-step publication
process has been addressed.

See gh-19609
2020-01-15 12:33:18 +00:00
Andy Wilkinson aefe52e4d0 Revert "Rework dep management to avoid consumers picking up strict constraints"
This reverts commit b34a311d02 as,
having disabled the publishing of Gradle's module metadata (4f75ab5),
the changes are no longer needed.

See gh-19609
2020-01-14 12:15:53 +00:00
Brian Clozel 711391cf2f Move spring.http.* config properties namespace
Closes gh-18827
2020-01-14 10:45:31 +01:00
Phillip Webb 3fe4245ab6 Disable failing TomcatReactiveWebServerFactoryTests
Temporarily disable some tests in `TomcatReactiveWebServerFactoryTests`
that fail since the Netty upgrade.

See gh-19702
2020-01-13 18:44:04 -08:00
Phillip Webb 862462b791 Update copyright year of changed files 2020-01-13 17:04:19 -08:00
Phillip Webb 1e5ba09a3e Merge branch '2.2.x' 2020-01-13 17:03:51 -08:00
Phillip Webb 15652ae4c1 Update copyright year of changed files 2020-01-13 16:47:17 -08:00
Phillip Webb f57281340c Merge branch '2.2.x' 2020-01-13 16:46:49 -08:00
Phillip Webb 3cfbfebbb1 Merge branch '2.1.x' into 2.2.x 2020-01-13 16:45:40 -08:00
Phillip Webb 9bd49562fe Update copyright year of changed files 2020-01-13 14:09:11 -08:00
Andy Wilkinson b34a311d02 Rework dep management to avoid consumers picking up strict constraints
Previously, enforcedPlatform dependencies were using to pull in the
constraints defined in spring-boot-dependencies and
spring-boot-parent and applied them strictly so that the constrained
version had to be used. This worked as intended in Spring Boot's own
build but incorrectly enforced those same strict version requirements
on external consumers of Spring Boot's modules.

This commit reworks how Spring Boot defines its internal dependency
management so that platform dependencies are exposed to external
consumers while enforced platform dependencies are using internally.

See gh-19609
2020-01-13 19:59:56 +00:00
Andy Wilkinson 4a76bc8b46 Cope with different exception messages in ValidationException failure analyzer
Fixes gh-19671
2020-01-13 17:11:11 +00:00
Andy Wilkinson 9ca588631e Merge branch '2.2.x'
Closes gh-19689
2020-01-13 17:10:16 +00:00
Andy Wilkinson 27306369c5 Cope with different exception messages in ValidationException failure analyzer
Fixes gh-19671
2020-01-13 17:10:03 +00:00
Stephane Nicoll 4796701337 Merge branch '2.2.x'
Closes gh-19683
2020-01-13 17:24:08 +01:00
Stephane Nicoll 66755105ea Merge branch '2.1.x' into 2.2.x
Closes gh-19682
2020-01-13 17:21:24 +01:00
Dmytro Nosan b7e69890f3 Fix retrieval of parent logger in PoolingDataSourceBean
See gh-19637
2020-01-13 17:16:57 +01:00
Madhura Bhave 94ab996597 Merge branch '2.2.x' 2020-01-10 13:24:40 -08:00
Madhura Bhave 1fa83757ce Fix tests
See gh-19599
2020-01-10 13:22:53 -08:00
Madhura Bhave d510a7bd80 Merge branch '2.2.x'
Closes gh-19622
2020-01-10 13:01:54 -08:00
Madhura Bhave 139995469a Short circuit validation in bind handler if previous exception present
Closes gh-19599
2020-01-10 13:00:14 -08:00
Andy Wilkinson ce99db1902 Port the build to Gradle
Closes gh-19609
Closes gh-19608
2020-01-10 14:15:35 +00:00
Madhura Bhave ed4261a61c Merge branch '2.2.x'
Closes gh-19598
2020-01-09 17:10:24 -08:00
Madhura Bhave a017b8905a Adapt field name in ValidationBindHandler to a valid ConfigurationPropertyName
Fixes gh-19580
2020-01-09 17:08:39 -08:00
Stephane Nicoll 79da3b6e2c Remove support for Jetty 9.4.21 and earlier
Closes gh-18692
2020-01-08 15:40:01 +01:00
Andy Wilkinson 4efd8ba587 Merge branch '2.2.x'
Closes gh-19574
2020-01-08 14:02:50 +00:00
Andy Wilkinson 02965e9744 Fix javadoc warnings
Fixes gh-19572
2020-01-08 14:02:24 +00:00
Stephane Nicoll fc60301fc7 Polish "Add Java 14 to JavaVersion enumeration"
See gh-19511
2020-01-04 11:45:43 +01:00
Dmytro Nosan a5a3a020b6 Add Java 14 to JavaVersion enumeration
See gh-19511
2020-01-04 11:44:03 +01:00
Madhura Bhave f94c6d7458 Merge branch '2.2.x' 2020-01-03 11:42:42 -08:00
Madhura Bhave 8e285a4387 Fix checkstyle 2020-01-03 11:42:14 -08:00
Madhura Bhave 743cf3b2a7 Merge branch '2.2.x'
Closes gh-19527
2020-01-03 11:21:50 -08:00
Madhura Bhave ac46f5971f Merge branch '2.1.x' into 2.2.x
Closes gh-19526
2020-01-03 11:19:21 -08:00
Madhura Bhave 24dd416f4b Add a test case for binding to map with wildcard types
This commit also changes the spring framework version
to use snapshots.

Closes gh-18767
2020-01-03 11:13:41 -08:00
Stephane Nicoll 6fc52b0563 Polish 2020-01-01 09:16:53 +01:00
Stephane Nicoll 2148097c04 Merge branch '2.2.x'
Closes gh-19497
2019-12-31 09:36:27 +01:00
Stephane Nicoll b7e6febaa0 Merge branch '2.1.x' into 2.2.x
Closes gh-19496
2019-12-31 09:36:05 +01:00
Zekariyas f005fffbc3 Fix typo in BindHandler#onFinish javadoc
See gh-19492
2019-12-31 09:34:45 +01:00
Stephane Nicoll 2c1e81adf0 Polish 2019-12-26 10:42:40 +01:00
Stephane Nicoll bd179393ea Merge branch '2.2.x'
Closes gh-19428
2019-12-21 16:34:47 +01:00
dark 4f99c9f281 Remove unused import statement
See gh-19410
2019-12-21 16:33:53 +01:00
Andy Wilkinson be4c4f9c13 Merge branch '2.2.x'
Closes gh-19420
2019-12-20 15:41:24 +00:00
Andy Wilkinson 0e6932d550 Merge branch '2.1.x' into 2.2.x
Closes gh-19419
2019-12-20 15:41:02 +00:00
Andy Wilkinson 35b74185e4 Fix test ordering problems by always clearing URL stream handler factory
Closes gh-19349
2019-12-20 15:36:39 +00:00
Andy Wilkinson 07857f7f24 Merge branch '2.2.x'
Closes gh-19418
2019-12-20 15:28:40 +00:00
Andy Wilkinson 8ed0b1a231 Merge branch '2.1.x' into 2.2.x
Closes gh-19417
2019-12-20 15:28:11 +00:00
Andy Wilkinson 3cadde0900 Protect against available port actually being unavailable
Closes gh-19355
2019-12-20 15:22:30 +00:00
Phillip Webb 695de2c6f5 Polish end-to-end configuration properties tracing
See gh-14880
2019-12-13 12:47:01 -08:00
Phillip Webb 830c2ef7f1 Polish 2019-12-13 11:47:42 -08:00
Phillip Webb be3b11db48 Merge branch '2.2.x' 2019-12-13 11:47:04 -08:00
Phillip Webb 6d372f60d9 Merge branch '2.1.x' into 2.2.x 2019-12-13 11:46:25 -08:00
Phillip Webb 8e03982bca Fix checkstyle violation 2019-12-13 11:45:56 -08:00
Phillip Webb 2fc12bc36c Merge branch '2.2.x' 2019-12-13 11:30:13 -08:00
Phillip Webb 26ff18f37d Merge branch '2.1.x' into 2.2.x 2019-12-13 11:29:51 -08:00
Phillip Webb 9bdad06c10 Polish Netty SSL key alias support
See gh-19197
2019-12-13 11:21:42 -08:00
Madhura Bhave 8dcf1e4033 Provide end-to-end traceability for config properties
Closes gh-14880

Co-authored-by: Andy Wilkinson <awilkinson@pivotal.io>
2019-12-12 17:02:46 -08:00
Andy Wilkinson 4957994def Merge branch '2.2.x'
Closes gh-19305
2019-12-05 12:54:21 +00:00
Andy Wilkinson 3c0e7ccba6 Merge branch '2.1.x' into 2.2.x
Closes gh-19304
2019-12-05 12:53:36 +00:00
Andy Wilkinson effdc8f359 Polish "Honour SSL key alias when using Netty"
See gh-19197
2019-12-05 12:48:13 +00:00
cbono eda7b7c3e6 Honour SSL key alias when using Netty
See gh-19197
2019-12-05 12:10:04 +00:00
Madhura Bhave 201cad970a Merge branch '2.2.x'
Closes gh-19217
2019-12-03 18:22:41 -08:00
Madhura Bhave 68bc82cfc2 Ignore CannotLoadBeanClassException in config props validator
If the bean definition type contains a placeholder value, beanFactory.getType
can throw a CannotLoadBeanClassException. We can ignore this exception while
validating the bean definitions for constructor binding beans.

Fixes gh-19207
2019-12-03 18:21:53 -08:00
Madhura Bhave 1c3526f6b6 Merge branch '2.2.x'
Closes gh-19216
2019-12-03 09:30:34 -08:00
Madhura Bhave f4db8c89d4 Use generic type when binding constructor parameters
Fixes gh-19156
2019-12-03 09:29:51 -08:00
dreis2211 8a730ff630 Use DateTimeFormatter in favor of SimpleDateFormat
See gh-19142
2019-11-27 11:07:56 +01:00
Stephane Nicoll 4c7896b936 Polish "Add support for test containers jdbc url"
See gh-19044
2019-11-27 11:04:02 +01:00
Leo Li 7b1b18cd77 Add support for test containers jdbc url
See gh-19044
2019-11-27 11:04:02 +01:00
Andy Wilkinson f2bd27f4a3 Merge branch '2.1.x' into 2.2.x
See gh-19150
2019-11-27 09:56:41 +00:00
Andy Wilkinson f117dbe8a1 Add metadata for spring.main.log-startup.info
See gh-19026
2019-11-27 09:55:06 +00:00
Stephane Nicoll d8c64abdbb Merge branch '2.1.x' into 2.2.x
Closes gh-19086
2019-11-21 13:42:32 +01:00
Stephane Nicoll b23a3712c6 Polish "Fix logging in CloudFoundryVcapEnvironmentPostProcessor"
See gh-19027
2019-11-21 13:41:47 +01:00
Mark Bigler f1489e41ec Fix logging in CloudFoundryVcapEnvironmentPostProcessor
See gh-19027
2019-11-21 13:35:50 +01:00
Madhura Bhave b6ff0b7c5f Support constructor binding on 3rd party classes
Closes gh-18935
2019-11-13 14:28:58 -08:00
Stephane Nicoll 51487c7c45 Merge branch '2.1.x' into 2.2.x 2019-11-12 14:04:47 +01:00
Stephane Nicoll cad2365237 Polish 2019-11-12 14:03:39 +01:00
Andy Wilkinson e715a5f689 Merge branch '2.1.x' into 2.2.x
Closes gh-18943
2019-11-08 15:01:19 +00:00
Andy Wilkinson 3f0367e2dd Apply changes recommended by Jetty team to JettyEmbeddedErrorHandler
Closes gh-18842
2019-11-08 14:57:46 +00:00
Andy Wilkinson 0a8a0daff8 Merge branch '2.1.x'
Closes gh-18913
2019-11-07 09:56:49 +00:00
Andy Wilkinson a11661d284 Trim whitespace in BasicJsonParser
Previously, whitespace in between the keys and values in the JSON was
not trimmed correctly in BasicJsonParser which lead to it incorrectly
parsing JSON with whitespace between the opening of a list ([) and the
opening of a map ({).

This commit updates the parser to trim unwanted whitespace and adds a
test to AbstractJsonParserTests to verify the whitespace handling
behaviour across all JsonParser implementations.

Closes gh-18911
2019-11-07 09:56:00 +00:00
Andy Wilkinson dd4377e69c Merge branch '2.1.x'
Closes gh-18912
2019-11-07 09:33:11 +00:00
Andy Wilkinson d1ead884c4 Fix @ServletComponentScan with a component index
Previously @ServletComponentScan did not work when there was a
component index on the classpath as it made an assumption about
the concrete type of the BeanDefinitions produced by scanning that
does not hold true when an index is present.

This commit updates the scanning and the handlers to correct the
assumpution by working with a bean definition type that is produced
by scanning both when there is and when there is not an index present.

To prevent the problem from reoccuring, a test that uses and index
has been added and the import of ScannedGenericBeanDefinition is now
prohibited by Checkstyle.

Closes gh-18910
2019-11-07 09:20:19 +00:00
Madhura Bhave 471ca01ccf Do not validate value object bean definion when singleton present
Prior to this commit constructor bound configuration properties could
not be mocked because it would fail validation from
ConfigurationPropertiesBeanDefinitionValidator. The MockitoPostProcessor
registers the mocked bean as a singleton and validation can be skipped if a
singleton for the type is found in the bean factory.

Fixes gh-18652
2019-11-05 21:54:16 -08:00
Madhura Bhave f9785d2bda Fix constructor binding issues
This commit fixes a few bugs related to constructor binding.
The ContructorFilter on the Bindable has been replaced with a
Binder level BinderConstructorProvider so that it can be used to
determine the constructor to use for nested properties as well.

Fixes gh-18810
Fixes gh-18670
Closes gh-18685
Closes gh-18894

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
2019-11-05 14:44:31 -08:00
dreis2211 689e02923f Remove non-existent FailureAnalyzer from spring.factories
See gh-18864
2019-11-05 09:28:21 +01:00
Cosmin Humeniuc d8d24e75e3 Delete Javadoc references to removed code
See gh-18755
2019-10-27 08:36:02 +01:00
dreis2211 9ece2e277f Remove redundant explicit types
See gh-18754
2019-10-27 08:33:01 +01:00
Madhura Bhave 4058f99383 Fix import 2019-10-25 16:29:23 -07:00
Madhura Bhave dec6ee20d4 Fix error message when constructor binding fails to create bean
The configuration property is always cleared before bean instantiation
because the problem with bean instantiation might not necessarily be the
last bound property.

Fixes gh-18704
2019-10-25 16:07:33 -07:00
Andy Wilkinson 533ca0624f Merge branch '2.1.x'
Closes gh-18749
2019-10-25 14:38:16 +01:00
Andy Wilkinson 65ef03a5bf Remove nulls from description for bean defs with no res description
Previously, if a bean definition had no resource description, the
failure analysis description would state that the been had been
defined in null which was of no use to the user.

This commit updates the failure analysis to omit information about
where the bean was definied when the definition has no resource
description.

Fixes gh-18721
2019-10-25 14:26:55 +01:00
Phillip Webb 597baf9774 Polish "Optimize logger calls"
See gh-18710
2019-10-23 21:00:05 -07:00
wycm 240b1f9e29 Optimize logger calls
Guard logger calls to ensure that they are only made when the
level is set.

See gh-18710
2019-10-23 20:59:11 -07:00
Phillip Webb 744dcd9426 Limit ConfigurationPropertiesBean candidates
Update `ConfigurationPropertiesBean.getAll()` to limit the candidate
beans that will actually need a `getBean()` call. Prior to this commit
calling `getAll()` would trigger a get of every bean in the context,
some of which might fail.

Fixes gh-18714
2019-10-23 19:49:45 -07:00
Johnny Lim 8c2d6b28f8 Polish
See gh-18697
2019-10-23 10:09:56 +02:00
dreis2211 8ecdf919f8 Fix Mockito deprecations
See gh-18689
2019-10-23 09:49:33 +02:00
Phillip Webb 8d08d654d1 Merge branch '2.1.x'
Closes gh-18693
2019-10-22 15:18:32 -07:00
Phillip Webb d0d55d3c0a Polish "Upgrade to Jetty 9.4.21.v20190926"
See gh-18536
2019-10-22 14:54:43 -07:00
dreis2211 eae2cf170d Upgrade to Jetty 9.4.21.v20190926
See gh-18536
2019-10-22 14:53:41 -07:00
Phillip Webb 374a8cadad Merge branch '2.1.x'
Closes gh-18691
2019-10-22 13:20:42 -07:00
Phillip Webb 867c4a14cb Clarify Javadoc for ServletContextInitializer
Closes gh-18660
2019-10-22 13:16:02 -07:00
Phillip Webb 714c9b9804 Polish 2019-10-22 13:12:09 -07:00
Stephane Nicoll 6e6f4f763c Remove useless attribute override
This commit removes the override proxyBeanMethods as the aliased
attribute is taking precedence.
2019-10-22 14:04:20 +02:00
Stephane Nicoll 4d5d90847e Merge branch '2.1.x'
Closes gh-18682
2019-10-22 09:41:04 +02:00
wycm 681a94b0d5 Optimize debug level logs
See gh-18604
2019-10-22 09:36:48 +02:00
Stephane Nicoll bd4dc1ef2a Merge branch '2.1.x'
Closes gh-18669
2019-10-21 09:19:50 +02:00
xiaokeliu666 57c64eb3bc Polish
See gh-18665
2019-10-21 09:15:16 +02:00
Andy Wilkinson fd1d653c34 Rename socket factory processor methods on NettyRSocketServerFactory
Previously, the methods were named addServerProcessors and
setServerProcessors which wasn't aligned with them taking
socket factory processors (ServerRSocketFactoryProcessor) as an
argument.

This commit renames the methods to align them more closely with the
type of their arguments.

Closes gh-18617
2019-10-16 13:39:42 +01:00
Stephane Nicoll 2bf8073446 Polish
See gh-18440
2019-10-15 14:08:38 +02:00
Andy Wilkinson b240c810a8 Fix @ConfigurationProperties on @Bean methods without metadata caching
Due to a current limitation of Spring Framework, when bean metadata
caching is disabled, a merged bean definition may have a null
resolved factory method that would have been non-null if bean metadata
caching was enabled. Configuration property binding for @Bean methods
annotated with @ConfigurationProperties relied upon the resolved
factory method being enabled to find the @ConfigurationProperties
annotation and trigger property binding. As a result, when bean
metadata caching is disabled on the bean factory, such
@ConfigurationProperties beans would not be bound.

This commit works around the limitation by adding a fallback that
performs a reflection-based search for the factory method when the
resolved factory method on the bean definition is null. This allows
the bean's factory method and any @ConfigurationProperties annotation
on it to be found, ensuring that propoerty binding is then performed.

Fixes gh-18440
2019-10-15 11:21:53 +01:00
Stephane Nicoll 391eb279df Merge branch '2.1.x'
Closes gh-18588
2019-10-15 08:51:31 +02:00
Stephane Nicoll 22f44917ca Polish "Add metadata entry for spring.main.register-shutdown-hook"
See gh-18581
2019-10-15 08:41:07 +02:00
leoli 9b781449cf Add metadata entry for spring.main.register-shutdown-hook
See gh-18581
2019-10-15 08:37:08 +02:00
Stephane Nicoll 98f676ca46 Merge branch '2.1.x'
Closes gh-18586
2019-10-15 08:25:25 +02:00
contextshuffling efedd80d4b Use LinkedHashSet for deterministic order in test assertions
See gh-18580
2019-10-15 08:20:53 +02:00
Stephane Nicoll 9c6e5f0904 Merge branch '2.1.x'
Closes gh-18585
2019-10-15 08:15:42 +02:00
dreis2211 abfb87d1a3 Rename tests to match Surefire expectations
See gh-18579
2019-10-15 08:11:47 +02:00
Phillip Webb e20aa7dc73 Clarify ConfigurationPropertiesBean Javadoc
Update the `ConfigurationPropertiesBean` Javadoc to clarify its purpose.

Closes gh-18487
2019-10-14 20:50:42 -07:00
Andy Wilkinson 3fc51f8063 Isolate the effects of initializing Reactor's debug agent in the tests 2019-10-14 20:08:59 +01:00
Andy Wilkinson e7efe0cbfe Merge branch '2.1.x'
Closes gh-18576
2019-10-14 14:12:57 +01:00
王洋 152568521e Make the logger static final
See gh-18575
2019-10-14 14:12:26 +01:00
Andy Wilkinson c75b06c76c Remove @ImmutableConfigurationProperties
Closes gh-18563
2019-10-14 11:29:09 +01:00
Stephane Nicoll 61a914fa28 Polish 2019-10-11 10:39:23 -05:00
Stephane Nicoll 40bd98a3f4 Polish "Remove boxing"
See gh-18552
2019-10-11 10:35:19 -05:00
clove506 fe6da39e1b Remove boxing
See gh-18552
2019-10-11 10:32:59 -05:00
Andy Wilkinson e62ca778e9 Merge branch '2.1.x'
Closes gh-18554
2019-10-10 07:29:57 -05:00
dreis2211 ba46ab6a4f Remove accidental usage of UnsupportedOptionException
See gh-18539
2019-10-10 07:28:51 -05:00
Johnny Lim e9e6c925e8 Remove a duplicate assertion
See gh-18524
2019-10-07 08:19:11 -05:00
Phillip Webb be7a7bb2e9 Refine String to File conversion support
Refine the conversion support so that file URLs are support without
reintroducing gh-12163.

Closes gh-16931
2019-10-02 22:45:22 -07:00
Johnny Lim 701bd0dd46 Polish
See gh-18490
2019-10-02 22:15:05 -07:00
Phillip Webb 3c7d3f9482 Add String to File conversion support
Add `String` -> `File` support to the `ApplicationConversionService`
that can support both simple filename as well as file URLs.

This allows Spring Boot application to work in a similar way to vanilla
Spring applications where Spring's `FileEditor` provides similar
support.

Closes gh-16931
2019-10-02 21:41:31 -07:00
Madhura Bhave fcbd4408c9 Fix @since tag 2019-10-02 18:04:51 -07:00
Phillip Webb 386c0a60a7 Relax @ConstructorBinding member class requirement
Update `@ConfigurationProperties` so that `@ConstructorBinding` classes
no longer need to repeat the annotation for their members.

Closes gh-18481
2019-10-02 17:17:44 -07:00
Phillip Webb 9582aa3f3c Remove accidentally committed debug sysout 2019-10-02 16:04:50 -07:00
Phillip Webb b1f23f54df Prevent ValueBinder from being incorrectly used
Fix a regression caused by e41c5a43 which incorrectly allowed the
`ValueObjectBinder` to be picked when the `JavaBeanBinder` should
have been used.

Closes gh-18485
2019-10-02 15:47:36 -07:00
Madhura Bhave 5547a8499f Polish 2019-10-02 14:41:01 -07:00
Madhura Bhave 58fc337315 Polish 2019-10-02 14:30:49 -07:00
Phillip Webb 4208c93ba7 Validate @ConfigurationProperties bean definitions
Add a bean definition post-processor that throws a better exception
if @ConstructorBinding property beans are being instantiated as
regular Spring beans.

Prior to this commit, a constructor bound properties bean would fail
with an unsatisfied dependency exception which isn't all that helpful.

Closes gh-17831
2019-10-02 12:51:36 -07:00
Phillip Webb 71f8347c81 Rename ServerRSocketFactoryCustomizer
Rename `ServerRSocketFactoryCustomizer` to
`ServerRSocketFactoryProcessor` to better reflect that it is not a
traditional customizer.

Closes gh-18390
2019-10-02 10:41:53 -07:00
Andy Wilkinson 46c30d6bb0 Merge branch '2.1.x'
Closes gh-18476
2019-10-02 10:48:57 +01:00
Andy Wilkinson 3d4157ad6d Correct SCM URLs in published poms
Previously, Maven's default behaviour was relied up which resulted
in the artifact ID being appended to each URL as it was inherited.
This behaviour can only be disabled in Maven 3.6 and later, a version
that we cannot use due to an incompatibility with the Flatten Plugin.

This commit works around Maven's default behaviour by defining
properties for the SCM URL, connection, and developer connection and
then explicitly defining the settings in each pom using these
properties. The explicit definition of the properties in each pom
prevents them being inherited from the parent, thereby disabling the
unwanted appending of the artifact ID to the URL.

Fixes gh-18328
2019-10-02 10:48:30 +01:00
Phillip Webb e41c5a4327 Require annotation signal for constructor binding
Update `@ConfigurationProperties` constructor binding support to only
apply when a `@ConstructorBinding` annotation is present on either the
type or the specific constructor to use.

Prior to this commit we didn't have a good way to tell when constructor
binding should be used vs regular autowiring.

For convenience, an `@ImmutableConfigurationProperties` meta-annotation
has also been added which is composed of `@ConfigurationProperties` and
`@ConstructorBinding`.

Closes gh-18469
2019-10-01 21:56:09 -07:00
Phillip Webb b262ebf5b4 Update copyright header of changed files 2019-10-01 11:40:07 -07:00
Phillip Webb 062163b52f Fix package tangle with configuration properties
Fix a package tangle that was introduced when we added cache bypass to
`SpringIterableConfigurationPropertySource`. Ideally we should have
been able to depend on `env` from `context` but unfortunately the
`EnvironmentPostProcessor` interface references `SpringApplication`
which needs to use the Binder.

The `isImmutable` method has now been moved to `OriginLookup` which
removes the immediate tangle.

Closes gh-18393
2019-09-28 22:04:44 -07:00
Phillip Webb 615c6d4e86 Restructure RSocket packages and polish
Polish code and relocate `RSocketServerBootstrap` from `server` to
`context` since it's really an `ApplicationContext` concern.

Closes gh-18391
2019-09-28 22:04:30 -07:00
Phillip Webb 4b0fb8ff24 Polish 'Add @LocalRSocketServerPort support'
See gh-18287
2019-09-28 22:03:36 -07:00
Verónica Vásquez 3c8fa3bbd0 Add @LocalRSocketServerPort support
Add an appication context initializer to detect and store the
active RSocket port in the Environment under
`local.rsocket.server.port`.

Additionally add a `@LocalServerPort` that provides a convenient
alternative to `@Value`.

See gh-18287

Co-authored-by: Eddú Meléndez <eddu.melendez@gmail.com>
2019-09-28 22:03:36 -07:00
Phillip Webb 3ffc5f2a30 Polish 'Support programmatic lazy-int exclusion'
See gh-16615
2019-09-26 21:24:51 -07:00
Tyler Van Gorder 0f26f4d6e2 Support programmatic lazy-int exclusion
Allow the `LazyInitializationBeanFactoryPostProcessor` to skip setting
lazy-init based on a programmatic callback. This feature allows
downstream projects to deal with edge-cases in which it is not easy to
support lazy-loading (such as in DSLs that dynamically create additional
beans).

See gh-16615
2019-09-26 21:22:36 -07:00
Phillip Webb a13666d696 Polish "Simplify code"
See gh-18342
2019-09-26 19:12:18 -07:00
Yuyan 4d0da4b700 Simplify code
See gh-18342
2019-09-26 19:09:28 -07:00
dreis2211 4262aab446 Fix deprecation warnings caused by BodyInserters.fromObject
See gh-18349
2019-09-25 13:57:17 +01:00
dreis2211 d89adfac91 Test compression with invalid content type for all webservers
Closes gh-18338
2019-09-24 10:03:38 +01:00
dreis2211 7bc28fc646 Test compression with invalid content type for all webservers
See gh-18337
2019-09-24 09:57:28 +01:00
Andy Wilkinson e6d60d937e Ensure the use of UTF-8 encoding in ImageBannerTests
Closes gh-18301
2019-09-22 20:31:51 +01:00
Andy Wilkinson ec2483e897 Polish assertions in ImageBannerTests 2019-09-22 19:44:50 +01:00
Phillip Webb b3141d8887 Use hexadecimal for string compare failure
Update `ImageBannerTests` to use `inHexacecimal()` to help with
failure logs.

See gh-18301
2019-09-22 09:46:58 -07:00
Phillip Webb 303974fde9 Add block pixel mode support for image banners
Add support for a `spring.banner.image.pixelmode` property which can
be set to `block` to use unicode block characters when rendering image
banners.

Closes gh-18301
2019-09-22 00:18:54 -07:00
Phillip Webb 4ef1e18216 Add ANSI 8-bit color image banner support
Update `ImageBanner` and `AnsiColors` to optionally support 8-bit
color output.

See gh-18264
2019-09-21 23:30:05 -07:00
Phillip Webb 7f79c26b6b Polish 'Add ANSI 8-bit color support'
See gh-18264
2019-09-21 23:30:05 -07:00
Toshiaki Maki 65a27ef6d6 Add ANSI 8-bit color support
Update ANSI property support to include an 8-bit (256 color) option.

See gh-18264
2019-09-21 23:15:58 -07:00
Phillip Webb 5ca5ec8395 Merge branch '2.1.x'
Closes gh-18299
2019-09-21 12:46:13 -07:00
Phillip Webb 1ceb96f9f2 Ensure matches is not called before initialization
Update `ApplicationContextRequestMatcher` to ensure that the `matches`
method is never called before `initialized`. This fixes an issue
accidentally introduced in commit 5938ca78 where concurrent calls
to `matches` could trigger unexpected errors due to the fact that the
second call proceeded before the `initialized` method had returned.

Fixes gh-18211
2019-09-21 12:29:46 -07:00
Phillip Webb 5427526bcc Fix ApplicationContextRequestMatcher javadoc
Fix an error in the `ApplicationContextRequestMatcher` javadoc.
2019-09-21 12:28:58 -07:00
Phillip Webb 221ff0ff6d Polish configuration property bean classes
Refactor the `org.springframework.boot.actuate.context` package
with the following changes:

- Deprecate several classes which would ideally be internal

- Replace `ConfigurationBeanFactoryMetadata` with a new
  `ConfigurationPropertiesBean` class to better reflect that we no
  longer maintain meta-data directly.

- Use constructor injection and final fields whenever possible

- Rename `ConfiguraionPropertiesBeanDefinition` to
  `ConfigurationPropertiesValueObjectBeanDefinition` to align
  with the binder changes made in commit 0b3015e4ff

- Add additional tests

Closes gh-16903
2019-09-20 13:42:33 -07:00
Andy Wilkinson 39c1e47eb7 Use 3 decimal places at most for logged startup time
Fixes gh-18278
2019-09-19 10:18:23 +01:00
Andy Wilkinson 9d3586d0b8 Test DatabaseDriver.ORACLE now it's available from Maven Central
Closes gh-18274
2019-09-18 17:08:18 +01:00
Andy Clement 4fecefe149 Add Graal checks ahead of some interactions with ClassLoader methods
See gh-18262
2019-09-18 09:58:33 +01:00
Andy Wilkinson c662c404c5 Do not enable H2C by default when using Reactor Netty
Previously, Reactor Netty was the only embedded server that enabled
H2C by default. This commit updates the factory to only enable HTTP/2
when SSL has also been configured, aligning it with Jetty, Tomcat,
and Undertow.

If H2C is required, it can be enabled using a NettyServerCustomizer:

@Bean
NettyServerCustomizer h2cCustomizer() {
    return (httpServer) ->
           httpServer.protocol(HttpProtocol.HTTP11, HttpProtocol.H2C);
}

Closes gh-17867
2019-09-17 10:57:24 +01:00
Andy Wilkinson 448f5b8650 Simplify error page config by dropping redundant support for Tomcat 7
Closes gh-17937
2019-09-16 11:48:02 +01:00
Phillip Webb ad32603635 Restore compatibility with MockRestServiceServer
Closes gh-17885
2019-09-16 10:17:41 +02:00
leoli a0d2721e33 Use custom port for RSocket server over websocket
Prior to this change, the custom port configured for the RSocket
server would not be used if the server factory is using the
websocket transport and is provided with a custom
`ReactorResourceFactory`.

Fixes gh-18200
2019-09-16 09:53:10 +02:00
Stephane Nicoll a0d7d52106 Polish "Add ROLLING_FILE_NAME_PATTERN for File Appender"
See gh-18151
2019-09-16 09:28:15 +02:00
Eddú Meléndez 4a3810a0f1 Add ROLLING_FILE_NAME_PATTERN for File Appender
This new property allows to customize `fileNamePattern` if it is set.
Otherwise, a default pattern remains. Also, new property is supported
`logging.pattern.rolling-file-name`.

See gh-18151
2019-09-16 09:15:59 +02:00
Andy Wilkinson 1b237de5f5 Use Awaitility in our own tests
Closes gh-18227
2019-09-13 20:50:14 +01:00
Phillip Webb 8e398e164c Fix checkstyle violations 2019-09-12 15:23:32 -07:00
Phillip Webb eea5d15412 Merge branch '2.1.x'
Closes gh-18219
2019-09-12 15:11:13 -07:00
Phillip Webb 23174eb484 Remember annotations when using withExistingValue
Update `Bindable` builder methods so that existing annotations are
retained.

Closes gh-18218
2019-09-12 15:09:47 -07:00