3229 Commits

Author SHA1 Message Date
Scott Frederick
a15c5e2498 Merge branch '2.7.x' 2022-10-12 13:47:26 -05:00
Scott Frederick
6c1103cde0 Support PEM formatted elliptic-curve TLS keys
Apply the changes from e0c79ce598f62f4a4404124a5abf1bde04b49057
to the `PrivateKeyParser` used for web server SSL configuration.

See gh-32646
2022-10-12 13:25:58 -05:00
Sébastien Deleuze
5b17cacb1f Remove spring.xml.ignore flag usages
This commit is a follow-up of spring-projects/spring-framework#29277.

See gh-32653
2022-10-12 13:27:29 +01:00
Andy Wilkinson
3ab4606584 Make runScripts method of DB initializer more extensible
Closes gh-29137
2022-10-12 11:52:38 +01:00
Andy Wilkinson
d351086a06 Adapt to breaking changes to AOT processing entry points
See gh-32550
2022-10-10 22:02:25 +01:00
Andy Wilkinson
f2f4a4a40e Space out smart lifecycle phases used for graceful shutdown
Previously, the web server was stopped in the last smart lifecycle
phase with graceful shutdown having begun in the previous phase.
This lack of space between the two phases and after the stop phase
made it hard to for other smart lifecycles to be part of the
graceful shutdown process.

This commit moves stop to 1024 phases before the final phase and
graceful shutdown a further 1024 phases before that, allowing
other smart lifecycles to run between graceful shutdown and stop
and also after stop.

Closes gh-31714
2022-10-06 13:11:29 +01:00
Stephane Nicoll
4ffc421b3c Adapt to Spring Framework API change 2022-10-06 09:58:05 +02:00
Stephane Nicoll
e94a1f7988 Replace outcome of JsonMixins scanning in AOT optimized contexts
This commit adds an AOT contribution that replaces the scanning of
@JsonMixin by a mapping in generated code. This makes sure that such
components are found in a native image.

Closes gh-32567
2022-10-05 15:55:33 +02:00
Phillip Webb
e0b67889a8 Use Stream.toList instead of Stream.collect when possible
Update code to make use of `Stream.toList()` whenever possible.

Closes gh-28177
2022-10-04 00:29:22 -07:00
Johnny Lim
d6cfcd0825 Fix compile errors
Closes gh-32569
2022-10-02 18:38:28 +02:00
Phillip Webb
2c39345794 Merge branch '2.7.x' 2022-09-30 21:18:20 -07:00
Phillip Webb
0e98a577fe Merge branch '2.6.x' into 2.7.x 2022-09-30 21:18:09 -07:00
Phillip Webb
75f4d9e3fd Fix empty @DefaultValue annotation test failures on Java 17
See gh-32559
2022-09-30 21:16:48 -07:00
Phillip Webb
bf96816654 Merge branch '2.7.x'
Closes gh-32564
2022-09-30 20:16:53 -07:00
Phillip Webb
1eb0dd5e39 Merge branch '2.6.x' into 2.7.x
Closes gh-32563
2022-09-30 20:16:36 -07:00
Phillip Webb
efc431bdc4 Support empty @DefaultValue annotations on aggregates and optional
Update `ValueObjectBinder` to allow an empty `@DefaultValue` to be
used on map, collection, arrays and optional types.

Closes gh-32559
2022-09-30 18:21:54 -07:00
Scott Frederick
d25a99692f Replace Spring Boot TestCompiler with Spring Framework's version
See gh-31266
2022-09-30 15:58:11 -05:00
Phillip Webb
8b2fd6a05a Fix formatting 2022-09-30 12:00:14 -07:00
Phillip Webb
63f6d872e0 Test addAotGeneratedInitializerIfNecessary logic
Closes gh-32555
2022-09-30 11:24:04 -07:00
Stephane Nicoll
e2dd0ef9a4 Adapt AotProcessor to changes in Spring Framework
Closes gh-32560
2022-09-30 16:47:03 +02:00
Andy Wilkinson
51df7813a5 Remove code deprecated in 2.x and add since and forRemoval attributes
Closes gh-32548
Closes gh-32549
2022-09-30 14:39:05 +01:00
Stephane Nicoll
f0e40bb00d Avoid NoSuchMethodError by assigning ApplicationContextInitializer
See gh-32555
2022-09-30 10:54:35 +02:00
Phillip Webb
7a5b61fd19 Replace AotApplicationContextInitializer with Framework version 2022-09-29 16:37:26 -07:00
Brian Clozel
a0735eb3fb Migrate remaining usage of httpclient API
This commit migrates our remaining usage of the httpclient 4.x to use
instead httpclient5, now that the 4.x support has been removed in
`RestTemplate`.

Closes gh-32461
2022-09-29 18:55:42 +02:00
Brian Clozel
3ac034e18a Fail when setReadTimeout on httpclient5 request factory
Prior to this commit, the `RestTemplateBuilder` would offer a generic
`setReadTimeout` method to configure the read timeout on the underlying
`ClientHttpRequestFactory`. This would be done in a reflective fashion,
considering that all implementations align with this behavior.

This option cannot be provided for HttpClient5 at the
`ClientHttpRequestFactory` level anymore, so this has been deprecated
in Spring Framework 6.0 and will log a warning. In order to align with
our existing behavior (throwing exceptions if the option cannot be set),
this commit ensures that exceptions are also thrown if the method is
marked as deprecated.

See gh-32461
2022-09-29 18:55:41 +02:00
Brian Clozel
58f3054624 Adapt RestTemplate factory auto-detection
This commit adapts the auto-detection of `ClientHttpRequestFactory` to
look for an httpclient5 class.

See gh-32461
2022-09-29 18:55:41 +02:00
Brian Clozel
5fb2a50ad0 Adapt build dependencies to httpclient5
As htttpclient 4.x is not supported anymore by `RestTemplate`, this
commit changes such dependencies to httpclient5 instead. In some cases,
the httpclient 4.x was transitively brought by a non-Spring dependency.

See gh-32461
2022-09-29 18:55:41 +02:00
Stephane Nicoll
3702c71fc1 Adapt to Spring AOT changes 2022-09-29 18:55:41 +02:00
Andy Wilkinson
17953eeb33 Merge branch '2.7.x'
Closes gh-32544
2022-09-29 11:41:15 +01:00
Andy Wilkinson
3ef633b096 Merge branch '2.6.x' into 2.7.x
Closes gh-32543
2022-09-29 11:39:42 +01:00
Andy Wilkinson
84a25c7dcf Configure Log4j2 classpath overrides consistently
Closes gh-32537
2022-09-29 11:25:21 +01:00
Andy Wilkinson
0bfa9cd704 Upgrade to Logback 1.4 and SLF4J 2.0
Closes gh-12649
2022-09-28 21:14:08 +01:00
Brian Clozel
bf5bd4f91c Upgrade to SnakeYAML 1.33
Closes gh-32522
2022-09-27 14:51:04 +02:00
Stephane Nicoll
f6f545dbf1 Merge branch '2.7.x'
Closes gh-32510
2022-09-27 08:28:40 +02:00
Stephane Nicoll
33680e5acc Merge branch '2.6.x' into 2.7.x
Closes gh-32509
2022-09-27 08:28:15 +02:00
Stephane Nicoll
0457536d72 Polish "Avoid using JUnit 4 assertions"
See gh-32504
2022-09-27 08:24:03 +02:00
dreis2211
cee353fba6 Avoid using JUnit 4 assertions
See gh-32504
2022-09-27 08:11:47 +02:00
Johnny Lim
7f36fb155d Polish JavaVersionTests.currentJavaVersionNineteen()
See gh-32489
2022-09-23 17:25:12 +02:00
Andy Wilkinson
26eff5ae7a Publish ApplicationPreparedEvent before AOT processing abandons run 2022-09-23 12:02:25 +01:00
Scott Frederick
08022ba86e Remove support for locating imports using spring.factories
With this commit, loading `@AutoConfiguration`,
`@ImportAutoConfiguration`, and `@ManagementContextConfiguration`
classes is supported with `.imports` files only. Support for loading
these classes with `spring.factories` is removed.

Closes gh-29699
2022-09-21 17:34:51 -05:00
Andy Wilkinson
6b8575b001 Fix constructor binding to Kotlin data class with default values
Closes gh-32416
2022-09-21 21:35:47 +01:00
Andy Wilkinson
52522b87f0 Merge branch '2.6.x' into 2.7.x
Closes gh-32393
2022-09-15 11:57:28 +01:00
Andy Wilkinson
77f428498f Compile against SnakeYAML 1.32 and test against older versions
Closes gh-32392
2022-09-15 11:55:44 +01:00
Phillip Webb
4d037c3003 Update SpringBootContextLoader to support AOT
Update `SpringBootContextLoader` so that it now implements the
`AotContextLoader` interface. The `ContextLoaderHook` will abandon
at `contextLoaded` if the test class is being AOT processed.

This commit also introduces a new `AotApplicationContextInitializer`
which allows us to plug-in an alternative AOT application context
listener when the `SpringApplication` is running in test mode.

Closes gh-31965
2022-09-14 22:37:47 -07:00
Phillip Webb
d3957dfa3e Provide a public API for SpringApplication hooks
Create a new public SpringApplication Hook API based on the existing
`SpringApplicationRunListener` interface.

The previous package-private `SpringApplicationHooks` class has been
replaced with a public `SpringApplicationHook` interface which acts as
a factory that can create additional `SpringApplicationRunListener`
instances to hook in.

The boolean result from the previous `preRefresh` method has been
replaced with an `AbandonedRunException` which can be thrown from
the `SpringApplicationRunListener`.

Closes gh-32301
2022-09-14 22:34:50 -07:00
Phillip Webb
88913b11ce Allow additional listeners registration in early events
Update `EventPublishingRunListener` so that event listeners may add
additional listeners to the `SpringApplication` during early events.

Prior to this commit, the listeners were collected only once which
meant that if a listener for an `ApplicationStartingEvent` called
`application.addListener(...)`, it would be ignored.

Closes gh-32300
2022-09-14 22:34:39 -07:00
Phillip Webb
6955ed9dcf Make EventPublishingRunListener package private
Closes gh-32299
2022-09-14 13:50:27 -07:00
Stephane Nicoll
6fb70d143d Map R2DBC Pool 'minIdle' property
Closes gh-32332
2022-09-14 13:56:44 +02:00
Stephane Nicoll
d4a88041dc Upgrade to R2DBC Bom Borca-SR2
Closes gh-32328
2022-09-14 11:01:19 +02:00
Andy Wilkinson
421943f3cf Add reflection hints for retrieving Undertow's ports
Closes gh-32303
2022-09-13 12:13:06 +01:00