Commit Graph

1973 Commits

Author SHA1 Message Date
Phillip Webb c284edde67 Update copyright year of changed files 2020-09-17 00:31:01 -07:00
Phillip Webb 1ae1436211 Refactor BootstrapRegistry support
Refactor `BootstrapRegistry` support following initial prototype work
with the Spring Cloud team.

This update splits the `BootstrapRegistry` API into `BootstrapRegistry`,
`BootstrapContext` and  `ConfigurableBootstrapContext` interfaces and
moves it to the same package as `SpringApplication`.

A new `Bootstrapper` interface has been introduced that can be added
to the `SpringApplication` to customize the `BootstrapRegistry` before
it's used.

Closes gh-23326
2020-09-17 00:31:00 -07:00
Phillip Webb 10ad53afbd Fix FailureAnalyzer package tangle
Move `IncompatibleConfigurationFailureAnalyzer` to fix a package tangle.

Closes gh-23385
2020-09-17 00:31:00 -07:00
Phillip Webb 6509310fdb Fix DefaultPropertiesPropertySource package tangle
Relocate `DefaultPropertiesPropertySource` to fix a package tangle.

Closes gh-23383
2020-09-17 00:31:00 -07:00
Stephane Nicoll fa03f75d21 Upgrade to Undertow 2.2.0.Final
Closes gh-23367
2020-09-16 14:40:12 +02:00
Phillip Webb 43010ebf47 Merge branch '2.3.x'
Closes gh-23329
2020-09-16 00:28:57 -07:00
Phillip Webb f590225c82 Merge branch '2.2.x' into 2.3.x
Closes gh-23328
2020-09-16 00:28:29 -07:00
Phillip Webb bd87ba33d0 Use ephemeral ports for RSocket tests
Closes gh-23325
2020-09-16 00:15:19 -07:00
Phillip Webb 5f49d4a8d7 Rename @ConfigurationPropertiesImport
Rename `@ConfigurationPropertiesImport` to
`@ImportAsConfigurationPropertiesBean` and also refine the registrar
so that it can be used with type directly annotated with
`@ConfigurationProperties`.

Closes gh-23172
2020-09-15 11:36:00 -07:00
Stephane Nicoll 201bfd2b0c Upgrade to Netty 4.1.52.Final
Closes gh-23313
2020-09-15 14:55:38 +02:00
Phillip Webb c857a743a0 Rename @ImportConfigurationPropertiesBean
Rename `@ImportConfigurationPropertiesBean` to
`@ConfigurationPropertiesImport`.

Closes gh-23172
2020-09-14 19:35:10 -07:00
Andy Wilkinson 7562c4eb6f Adapt to WebClient's new exception wrapping
See spring-projects/spring-framework#23842
See gh-23170
2020-09-14 15:08:56 +01:00
Stephane Nicoll f4a84d3b63 Upgrade to Netty 4.1.52.Final
Closes gh-23287
2020-09-14 13:37:57 +02:00
Stephane Nicoll 492e1a4c0f Upgrade to Netty 4.1.52.Final
Closes gh-23269
2020-09-14 11:28:55 +02:00
Phillip Webb a95dbb5d8f Merge branch '2.3.x'
Closes gh-23261
2020-09-13 11:02:54 -07:00
Phillip Webb 5294c34807 Merge branch '2.2.x' into 2.3.x
Closes gh-23260
2020-09-13 11:02:19 -07:00
Phillip Webb 326a56da01 Support validation of bound map key entries
Update `ValidationBindHandler` so that pushed fields that reference
map keys can be used. This fixes a regression that was introduced in
commit 4483f417 when we switched to a `AbstractBindingResult` that no
longer required public getters/setters.

Closes gh-20350
2020-09-13 10:54:30 -07:00
Brian Clozel 0715750eb3 Polish "Add SSL support to RSocketServer"
See gh-19399
2020-09-10 15:14:55 +02:00
cbono b4810b8b91 Add SSL support to RSocketServer
See gh-19399
2020-09-10 15:14:55 +02:00
Phillip Webb f260c77fe3 Add @ImportConfigurationPropertiesBean support
Add repeatable `@ImportConfigurationPropertiesBean` annotation that can
be used to import types and treat them as `@ConfigurationProperties`
beans. This annotation is specifically designed to support third-party
classes that can't contain any Spring annotations.

Closes gh-23172
2020-09-09 22:05:49 -07:00
Phillip Webb df944c6354 Polish 2020-09-08 11:19:33 -07:00
Brian Clozel 6be4409fde Add mainApplicationClass tag to startup step
This commit adds a new tag to the `"spring.boot.application.starting"`
startup step.

Closes gh-23162
2020-09-07 18:04:42 +02:00
Brian Clozel fdf21da7ba Add buffering ApplicationStartup variant
As of spring-projects/spring-framework#24878, Spring Framework provides
an `ApplicationStartup` infrastructure that applications can use to
collect and track events during the application startup phase.

This commit adds a new `BufferingApplicationStartup` implementation that
buffer `StartupStep`s and tracks their execution time. Once buffered,
these steps can be pushed to an external metrics system or drained
through a web endpoint, to a file...

Closes gh-22603
2020-09-07 18:04:31 +02:00
Andy Wilkinson b2cc442539 Merge branch '2.3.x'
See gh-23204
2020-09-07 14:17:11 +01:00
Andy Wilkinson 86fc4dea2a Merge branch '2.2.x' into 2.3.x
See gh-23203
2020-09-07 14:16:37 +01:00
Andy Wilkinson 5f00d91176 Restore identifying org.hsqldb.jdbcDriver as embedded
See gh-23036
2020-09-07 14:03:10 +01:00
Andy Wilkinson 9bf6e1ceda Merge branch '2.3.x'
Closes gh-23205
2020-09-07 13:34:47 +01:00
Andy Wilkinson 116b2472a7 Merge branch '2.2.x' into 2.3.x
Closes gh-23200
2020-09-07 13:34:14 +01:00
Andy Wilkinson 115ea87b14 Restore ordering of ErrorPageFilter lost in 49f8943
See gh-19471
2020-09-07 13:33:43 +01:00
Andy Wilkinson 3dfe11e9e3 Merge branch '2.3.x'
Closes gh-23204
2020-09-07 13:30:26 +01:00
Andy Wilkinson d39b107917 Merge branch '2.2.x' into 2.3.x
Closes gh-23203
2020-09-07 13:30:02 +01:00
Andy Wilkinson c948c70c5a Align EmbeddedDatabaseConnection with DatabaseDriver
Fixes gh-23036
2020-09-07 10:13:55 +01:00
Stephane Nicoll 73c039e4b8 Fix use of deprecated methods 2020-09-07 09:42:19 +02:00
Stephane Nicoll d2eeb9524f Merge branch '2.2.x' into 2.3.x
See gh-23183
2020-09-07 09:17:51 +02:00
Stephane Nicoll 4b5a3f4ff9 Start building against Spring Framework 5.2.9 snapshots
See gh-23182
2020-09-07 08:47:57 +02:00
Stephane Nicoll 1b68efa478 Polish "Upgrade to Assertj 3.17.2"
See gh-23179
2020-09-07 07:59:50 +02:00
Eddú Meléndez db8d117d38 Upgrade to Assertj 3.17.2
See gh-23179
2020-09-07 07:54:25 +02:00
Brian Clozel f50927f7a1 Start building against Spring Framework 5.3.0.RC1 SNAPSHOTs
See gh-23170
2020-09-02 17:47:06 +02:00
Andy Wilkinson 2c981d99a2 Avoid unnecessary reflection in TaskExecutorBuilder
Closes gh-23107
2020-09-01 12:46:22 +01:00
Phillip Webb 446dfe4ad7 Merge branch '2.3.x'
Closes gh-23153
2020-08-31 15:31:49 -07:00
Phillip Webb 0d80f46cef Remove node and recursive limits for YAML
Update `OriginTrackedYamlLoader` to remove node limits and recursive
parsing restrictions. SnakeYAML 1.26 introduced these options in order
to protect against the "billion laugh attacks" but since we consider
`application.yml` files to be trusted, we don't need these restrictions.

Fixes gh-23096
2020-08-31 15:27:37 -07:00
Phillip Webb 0ddd1b6ce8 Refine global optional config data opt-out
Rename the opt-out property and use an enum in case we want to provide
additional options in the future.

Closes gh-23097
2020-08-28 16:30:39 -07:00
Phillip Webb bebb4363d6 Merge branch '2.3.x' 2020-08-28 15:31:09 -07:00
Phillip Webb 98f432681f Merge branch '2.2.x' into 2.3.x 2020-08-28 15:30:57 -07:00
Phillip Webb 611447c4d5 Fix checkstyle issue caused by polish commit
See gh-22946
2020-08-28 15:30:27 -07:00
Phillip Webb 21897a7097 Merge branch '2.3.x'
Closes gh-23136
2020-08-28 15:23:26 -07:00
Phillip Webb 84f281fbfd Merge branch '2.2.x' into 2.3.x
Closes gh-23135
2020-08-28 15:23:10 -07:00
Phillip Webb 35994b061c Polish 'Remove ResourceUtils.getURL logging config check'
Extend `initializeSystem` to search the exception stack for a
FileNotFoundException before reporting the error. This allows
us to provide a similar stack trace to the one that used to be
thrown when we had the `ResourceUtils.getURL` check.

See gh-22946
2020-08-28 15:16:12 -07:00
Ralph Goers 684b65e80c Remove ResourceUtils.getURL logging config check
Remove `ResourceUtils.getURL` checking from `LoggingApplicationListener`
so that logging systems can implement custom location support.

Prior to this commit, we checked in the listener if the specified config
location could be opened as a URL. This unfortunately prevents Log4J
extensions such as `log4j-spring-cloud-config-client` from implementing
configurable SSL and credentials support.

See gh-22946
2020-08-28 15:07:06 -07:00
Phillip Webb 3c1e141aef Add parent origin support to config data
Allow `ConfigDataLocationResolvers` to access `Origin` information for
locations so that they can be used as a parent origin of loaded items.

The `ResourceConfigData...` classes have been reworked so that loaded
`PropertySources` include the parent origin.

See gh-23018
2020-08-27 22:15:51 -07:00
Phillip Webb 960651c15a Add parent origin support
Update the `Origin` interface to include a default `getParent()` method
which can be used to get the parent origin. The `TextResourceOrigin`
has been updated to implement the method against the source `Resource`.
A new `OriginTrackedResource` implementation allows any `Resource` to
be decorated and carry an optional `Origin`.

Ultimately this will allow us to include parent `Origin` information
on properties loaded via a `PropertySourceLoader` without needing any
changes to that interface.

See gh-23018
2020-08-27 22:05:04 -07:00
Phillip Webb bc5958c398 Polish test method names
Polish method names to remove "should".
2020-08-27 21:28:16 -07:00
Phillip Webb c613d119f7 Support binding with multiple constructors
Update `DefaultBindConstructorProvider` so that binding to objects with
multiple constructors is allowed, as long as there is only one
non-public candidate.

Closes gh-23117
2020-08-27 21:28:16 -07:00
Phillip Webb a2530ad5f1 Fix global optional config data opt-out test
See gh-23097
2020-08-26 21:06:21 -07:00
Phillip Webb aa0f204732 Add global optional config data opt-out
Support a `spring.config.all-locations-optional` property which can be
set to `true` if all config data locations should be considered
optional.

Closes gh-23097
2020-08-26 20:11:40 -07:00
Phillip Webb c1be5cb5e0 Add limited support for spring.profiles.include
Restore support for the `spring.profiles.include` property but only
for non-profile specific documents.

Closes gh-22944
2020-08-26 15:43:28 -07:00
Johnny Lim e48af31ced Polish
See gh-23081
2020-08-26 10:47:45 +02:00
Andy Wilkinson 4320b3a919 Merge branch '2.3.x'
Closes gh-23089
2020-08-26 09:04:09 +01:00
Andy Wilkinson 4143c31f9c Merge branch '2.2.x' into 2.3.x
Closes gh-23087
2020-08-26 09:03:46 +01:00
Andy Wilkinson 6f047c8356 Polish "Handle null RSocketServer address when setting port property"
See gh-23084
2020-08-26 08:52:57 +01:00
spencergibb f08f948c3e Handle null RSocketServer address when setting port property
See gh-23084
2020-08-26 08:52:57 +01:00
Phillip Webb d0fce0553f Support extensionless file imports
Update `ResourceConfigDataLocationResolver` so that it can import files
that have no file extension.

Closes gh-22280
2020-08-25 13:57:10 -07:00
Phillip Webb 081a7ee28c Throw exception if import locations are not found
Update config data processing code so that import locations are
mandatory by default. Any import request will now throw a
`ConfigDataLocationNotFoundException` if the specified import
location cannot be found. For optional imports, the user can
use the `optional:` prefix to indicate that the application should
continue to start, even if the location does not exist.

Closes gh-23032
2020-08-25 12:56:55 -07:00
dreis2211 33cd875cb8 Simplify InputStream assertions
See gh-23052
2020-08-24 11:35:17 +02:00
Phillip Webb 758df17c7d Allow placeholders to be used in imports
Allow `${..}` property placeholders to be used in `spring.config.import`
properties. Prior to this commit, placeholders were not resolved when
binding the `ConfigDataProperty` instance. Furthermore, binding happened
too early for all placeholders to be resolved correctly. The
`ConfigDataEnvironmentContributor` class now has two states for imported
contributors, `UNBOUND_IMPORT` has the initial unbound state and is
eventually replaced with a `BOUND_IMPORT`.

Closes gh-23020
2020-08-23 20:27:12 -07:00
dreis2211 f7d6f38368 Fix typos in tests
See gh-23050
2020-08-22 11:44:19 -07:00
Phillip Webb d123c924a0 Add BootstrapRegisty support for config data
Expose the `BootstrapRegisty` to both `ConfigDataLocationResolver` and
`ConfigDataLoader` implementations. The registry is exposed via the
context interfaces and may be used to reuse instances that are expensive
to create. It may also be used to ultimately register beans with the
`ApplicationContext`.

Closes gh-22956
2020-08-20 21:49:03 -07:00
Phillip Webb 2260657781 Add BootstrapRegistry for long lived instances
Add a simple `BootstrapRegistry` that can be used to store and share
object instances across `EnvironmentPostProcessors`. The registry
can be injected into the constructor of any `EnvironmentPostProcessor`.

Registrations can also perform additional actions when the
`ApplicationContext` has been prepared. For example, they could register
the the bootstrap instances as beans so that they become available to
the application.

See gh-22956
2020-08-20 21:45:02 -07:00
Phillip Webb 167e31d564 Provide a simple Instantiator utility class
Make `Instantiator` a public utility class so that it can be used
by other parts of the codebase.

Closes gh-23029
2020-08-20 13:02:17 -07:00
Phillip Webb ba2ab3363b Merge branch '2.2.x' into 2.3.x 2020-08-18 15:38:53 -07:00
Phillip Webb 4e76138ebc Update copyright year of changed files 2020-08-18 15:37:59 -07:00
Phillip Webb 9c6f0d8f7e Merge branch '2.3.x'
Closes gh-22984
2020-08-17 12:40:18 -07:00
Scott Frederick c2ec46c5b1 Polish "Fix include exception handling in DefaultErrorAttributes"
See gh-22750
2020-08-17 13:33:59 -05:00
Lopfest c49605cd7b Fix include exception handling in DefaultErrorAttributes
This commit fixes a problem with the handling of the includeException
field in DefaultErrorAttributes.

See gh-22750
2020-08-17 13:33:59 -05:00
Phillip Webb 7a85373fea Merge branch '2.3.x'
Closes gh-22965
2020-08-14 17:09:13 -07:00
Phillip Webb 1675b47637 Merge branch '2.2.x' into 2.3.x
Closes gh-22964
2020-08-14 17:08:48 -07:00
Phillip Webb 89a6f83344 Fix and improve SpringApplicationBuilder javadoc
Update SpringApplicationBuilder.properties method javadoc to fix
inaccuracies and apply more consistency.

Closes gh-22962
2020-08-14 17:06:39 -07:00
Phillip Webb 3e939cbabd Polish method order 2020-08-14 17:02:13 -07:00
Phillip Webb 310ef6e999 Rename volumemount -> configtree
Closes gh-22941
2020-08-13 13:28:25 -07:00
Phillip Webb 5579f9d1c4 Polish 2020-08-13 11:53:36 -07:00
dreis2211 c00d5c5643 Introduce @ForkedClassPath for testing unmodified class path
See gh-22710
2020-08-12 17:21:31 +01:00
Phillip Webb bc3f028a1f Fix spring.config.activate.on-profile metadata
Fix the `spring.config.activate.on-profile` entry which was accidentally
entered as `spring.config.import.on-profile`.

See gh-22497
2020-08-12 07:13:11 -07:00
Madhura Bhave 4799b26d2c Merge branch '2.3.x'
Closes gh-22897
2020-08-11 12:25:48 -07:00
Madhura Bhave eeca767c49 Merge branch '2.2.x' into 2.3.x
Closes gh-22895
2020-08-11 12:22:43 -07:00
Madhura Bhave cdbb7f441a Do not ignore null/empty values from SPRING_APPLICATION_JSON
Fixes gh-21542
2020-08-11 12:22:08 -07:00
Phillip Webb a062b51efb Polish 'Allow step action to be optional'
See gh-22845
2020-08-11 10:57:03 -07:00
Marten Deinum 0e5be0ab62 Allow step action to be optional
Update `SpringApplicationRunListeners` so that the step action
is optional and does not need to call `end()`.

This commit also introduces a test for the failure case showing
that there is a missed call to end with the initial solution.

See gh-22845
2020-08-11 10:54:00 -07:00
Andy Wilkinson 969dd35e45 Upgrade to Mockito 3.4.6
Closes gh-22838
2020-08-10 15:22:03 +01:00
Stephane Nicoll dedf09d20f Merge branch '2.3.x'
Closes gh-22848
2020-08-10 14:23:56 +02:00
Stephane Nicoll f466734801 Merge branch '2.2.x' into 2.3.x
Closes gh-22847
2020-08-10 14:23:31 +02:00
Stephane Nicoll 333af3d4e7 Polish "Propagate the cause that led Reactor"s debug agent to fail"
See gh-22777
2020-08-10 14:21:44 +02:00
davidbilge 12c419054a Propagate the cause that led Reactor"s debug agent to fail
Prior to this commit, DebugAgentEnvironmentPostProcessor throws a
RuntimeException with a generic error message if its initialization
fails. The causing exception is discarded, which makes error analysis
unnecessarily difficult.

This commit attaches the cause to the newly thrown RuntimeException.

See gh-22777
2020-08-10 14:21:26 +02:00
Brian Clozel 7e159c346e Adapt to MonoProcessor deprecations in Reactor
This commit updates our usage of `MonoProcessor` after the deprecations
introduced in reactor/reactor-core#1053
2020-08-07 19:03:53 +02:00
Brian Clozel 9343266c4f End StartupSteps only once in SpringApplicationRunListeners
Fixes gh-22776
2020-08-07 19:03:53 +02:00
Brian Clozel 6336007038 Merge branch '2.3.x'
Closes gh-22826
2020-08-07 16:01:25 +02:00
Brian Clozel fea535d176 Update HTTP/2 auto-configuration for Jetty
Prior to this commit, the HTTP/2 server auto-configuration for Jetty
would require Conscrypt as a hard dependency.

This commit updates the auto-configuration for more flexibility and now
allows the following deployments:

* JDK9+ with the JDK ALPN implementation
* JDK8u252+ with the backported ALPN implementation
* Conscrypt with no JDK requirement

The auto-configuration now improves detection and guides developers in
case there is a missing `jetty-alpn-*-server` dependency.

The reference docs in the HOWTO section has been updated accordingly.

Closes gh-22188
2020-08-07 15:42:23 +02:00
Phillip Webb f8c8b65cbf Add ConfigDataEnvironmentPostProcessor.applyTo
Add static methods to `ConfigDataEnvironmentPostProcessor` so that
post-processing can be applied to `Environment` instances directly.

Closes gh-22601
2020-08-06 14:35:43 -07:00
Phillip Webb f7f4ff0ac9 Update copyright year of changed files 2020-08-06 14:35:43 -07:00
Phillip Webb dfd233cada Polish 2020-08-06 14:35:43 -07:00
Stephane Nicoll dac63fc3e5 Polish 2020-08-06 17:35:01 +02:00