Commit Graph

1973 Commits

Author SHA1 Message Date
Andy Wilkinson 01c270d54b Merge branch '2.3.x'
Closes gh-22011
2020-06-18 11:03:49 +01:00
Andy Wilkinson ce907b129c Merge branch '2.2.x' into 2.3.x
Closes gh-22010
2020-06-18 11:03:32 +01:00
Andy Wilkinson 1b62abab9a Configure context on SizeAndTimeBasedRollingPolicy
Previously, when file-based logging was enabled, Logback would output
the following during logging system initialization:

LOGBACK: No context given for c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy

This commit updates the default logback configuration to set the
context on the SizeAndTimeBasedRollingPolicy that it creates.

Fixes gh-21056
2020-06-18 11:01:26 +01:00
Stephane Nicoll f0f8424191 Merge branch '2.3.x'
Closes gh-22008
2020-06-18 11:31:00 +02:00
dreis2211 855d596c2a Use lazy lambda instead of explicit argument
See gh-21986
2020-06-18 11:29:49 +02: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 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
Stephane Nicoll 164a992d6e Fix assertion for startup info format
See gh-21926
2020-06-15 20:17:07 +02:00
Phillip Webb 9eb251a8f3 Merge branch '2.3.x'
Closes gh-21904
2020-06-12 10:50:46 -07:00
Phillip Webb 1604545727 Ensure AvailabilityChangeEvent carries generics
Update `AvailabilityChangeEvent` to be a `PayloadEvent` and ensure
that the `getResolvableType` method returns a generic compatible
result.

Prior to this commit, a ClassCastExeption would be thrown if the
following event listener was declared:

  @EventListener
  void onEvent(AvailabilityChangeEvent<ReadinessState> event) {
    ...
  }

Closes gh-21898
2020-06-12 10:50:00 -07:00
Phillip Webb bb7936a000 Merge branch '2.3.x'
Closes gh-21896
2020-06-11 14:52:34 -07:00
Phillip Webb 069d2769f4 Reinstate disabled Reactor Netty test
Reinstate test now that we are on a reactor-netty releases that fixes
reactor/reactor-netty issue 1093.

Closes gh-21437
2020-06-11 14:52:21 -07:00
Madhura Bhave fc9760ba49 Merge branch '2.3.x'
Closes gh-21894
2020-06-11 11:49:06 -07:00
dreis2211 469dfc285b Fix deprecation in NettyRSocketServerFactoryTests
See gh-21872
2020-06-11 11:46:11 -07:00
Phillip Webb 087c62d34b Merge branch '2.3.x' 2020-06-10 22:14:44 -07:00
Phillip Webb 3b71403b99 Merge branch '2.2.x' into 2.3.x 2020-06-10 22:14:33 -07:00
Phillip Webb ac197be815 Fix checkstyle issue 2020-06-10 22:14:09 -07:00
Phillip Webb aecd13bb9b Merge branch '2.3.x' 2020-06-10 22:06:03 -07:00
Phillip Webb 7e5d6bafa8 Merge branch '2.2.x' into 2.3.x 2020-06-10 22:05:40 -07:00
Phillip Webb 02bfc9d30a Polish 2020-06-10 21:50:17 -07:00
Madhura Bhave f96a2f2b83 Merge branch '2.3.x'
Closes gh-21881
2020-06-10 18:52:32 -07:00
Madhura Bhave 83485e625d Merge branch '2.2.x' into 2.3.x
Closes gh-21880
2020-06-10 18:50:41 -07:00
Madhura Bhave 4e014da9e9 Return all loggers for Log4j2
This commit aligns log4j2's behavior with logback such that loggers
with a null configuredLevel are also returned by the actuator endpoint.

Fixes gh-20037
2020-06-10 18:48:14 -07:00
Madhura Bhave 92ce94b3d8 Align default log levels for Log4j2 and Logback
Fixes gh-21293
2020-06-10 18:48:01 -07:00
Andy Wilkinson 6e68101b9f Upgrade to Postgresql 42.2.13
Closes gh-21859
2020-06-10 17:04:03 +01:00
Phillip Webb 621d120ba3 Merge branch '2.3.x'
Closes gh-21735
2020-06-06 12:07:00 -07:00
Phillip Webb c11abf48d9 Polish 'Allow beans without public constructors to load'
See gh-20929
2020-06-06 12:05:50 -07:00
Vlad Kisel d8d8f9cf0b Allow beans without public constructors to load
Allow `BeanDefinitionLoader` to load classes that don't have public
constructors. The constraint was first introduced in d82c50804f to
solve an issue with anonymous Groovy classes but causes particular
problems with `@SpringBootTest`.

See gh-20929
2020-06-06 11:59:47 -07:00
Phillip Webb 5f79bd2a09 Merge branch '2.3.x'
Closes gh-21734
2020-06-06 11:08:30 -07:00
dreis2211 2b5569f054 Polish
See gh-21732
2020-06-06 11:07:21 -07:00
Phillip Webb d356a24a07 Merge branch '2.3.x'
Closes gh-21726
2020-06-05 16:20:39 -07:00
Phillip Webb 47c1928189 Polish 'Optimize SystemEnvironmentPropertyMapper'
Introduce a new `ConfigurationPropertyName.ofIfValid` method to
save us needing to throw and catch an exception unnecessarily.

See gh-21523
2020-06-05 16:11:52 -07:00
dreis2211 0378de7b30 Optimize SystemEnvironmentPropertyMapper
See gh-21523
2020-06-05 16:11:28 -07:00
dreis2211 f8d6d9a4b0 Call append only when necessary
See gh-21523
2020-06-05 16:11:11 -07:00
dreis2211 33deba4948 Use chars rather than strings
Update `SystemEnvironmentPropertyMapper` to use single chars
rather than strings whenever possible.

See gh-21523
2020-06-05 15:52:18 -07:00
Phillip Webb b1044ca883 Update copyright year of changed files 2020-06-05 15:37:47 -07:00
Phillip Webb 8a7a5929ae Merge branch '2.3.x' 2020-06-05 15:37:33 -07:00
Phillip Webb cc50605687 Merge branch '2.2.x' into 2.3.x 2020-06-05 15:36:44 -07:00
Phillip Webb 0a05b4c9fd Update copyright year of changed files 2020-06-05 15:36:09 -07:00
Andy Wilkinson 82cc7e972d Polish "Print the java version being used on startup"
See gh-21559
2020-06-05 14:19:15 +01:00
dreis2211 731c192817 Print the java version being used on startup
See gh-21559
2020-06-05 14:12:08 +01:00
dreis2211 85a6686cae Add Java 15 to JavaVersion enum
See gh-21691
2020-06-05 14:08:09 +01:00
Phillip Webb 4d37430bfe Use servlet context that can access classloader
Update `SpringBootServletInitializer` to use the `ServletContext` that
was provided to the initial `onStartup` call rather than the
one from the `ServletContextEvent`. This allows the `getClassLoader()`
call to complete without throwing an `UnsupportedOperationException`.

Fixes gh-21684
2020-06-03 19:18:12 -07:00
Phillip Webb e39d7971fb Merge branch '2.2.x' into 2.3.x 2020-06-02 22:48:01 -07:00
Phillip Webb 864daab03a Merge branch '2.1.x' into 2.2.x 2020-06-02 22:47:41 -07:00
Phillip Webb b5fe3c3494 Refine YAML type restriction error
Closes gh-21596
2020-06-02 22:46:47 -07:00
Phillip Webb ebb3f5f286 Merge branch '2.2.x' into 2.3.x
Closes gh-21660
2020-06-02 22:28:39 -07:00
Phillip Webb 4fc0dec6c4 Support wrapped random property sources
Update `SpringConfigurationPropertySource` so that wrapped random
property sources can be used. It's assumed that wrapped random
sources will use the name of the source as the prefix.

Closes gh-21595
2020-06-02 22:22:40 -07:00
Phillip Webb 2589f980d5 Merge branch '2.2.x' into 2.3.x
Closes gh-21655
2020-06-02 10:58:36 -07:00
Phillip Webb 09a47c9aad Fix containsDescendantOf for random sources
Fix the `containsDescendantOf` logic for random property sources to
ensure that ancestors are correctly matched.

Closes gh-21654
2020-06-02 10:57:48 -07:00
Phillip Webb 4dff0beb80 Merge branch '2.2.x' into 2.3.x
Closes gh-21645
2020-06-01 15:07:26 -07:00
Phillip Webb 14e6c734a9 Merge branch '2.1.x' into 2.2.x
Closes gh-21643
2020-06-01 14:45:39 -07:00
Phillip Webb 95031295b9 Restore TomcatReactiveWebServerFactoryTests
Restore tests that were previously ignored due to a framework bug.

Closes gh-19702
2020-06-01 14:19:20 -07:00
Phillip Webb a84b7bccf1 Merge branch '2.2.x' 2020-05-27 19:19:51 -07:00
Phillip Webb 14c9804c5c Fix checkstyle issues 2020-05-27 19:19:11 -07:00
Phillip Webb 1c3f147c1e Merge branch '2.2.x'
Closes gh-21598
2020-05-27 16:47:40 -07:00
Phillip Webb af90604030 Merge branch '2.1.x' into 2.2.x
Closes gh-21597
2020-05-27 16:45:08 -07:00
Phillip Webb 587b840666 Restrict use of custom YAML types
Update `YamlJsonParser` and `OriginTrackedYamlLoader` to ensure that
custom types cannot be loaded.

Closes gh-21596
2020-05-27 16:36:46 -07:00
Andy Wilkinson f17f1255a4 Do not change availability on close unless context is active
Previously, an AvailabilityChangeEvent was published when the servlet
and reactive web server application contexts were closed, irrespective
of whether or not the context was active. This caused problems when
the context was not active due to a refresh failure as the event
publication could then trigger bean creation and post-processing that
relied upon beans that had been destroyed when cleaning up after the
refresh failure. The most commonly seen symptom was a missing
importRegistry bean that is required by ImportAwareBeanPostProcessor.

This commit updates the two web server application contexts to only
publish the availability change event if the context is active.

Fixes gh-21588
2020-05-27 20:05:45 +01:00
Stephane Nicoll 4317b29b9a Tolerate change in method format
This commit polishes the assertions of the NoSuchMethodError failure
analyzer as the method format changes according to the JDK.

See gh-21587
2020-05-27 15:25:50 +02:00
Stephane Nicoll 35121f182e Harmonize Period conversion support
Closes gh-21574
2020-05-27 14:48:32 +02:00
Andy Wilkinson 744b4d7c26 Include type hierarchy in NoSuchMethodError failure analysis
Closes gh-21587
2020-05-27 11:00:10 +01:00
Stephane Nicoll b21c09020d Polish "Polish duration support javadoc"
See gh-21579
2020-05-26 18:21:18 +02:00
OrangeDog 1a87fce416 Polish duration support javadoc
See gh-21579
2020-05-26 18:12:11 +02:00
dreis2211 62deec715f Avoid allocations in ConfigFileApplicationListener
See gh-21509
2020-05-20 17:38:17 -07:00
Scott Frederick c5fd09d06d Merge branch '2.2.x'
Closes gh-21522
2020-05-20 13:00:30 -05:00
Scott Frederick 4a812fc29c Fix log name in ServletWebServerApplicationContext
Fixes gh-21354
2020-05-20 12:59:13 -05:00
Andy Wilkinson beb7cb4b81 Preserve property ordering in SpringIterableConfigurationPropertySource
Fixes gh-21470
2020-05-18 15:16:10 +01:00
wonwoo 25723be26f Polish
See gh-21481
2020-05-18 12:22:13 +01:00
Andy Wilkinson d0f16d6fe6 Merge branch '2.2.x'
Closes gh-21450
2020-05-14 12:53:04 +01:00
Andy Wilkinson b78e4dacec Work around file handle leak when Undertow is stopped
There's a bug in Undertow that means it may leak a file handle is
the server is stopped immediately after a response to an SSL request
has been received. The stop processing races with Undertow's SSL
support tidying things up after sending the response. When the stop
processing wins, the tidying up fails with a NullPointerException that
prevents an input stream from being closed. On Windows, the input
stream remaining open prevents JUnit from being able to clean up its
temporary directory.

This commit uses Awaitility to wait for the file that's being served
over SSL to be deleted before stopping the server. On Windows, this
will delay the stop processing from beginning until after the tidy up
that's performed after sending the response has been completed,
hopefully eliminating the race condition that resulted in the input
stream being left open.

Fixes gh-21172
2020-05-14 12:45:37 +01:00
Phillip Webb 038ae93406 Update copyright year of changed files 2020-05-13 16:48:51 -07:00
Phillip Webb 12381467da Polish 2020-05-13 16:48:51 -07:00
Andy Wilkinson 8b6cdbb977 Deregister JDBC drivers when deployed war's ServletContext is destroyed
Closes gh-21221
2020-05-13 17:46:37 +01:00
Andy Wilkinson 4169724b86 Disable test that is flaky due to Reactor Netty problem
See gh-21437
2020-05-13 14:59:05 +01:00
Phillip Webb 0607af870d Improve ConfigurationPropertySource performance
Further improve the performance of `containsDescendantOf` by using
a Map to limit the number of candidates that need checking.

Closes gh-21416
2020-05-12 20:17:06 -07:00
Phillip Webb 4af6e7ff99 Improve ConfigurationPropertySource performance
Attempt to improve the performance of the `ConfigurationPropertySource`
adapters `containsDescendantOf` method. The method now operates on
arrays rather than iterators and reduces the inner for-loop when
possible.

See gh-21416
2020-05-12 16:44:57 -07:00
Andy Wilkinson 4c4097a29b Address flakiness in TomcatServletWebServerFactoryTests 2020-05-12 22:41:56 +01:00
Andy Wilkinson 8cf56069d2 Allow more time for shutdown result callback to be received
5 seconds isn't always sufficient, particularly on CI where the timing
can be quite variable.
2020-05-12 22:25:41 +01:00
Andy Wilkinson 86e6ec04b2 Fix hang caused by race condition in test for reset of kept-alive connection
Previously, a race between the server starting to reject requests
on a kept-alive connection and the request reaching the blocking
servlet could result in a response never being sent.

This commit updates the test to disable blocking once graceful
shutdown with an in-flight request has being. Awaitility is then used
to make a request on an idle kept-alive connection until it fails
due to the connection reset. This may not happen immediately due to
the aforementioned race.
2020-05-12 22:10:23 +01:00
Andy Wilkinson 240898121f Use SmartLifecycle for graceful web server shutdown
Closes gh-21325
2020-05-12 19:59:52 +01:00
Andy Wilkinson c42571ba40 Consolidate Undertow WebServers and simplify their constructors
Closes gh-21391

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
2020-05-12 19:59:52 +01:00
Stephane Nicoll a6efe77a0c Polish "Calculate hashCode only once in ConfigurationPropertyName"
See gh-21394
2020-05-12 13:10:03 +02:00
Stephane Nicoll dd053074f8 Polish "Calculate hashCode only once in ConfigurationPropertyName"
See gh-21394
2020-05-12 10:05:32 +02:00
dreis2211 c9f6a126b7 Calculate hashCode only once in ConfigurationPropertyName
See gh-21394
2020-05-12 10:02:45 +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
Phillip Webb 7afd25fc9a Add ConfigurationPropertyCaching support
Add a `ConfigurationPropertyCaching` utility interface that can be
used to control the property source caching.

Prior to this commit, a `ConfigurationPropertySource` that was backed
by a mutable `EnumerablePropertySource` would need to call the
`getPropertyNames()` method each time a property was accessed. Since
this this operation can be expensive, we now provide a way to cache
the results for a specific length of time.

This commit also improves the performance of immutable property sources
by limiting the number of candidates that need to be searched.
Previously, all mapped names would be enumerated. Now, mappings are
grouped by `ConfigurationPropertyName`. This is especially helpful when
the `ConfigurationPropertyName` isn't mapped at all since the hash based
map lookup will be very fast and the resulting mappings will be empty.

Closes gh-20625
2020-05-07 15:22:24 -07:00
Phillip Webb 85e9a73e85 Add hashcode support to ConfigurationPropertyName
Provide a hashcode implementation for `ConfigurationPropertyName` so
that instances can be stored in Map without them all ending up in the
same bucket.

See gh-20625
2020-05-07 15:22:20 -07:00
Phillip Webb 5309912927 Test large property source performance
Add a test to ensure that a large number of property sources that each
contain many items can perform well.

See gh-20625
2020-05-07 15:22:10 -07:00
Phillip Webb 81058cab03 Allow clash in spring.config.name
Remove the recently added slash restriction since Spring Cloud
Config Server needs to support names with slashes.

See gh-21217
2020-05-07 07:56:01 -07:00
Phillip Webb 559c178637 Simplify regex expressions 2020-05-07 07:44:31 -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
Madhura Bhave be7fe85b55 Polish 2020-05-06 15:35:44 -07:00
Phillip Webb b4963d2463 Fix legacy environment names in isAncestorOf
Fix the `SystemEnvironmentPropertyMapper.isAncestorOf` implementation
to convert names based on their dashed form and to silently ignore
any invalid results.

Closes gh-14479
2020-05-06 11:35:39 -07:00
Andy Wilkinson e03cb94190 Merge branch '2.2.x'
Closes gh-21327
2020-05-06 12:55:08 +01:00
Andy Wilkinson 9ba78db865 Allow Undertow to stop when a request is being handled
Previously, unlike embedded Jetty, Netty, and Tomcat, Undertow would
not stop when one of its worker threads was in use. This meant that a
a long-running or stalled request could prevent the application from
shutting down in response to SIGTERM or SIGINT, and SIGTERM would be
required to get the process to exit.

This commit updates the factories for the reactive and servlet
Undertow web server factories to configure Undertow to use a 0ms
shutdown timeout. This aligns it with the behaviour of Jetty, Netty,
and Tomcat. Tests have been introduced to verify the behaviour across
the reactive and servlet variants of all four supported embedded web
servers.

Fixes gh-21319
2020-05-06 12:23:37 +01:00
Phillip Webb 5ae623c43a Polish 'Add Period converter support'
Polish period converter support, primarily by changing
`PeriodStyle` to parse and print periods that include
more than one unit.

See gh-21136
2020-05-06 00:21:50 -07:00
Grubhart dc4d71f91e Add Period converter support
Add converter support for `javax.time.Period` including:

	String -> Period
	Number -> Period
	Period -> String

Period to Number conversion is not supported since `Period` has no
ability to deduce the number of calendar days in the period.

See gh-21136
2020-05-05 22:31:49 -07:00
Madhura Bhave a8f56b57cb Consider legacy environment names in isAncestorOf
Update the `isAncestorOf` method of SpringConfigurationPropertySources
so that legacy names are considered for the system environment.

Prior to this commit, binding a property such as `my.camelCase.prop`
would detect `MY_CAMELCASE_PROP` but not `MY_CAMEL_CASE_PROP` in
the system environment.

Fixes gh-14479

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
2020-05-05 21:36:11 -07:00
Madhura Bhave 7634901fb3 Return null when getting a logback logger that does not exist
Closes gh-21292
2020-05-05 17:07:51 -07:00
Madhura Bhave f23d0501e4 Merge branch '2.2.x'
Closes gh-21323
2020-05-05 14:14:24 -07:00
Madhura Bhave 43e7ccd620 Detect log4j2-test.* files when using log4J2
Fixes gh-17001
2020-05-05 14:12:34 -07:00
Phillip Webb 365f65d214 Merge branch '2.2.x'
Closes gh-21321
2020-05-05 12:12:54 -07:00
Phillip Webb 98d27db767 Merge branch '2.1.x' into 2.2.x
Closes gh-21320
2020-05-05 12:12:31 -07:00
Phillip Webb df70c42f98 Allow classpath wildcards with Java 11 or above
Update `StaticResourceJars` to catch both `IOException` and
`InvalidPathException` when checking URLs. Prior to this commit only
`IOException` was caught which worked on Java 8 but not Java 11 or
above.

Fixes gh-21312
2020-05-05 12:10:31 -07:00
Phillip Webb 720d23af41 Further restrict configuration wildcard patterns
Extend wildcard restrictions to the `spring.config.name` property. Also
refine exception messages to include the property value.

Closes gh-21217
2020-05-05 10:27:35 -07:00
Andy Wilkinson f6d8c7d23c Simplify ReactiveWebServerApplicationContext.ServerManager
Closes gh-21315
2020-05-05 15:04:09 +01:00
Andy Wilkinson a688ac3f64 Improve testing of ReactiveWebServerApplicationContext
Closes gh-21314
2020-05-05 12:45:24 +01:00
Phillip Webb 9486842bad Merge branch '2.2.x'
Closes gh-21294
2020-05-01 18:31:14 -07:00
Phillip Webb 92ef515fbe Fix @DefaultValue PropertyEditor based conversion
Update `ValueObjectBinder` reattempt conversion if the `@DefaultValue`
contains a single element. Prior to this commit, single element
conversion relied on the `ArrayToObjectConverter` which isn't always
available.

Fixes gh-21264
2020-05-01 18:26:18 -07:00
Phillip Webb 07415e1603 Attempt to fix Windows CI test failure 2020-04-30 18:17:29 -07:00
Phillip Webb 57179c0d3d Add InputStreamSourceToByteArrayConverter
Add an `InputStreamSourceToByteArrayConverter` that can be used to
convert from an `InputStreamSource` (such as a `Resource`) to a
byte array.

Closes gh-21285
2020-04-30 16:40:05 -07:00
Phillip Webb d52bf83ab2 Polish 2020-04-30 16:40:05 -07:00
Madhura Bhave 8ec16bd027 Restrict wildcard pattern support for configuration files
This commit restricts how wildcards can be used in search
locations for property files. If a search location contains
a pattern, there must be only one '*' and the location should
end with a '*/'. For search locations that specify the file
name, the pattern should end with '*/<filename>'.

The list of files read from wildcard locations are now sorted
alphabetically according to the absolute path of the file.

Closes gh-21217
2020-04-30 14:17:44 -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
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
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
Phillip Webb 6fe30a8a7e Merge branch '2.2.x'
Closes gh-21175
2020-04-27 16:20:36 -07:00
Phillip Webb 36b082e8c1 Merge branch '2.1.x' into 2.2.x
Closes gh-21174
2020-04-27 16:18:55 -07:00
Phillip Webb e2705b2cfd Throw exception if classpath*: is used
Update `ConfigFileApplicationListener` to throw a better exception if
`classpath*:` is used as a location.

Closes gh-21168
2020-04-27 13:42:40 -07:00
Stephane Nicoll 4165863859 Polish contribution
See gh-21130
2020-04-27 10:41:02 +02:00
richard1230 a989879dbc Polish
See gh-21130
2020-04-27 10:38:40 +02:00
Brian Clozel 8f84147f37 Fix deprecations after Reactor Netty upgrade 2020-04-26 22:10:39 +02:00
dreis2211 54f319acd5 Remove unused method
See gh-21117
2020-04-25 09:07:13 +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
Mikael c06edbe6f4 Polish ApplicationHome
See gh-20992
2020-04-25 08:44:37 +02: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
Phillip Webb db28c0c65c Backport "Attempt to fix CI" 2020-04-23 16:35:01 -07:00
Phillip Webb 4de69c380d Attempt to fix CI 2020-04-23 15:55:10 -07:00
Phillip Webb 49345025ac Merge branch '2.2.x'
Closes gh-21105
2020-04-23 14:44:08 -07:00
Phillip Webb 93f7e2b6ba Limit when PortInUseException is thrown
Refactor `PortInUseException` logic to a single place and refine when
the exception is thrown.

Prior to this commit, we assumed that a `BindException` was only thrown
when the port was in use. In fact, it's possible that the exception
could be thrown because the requested address "could not be assigned".

We now only throw a `PortInUserException` if the `BindException` message
includes the phrase "in use".

Fixes gh-21101
2020-04-23 14:42:30 -07: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 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 bf41da5322 Update copyright year of changed files 2020-04-21 18:12:27 -07:00
Phillip Webb 03a9738f3b Merge branch '2.2.x'
Closes gh-21053
2020-04-20 17:57:57 -07:00
Phillip Webb 7d68c7c4c4 Merge branch '2.1.x' into 2.2.x
Closes gh-21052
2020-04-20 17:55:33 -07:00
Phillip Webb a2fdf23e41 Don't throw NettyWebServer on permission errors
Update `NettyWebServer` so that the `PortInUseException` is not thrown
for permission denied errors.

Fixes gh-19807
2020-04-20 17:54:13 -07:00
Phillip Webb c7611112f7 Include cause when throwing PortInUseException
Update classes that throw `PortInUseException` so that they also
include the cause. Prior to this commit the cause was not included
which could make diagnosing the real cause difficult.

See gh-19807
2020-04-20 17:54:10 -07:00
Madhura Bhave 5d56d652fb Merge branch '2.2.x'
Closes gh-21050
2020-04-20 17:10:16 -07:00
Madhura Bhave 4e0fdbee17 Process additional locations when non-default location configured
Fixes gh-20745
2020-04-20 17:08:54 -07:00
Madhura Bhave 2cac264624 Merge branch '2.2.x'
Closes gh-21049
2020-04-20 15:58:45 -07:00
Madhura Bhave af6d538781 Add support for initializing nested object when nothing bound
When using constructor binding, if no properties are bound to
a nested property, the top-level instance will be created with a
null value for the nested property.
This commit introduces support for an empty `@DefaultValue` which
indicates that an instance of the nested property must be created
even if nothing is bound to it. It honors any `@DefaultValue`
annotations that the nested property might have in its constructor.

Closes gh-18917
2020-04-20 15:39:55 -07:00
Phillip Webb de8915432a Allow square bracket notation profiles properties
Update `ConfigFileApplicationListener` so that `spring.profiles.active`
and `spring.profiles.include` can use the square bracket list notation.

Prior to this commit, only comma-separated lists could be used for
those values.

Closes gh-21006
2020-04-17 17:34:14 -07:00
Phillip Webb e3b8478621 Polish 2020-04-17 16:12:11 -07: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 fb2f6bb1af Polish
See gh-20975
2020-04-16 13:57:42 +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
Brian Clozel 939bb87a02 Merge branch '2.2.x'
Closes gh-20957
2020-04-14 14:18:48 +02:00
Brian Clozel 49bbcceda9 Fix Undertow compression config with invalid Mime Types
Prior to this commit, the Undertow compression configuration provided by
Spring Boot would fail and throw an exception for invalid MIME Types
when trying to check them against the list of configured types for
compression.

This commit ensures that invalid MIME Types are ignored and that
compression is disabled for those.

Fixes gh-20955
2020-04-14 14:15:39 +02:00
dreis2211 43936d66d3 Improve Binder performance slightly
See gh-20755
2020-04-10 14:23:56 +02:00
dreis2211 d4575bc122 Fix unused parameters
See gh-20911
2020-04-10 14:06:42 +02:00
Andy Wilkinson 8e695b0cc5 Configure OncePerRequestFilters with all dispatcher types by default
Closes gh-18953
2020-04-09 15:08:05 +01:00
Scott Frederick ba4eec87e4 Continue processing properties files on error
Prior to this commit, processing of multiple properties files
discovered using a wildcard pattern would stop on any error
encountered while processing a file or when an empty properties file
was found, causing subsequent files from the pattern to be ignored.

This commit changes the behavior such that subsequent files are
processed on error or on an empty file.

Fixes gh-20873
2020-04-08 09:26:41 -05:00
Phillip Webb 3ca896e63f Polish 2020-04-07 12:10:49 -07:00
Stephane Nicoll dc94a87694 Merge branch '2.2.x'
Closes gh-20869
2020-04-07 15:10:02 +02:00
Stephane Nicoll cb66e4a206 Update copyright year
See gh-20832
2020-04-07 15:09:27 +02:00
dreis2211 235e693906 Fix WebappLoader constructor deprecations
See gh-20832
2020-04-07 15:08:28 +02:00
Phillip Webb 01c7623f5d Polish 2020-04-02 22:08:30 -07:00
Scott Frederick 6a0d620860 Polish javadoc 2020-04-02 14:48:54 -05:00
Brian Clozel ffc2cff8de Override CloudPlatform auto-detection with configuration property
This commit adds the new "`spring.main.cloud-platform`" configuration
property. This allows applications to override the auto-detection and
force a specific Cloud Platform. This is useful for testing behavior on
a local machine or force the detection of a particular platform.

This commit also adds a new `CloudPlatform.NONE` value that allows
applications to disable the auto-detection of the Cloud Platform, thus
avoiding issues with false positives.

Closes gh-20553
2020-04-02 20:28:55 +02:00
Andy Wilkinson d8cead5457 Use accessor for in-progress async count added in Tomcat 9.0.33
Closes gh-20440
2020-04-01 11:16:54 +01:00
Andy Wilkinson 281f4d4ceb Clear system property set by log file registration
Closes gh-20790
2020-04-01 11:10:16 +01:00
Brian Clozel 9eed719c44 Do not register shutdownHook for WAR deployments
The application context shutdownHook is not needed for WAR deployments,
and we should let the Servlet container handle the application lifecycle
here.

Closes gh-19398
2020-03-24 23:11:18 +01:00
Brian Clozel eb70fd952f Turn LivenessState and ReadinessState into enums
Prior to this commit, `LivenessState` and `ReadinessState` were
immutable classes. This was done in order to have additional behavior
and information in those classes.

Because the current implementation doesn't need this, this commit turns
those classes into simple enums.
Additional state and information can be added to the
`*StateChangedEvent` classes.

See gh-19593
2020-03-24 18:25:52 +01:00
Phillip Webb 0717de723f Polish 2020-03-23 20:03:44 -07:00
Phillip Webb 9a33a723fe Update copyright year of changed files 2020-03-23 14:15:08 -07:00
Phillip Webb ce1ae11c26 Merge branch '2.2.x' 2020-03-23 14:14:47 -07:00
Phillip Webb 16b5ea3414 Update copyright year of changed files 2020-03-23 14:13:33 -07:00
Brian Clozel 05db46951d Revert "Override CloudPlatform auto-detection with property"
This reverts commit 4b7ed5efef.

See gh-20553
2020-03-23 21:23:51 +01:00
Andy Wilkinson 4cdb968efa Utilise Reactor Netty's new graceful shutdown support
Closes gh-20613
2020-03-23 10:52:31 +00:00
Stephane Nicoll 615ec8b6f5 Merge branch '2.2.x'
Closes gh-20607
2020-03-22 19:57:47 +01:00
dreis2211 6ff842441c Polish BindableTests
See gh-20604
2020-03-22 19:55:32 +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
Andy Wilkinson 6cff66ac4d Merge branch '2.2.x'
Closes gh-20590
2020-03-20 11:03:37 +00:00
Andy Wilkinson 9e7ab46ecc Merge branch '2.1.x' into 2.2.x
Closes gh-20589
2020-03-20 11:03:15 +00:00
Jordan Simpson 0d9d0f8532 Link to correct factory in TomcatReactiveWebServerFactory's javadoc
See gh-20583
2020-03-20 11:02:41 +00:00
Brian Clozel b30e5a60c5 Polish
See gh-19593
2020-03-19 20:07:35 +01:00
Stephane Nicoll 579a6ac254 Adapt tests for support for Java 14
See gh-20576
2020-03-19 14:54:33 +01:00
Andy Wilkinson f5e1bad900 Polish 2020-03-19 13:53:29 +00: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
Brian Clozel 4b7ed5efef Override CloudPlatform auto-detection with property
This commit adds a new `"spring.main.cloud-platform"` configuration
property that overrides the `CloudPlatform` detection.

This makes it easier to enable paltform-specific features when running
applications locally or when writing integration tests.

Closes gh-20553
2020-03-19 14:11:00 +01:00
Andy Wilkinson 4544785a4f Merge branch '2.2.x'
Closes gh-20544
2020-03-17 12:52:52 +00:00
Andy Wilkinson 566f79b086 Merge branch '2.1.x' into 2.2.x
Closes gh-20543
2020-03-17 12:50:45 +00:00
Andy Wilkinson b51c7386aa Fix detection of application home for paths containing spaces
Fixes gh-20531
2020-03-17 12:41:26 +00:00
Andy Wilkinson 899efc9eba Merge branch '2.2.x'
The fix was applied as part of 308e1d36. This commit merges forwards
the test that was added in 2.1.x and 2.2.x.

Fixes gh-20386 in 2.2.0.M3.
2020-03-11 09:39:02 +00:00
Andy Wilkinson e1ce21c3a5 Merge branch '2.1.x' into 2.2.x
Closes gh-20499
2020-03-11 09:34:11 +00:00
Andy Wilkinson 2b2113714d Use getTomcatWebServer to create TomcatWebServer instance
TomcatReactiveWebServerFactory's getTomcatWebServer is described as
being a hook point the can be overrideden to return a different
TomcatWebServer or to apply additional processing to the Tomcat
server. Previously, this did not work as the method was not called
to create the TomcatWebServer instance. Instead, TomcatWebServer was
instantiated and returned directly.

This commit updates TomcatReactiveWebServerFactory to call
getTomcatWebServer to create the TomcatWebServer instance. A test
has also been added to verify that the method is now used.

Fixes gh-20386
2020-03-11 09:24:27 +00:00
Andy Wilkinson e2518917f4 Tolerate different connection failure exception thrown on Java 11+
See gh-4657
2020-03-10 20:31:33 +00:00
Andy Wilkinson 19cc388861 Test Tomcat's handling of a request on an idle connection
See gh-4657
2020-03-10 12:51:32 +00:00
Andy Wilkinson b8cb61bbe0 Align embedded Jetty's graceful shutdown behaviour with standalone
Standalone Jetty will, by default, include a Connection: close header
in all responses once graceful shutdown has begun. Previously, the
way in which we were shutting Jetty down did not cause this to happen.

This commit updates JettyGracefulShutdown to shut down each connector.
This causes Jetty to send the Connection: close header, aligning its
behaviour more closely with what it does when used standalone. The
tests have also been updated to verify this behaviour and to ensure
that the correct port is used for requests even once the connector is
no longer bound and the web server no longer knows its ephemeral port.

See gh-4657
2020-03-10 12:30:25 +00:00
Andy Wilkinson 5bb66e1b85 Try to make reactive Jetty connect after shutdown test more robust
See gh-4657
2020-03-10 08:37:29 +00:00
Madhura Bhave fd50a6755f Merge branch '2.2.x'
Closes gh-20433
2020-03-09 16:08:08 -07:00
Madhura Bhave a27e145f03 Merge branch '2.1.x' into 2.2.x
Closes gh-20432
2020-03-09 16:06:47 -07:00
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