Commit Graph

4542 Commits

Author SHA1 Message Date
Stéphane Nicoll
980202f654 Merge branch '3.4.x'
Closes gh-44300
2025-02-17 11:22:14 +01:00
Tran Ngoc Nhan
d212232d9d Implement RuntimeHintsRegistrar
CLoses gh-44299
2025-02-17 11:21:04 +01:00
Stéphane Nicoll
667b161d8c Merge branch '3.4.x'
Closes gh-44295
2025-02-17 10:53:57 +01:00
Stéphane Nicoll
40eefd5cae Merge branch '3.3.x' into 3.4.x
Closes gh-44294
2025-02-17 10:53:48 +01:00
Dmytro Nosan
c28c16eb9c Destroy WebServer if ReactiveWebServerApplicationContext refresh fails
Prior to this commit, if ReactiveWebServerApplicationContext failed to
refresh, only WebServer.stop() was called.

This commit additionally invokes WebServer.destroy(), aligning
the behavior with ServletWebServerApplicationContext when a refresh
failure occurs.

See gh-44134

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
2025-02-17 10:45:34 +01:00
Andy Wilkinson
1d35deaaf0 Merge branch '3.4.x'
Closes gh-44262
2025-02-13 14:49:15 +00:00
Andy Wilkinson
e12ae999b1 Merge branch '3.3.x' into 3.4.x
Closes gh-44261
2025-02-13 14:49:02 +00:00
Andy Wilkinson
2e00552130 Move MockPkcs11Security to spring-boot-testsupport
Closes gh-44260
2025-02-13 14:48:16 +00:00
Andy Wilkinson
72413529ba Merge branch '3.4.x'
Closes gh-44256
2025-02-13 10:33:40 +00:00
Andy Wilkinson
885fcdbffc Merge branch '3.3.x' into 3.4.x
Closes gh-44255
2025-02-13 10:33:25 +00:00
Andy Wilkinson
874ee9936a Improve handling of default values when printing the banner
Previously, default values for the following properties did not work:

- application.title
- application.formatted-version
- application.version
- spring-boot.formatted-version
- spring-boot.version

Instead of the default value, an empty string was used instead. For
example, ${application.title:Title} would be replaced with "" rather
than "Title" when the application title was unavailable.

This commit improves the ResourceBanner so that a placeholder's
default value is used. An empty string will still be used when no
default value is provided. For example, ${application.title} will
be replaced with "". As before, custom properties that are not
well-known will not be replaced at all. For example
${custom.property} will remain as-is in the printed banner when
the custom.property has not been set.

Fixes gh-44137
2025-02-13 10:13:12 +00:00
Stéphane Nicoll
f866e20410 Polish "Add RuntimeHints for StackTracePrinter"
See gh-44242
2025-02-13 10:27:28 +01:00
Dmytro Nosan
5d781ffcbb Add RuntimeHints for StackTracePrinter
See gh-44242

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
2025-02-13 09:00:10 +01:00
Stéphane Nicoll
9dea179d39 Polish contribution
See gh-44247
2025-02-13 08:52:09 +01:00
Dmytro Nosan
b9772cd6f1 Polish
See gh-44247

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
2025-02-13 08:47:16 +01:00
Stéphane Nicoll
1d74d3df6f Merge branch '3.4.x'
Closes gh-44246
2025-02-12 20:25:43 +01:00
Stéphane Nicoll
f6f0daa47d Merge branch '3.3.x' into 3.4.x
Closes gh-44245
2025-02-12 20:25:20 +01:00
Stéphane Nicoll
a57fd8002f Update copyright year of changed file
See gh-44240
2025-02-12 20:22:48 +01:00
zhoudong
6177010b11 Polish variable name in ServletWebServerApplicationContext.selfInitialize()
See gh-44240

Signed-off-by: zhoudong <jearton1024@gmail.com>
2025-02-12 20:22:14 +01:00
Andy Wilkinson
0be4062116 Merge branch '3.4.x'
Closes gh-44213
2025-02-11 11:35:12 +00:00
Andy Wilkinson
30d7af4e38 Add CI with Java 24
Closes gh-44205
2025-02-11 11:34:43 +00:00
Andy Wilkinson
8dc21cf219 Merge branch '3.4.x'
Closes gh-44210
2025-02-11 11:03:28 +00:00
Andy Wilkinson
c5d21e0e63 Add TWENTY_FOUR to JavaVersion enum
Closes gh-44209
2025-02-11 11:03:02 +00:00
Andy Wilkinson
7c27cc52ee Try to fix Windows build failures
Text blocks use \n as their separator on all platforms. Update
withLineSeparatorUsesLineSeparator() to replace \n rather than
System.lineSeparator()

createPrinterWhenStandardAppliesCustomizations() limits the length of
the output. On Windows, the default \r\n line separator uses an
extra byte per separator compared to \n. Configure the printer to use
\n as a line separator so that non-whitespace output is the same on
all platforms.

See gh-43864
2025-02-11 09:43:59 +00:00
Phillip Webb
491a335ec7 Attempt to fix Windows build failures
See gh-43864
2025-02-10 23:29:55 -08:00
Phillip Webb
7433b93769 Add stack trace printer support for structured logging
Introduce a new `StackTracePrinter` interface (and a standard
implementation) that can be used to print stack traces in a custom
form. The existing `StructuredLoggingJsonProperties` have been updated
with a nested `StackTrace` record that supports common customization
options or allows a custom `StackTracePrinter` to be used.

Closes gh-43864
2025-02-10 22:34:28 -08:00
Andy Wilkinson
62b217e0da Apply mgmt access log prefix to reactive Jetty, Tomcat, and Undertow
Fixes gh-44197
2025-02-10 14:53:35 +00:00
Johnny Lim
c335f772d0 Polish
See gh-44148

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-02-07 09:21:19 +01:00
Johnny Lim
c9320de559 Use consistent exception messages in Assert calls
See gh-44044

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-02-03 13:58:59 +01:00
Phillip Webb
e207e7ca83 Polish EnvConfigData
Rename classes to align with existing `SystemEnvironment...` classes
and extract common `FileExtensionHint` logic.

See gh-41609
2025-01-31 17:33:52 -08:00
Johnny Lim
a39e1c4a09 Polish
Signed-off-by: Johnny Lim <izeye@naver.com>

See gh-44034
2025-01-31 17:04:58 +01:00
Moritz Halbritter
61d7f3783e Implement config data loader to load from environment variables
The config data loader supports the env: prefix and also accepts
extension hints.

Example: env:VAR1[.properties] reads the environment
variable 'VAR1' in properties format (using the
PropertiesPropertySourceLoader).

The PropertySourceLoaders are loaded via spring.factories.

Also adds a smoke test to test it end to end.

Closes gh-41609
2025-01-31 09:33:28 +01:00
Phillip Webb
7ec22d8668 Allow @ConfigurationPropertiesBinding to work with lambdas
Update `ConversionServiceDeducer` so that lambdas can be used with
`@ConfigurationPropertiesBinding` annotated `@Bean` methods.

This commit also allows more converter types to be detected.

Closes gh-44018
2025-01-30 16:03:26 -08:00
Phillip Webb
dcb2dd597e Polish 'Support lambda based converters via bean method signature generics'
See gh-22885
2025-01-30 15:04:24 -08:00
viviel
2921b1428e Support lambda based converters via bean method signature generics
Update `ApplicationConversionService` to support beans that are
implemented using lambdas. The updated code now uses the result of
`beanDefinition.getResolvableType()` if the type itself has unresolvable
generics.

See gh-22885
2025-01-30 15:00:49 -08:00
Andy Wilkinson
1bee5f3942 Merge branch '3.4.x'
Closes gh-44026
2025-01-30 12:12:08 +00:00
Andy Wilkinson
df32e21078 Merge branch '3.3.x' into 3.4.x
Closes gh-44025
2025-01-30 12:10:50 +00:00
Andy Wilkinson
01ec0c4fe0 Polish "Update SpringBootJoranConfigurator to use proper GraalVM format"
See gh-44021
2025-01-30 12:02:20 +00:00
Dmytro Nosan
d9f441d620 Update SpringBootJoranConfigurator to use proper GraalVM format
Before this commit, the generated name for the inner class had the
wrong format <package>.<parent>.<child> (canonical name).
GraalVM expects $ to separate the parent from the inner class.

This commit updates SpringBootJoranConfigurator to generate
an appropriate format for a class name. Specifically, an inner class
should be separated by a dollar sign, not a dot.

See gh-44021

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
2025-01-30 12:00:33 +00:00
Johnny Lim
a2217e85fe Restore shouldNotRegisterStructuredLoggingJsonMembersCustomizerRuntimeHints()
See gh-44014

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-01-29 12:51:37 -08:00
Phillip Webb
18a89f6007 Fix 'logging.structured.json.customizer' metadata
See gh-43368
2025-01-29 11:53:01 -08:00
Phillip Webb
c1cb4c51ed Use a single customizer property for JSON logging
Update `StructuredLoggingJsonProperties` no that only a single
`customizer` property is supported.

See gh-43368
2025-01-29 11:26:22 -08:00
Phillip Webb
f32b29e166 Don't use mocks for SystemStatusListenerTests
See gh-44012
2025-01-28 21:13:18 -08:00
Johnny Lim
36eeb3564e Remove duplicate test
Remove shouldNotRegisterStructuredLoggingJsonMembersCustomizer...
RuntimeHints since it duplicates shouldNotRegisterStructuredLogging...
JsonMembersCustomizerRuntimeHintsWhenCustomizerIsNotSet

See gh-44013

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-01-28 20:19:18 -08:00
Dmytro Nosan
213b2ea9bc Add more tests for SystemStatusListener and LogbackLoggingSystem
See gh-44012

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
2025-01-28 20:16:38 -08:00
Dmytro Nosan
4878fc2a28 Polish SystemStatusListener
See gh-43931

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
2025-01-28 12:03:11 -08:00
Phillip Webb
c884529561 Refine SystemStatusListener superfluous output fix
Change `SystemStatusListener` to a `OnConsoleStatusListener` to
ensure that it cannot be added twice from different threads.

Also add a local `retrospectivePrint()` that is used for non-debug
output that will print ERROR and WARN status, but not INFO.

See gh-43931
2025-01-28 11:16:00 -08:00
Dmytro Nosan
6ba8e9b089 Fix SystemStatusListener to prevent superfluous output
Fix `SystemStatusListener` so that superfluous output is not
printed when starting an application. This change ensures that
the `SystemStatusListener` is not added twice, and that
retrospective logging only occurs when `debug` is true.

See gh-43931

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
2025-01-28 11:15:55 -08:00
Moritz Halbritter
6fcbf14fc0 Add factory methods to create an SslManagerBundle from trust managers
Add two methods to create an SslManagerBundle from a given
TrustManagerFactory or from a single or multiple TrustManagers.

Both those methods use the default KeyManagerFactory.

Closes gh-43064
2025-01-28 13:37:16 +01:00
Phillip Webb
8536950826 Polish Logback StatusListener code
Introduce a `SystemStatusListener` class to simplify Logback
status listener registration for both debug and regular output.

See gh-43931
2025-01-27 22:28:31 -08:00