Commit Graph

110 Commits

Author SHA1 Message Date
Stéphane Nicoll 7a73925c90 Adapt AMQP auto-configuration to core retry semantics
This commit adapts the auto-configuration of AMQP message listeners
and RabbitTemplate moving away from Spring Retry.

One important change is that message listeners now only require a
RetryPolicy. To make the callback explicit, two customizers have been
introduced to clearly separate the scope of the customization:

* RabbitTemplateRetrySettingsCustomizer for the client-side and usage
of RabbitTemplate.
* RabbitListenerRetrySettingsCustomizer for message listeners.

Closes gh-47122
2025-09-09 16:55:34 +02:00
Moritz Halbritter 0fc1a40f3b Polish nullability annotations
See gh-46926
2025-09-09 15:08:44 +02:00
Moritz Halbritter 2e8428b760 Remove NullAway suppressions where possible
See gh-46926
2025-09-09 12:02:19 +02:00
Moritz Halbritter 634933b3e5 Polish nullability annotations
See gh-46926
2025-09-09 11:34:35 +02:00
Phillip Webb 0623275641 Add nullability to `JsonWriter`
See gh-46926
2025-09-05 19:57:52 -07:00
Phillip Webb 239f384ac0 Update PropertyMapper to better support nullability
Refactor `PropertyMapper` so that it no longer calls adapter or
predicate methods by default when the source value is `null`. This
effectively makes all default calls the same as using
`alwaysWhenNotNull` in the previous generation of the code.

For the limited times when you do need to deal with `null` values, the
new `always()` method can be used.

For example,

	map.from(source::method).to(destination::method);

Will not call `destination.method(...)` if `source.method()` returns
`null`.

Where as:

	map.from(source::method).always().to(destination::method);

Will call  `destination.method(null)` if `source.method()` returns
`null`.

This update provides clearer semantics for the API and allows for better
JSpecify nullability annotations. It has also simplified much of our
existing property mapper code.

Closes gh-47024

Co-authored-by: Moritz Halbritter <moritz.halbritter@broadcom.com>
2025-09-05 14:43:33 -07:00
Moritz Halbritter 63adb82145 Merge branch '3.5.x'
Closes gh-47055
2025-09-05 14:17:39 +02:00
Moritz Halbritter 552c145213 Improve null-safety of core/spring-boot
See gh-46926
2025-09-03 15:11:10 +02:00
Moritz Halbritter e70edced2f Merge branch '3.5.x'
Closes gh-47020
2025-09-02 15:12:58 +02:00
Andy Wilkinson d353038c58 Update Jackson support to require Jackson 3
Closes gh-45535
2025-09-02 11:37:09 +01:00
Moritz Halbritter ff11e21d73 Polish "Improve Log4j core configuration file detection for Log4j 3"
See gh-46409
2025-08-29 11:09:23 +02:00
Piotr P. Karwasz 16439ad6e3 Improve Log4j core configuration file detection for Log4j 3
Log4j Core 3 has undergone significant modularization and no longer uses
optional parser dependencies. This change requires updates to
Spring Boot's configuration file detection logic to properly support
both Log4j Core 2 and 3.

**Updated configuration file detection**
  Spring Boot now detects configuration formats based on the presence of
   ConfigurationFactory implementations, instead of relying on optional
   parser dependencies (as was the case in Log4j Core 2).

**Improved classloader usage for reflection**
  Reflection logic now uses the classloader that loaded Log4j Core,
  rather than the one associated with the Spring Boot context,
  ensuring greater compatibility in modular environments.

* **Adjusted configuration file lookup order**
  The lookup now prioritizes configuration files specified via
  properties over automatically discovered ones, improving consistency
  with Log4j Core.

**Support for contextual configuration files**
  Files named in the form `log4j2<contextName>.<extension>` are now also
  supported.

These changes ensure compatibility with Log4j Core 3 while preserving
support for Log4j Core 2, improving Spring Boot's flexibility in
detecting and loading user-defined logging configurations.

See gh-46409

Signed-off-by: Piotr P. Karwasz <piotr@github.copernik.eu>
2025-08-29 11:06:49 +02:00
Moritz Halbritter da2365b8cb Merge branch '3.5.x'
Closes gh-46987
2025-08-28 16:58:28 +02:00
Moritz Halbritter 5656c13f31 Protect against null key insertion in MapConfigurationPropertySource
See gh-46926
2025-08-28 10:10:56 +02:00
Moritz Halbritter 6723cfd809 Improve null-safety of core/spring-boot
See gh-46926
2025-08-28 09:59:08 +02:00
Moritz Halbritter 43f5eb5f79 Improve null-safety of core/spring-boot
See gh-46926
2025-08-26 14:22:54 +02:00
Moritz Halbritter dc3fe1b17d Improve null-safety of core/spring-boot-testcontainers
See gh-46926
2025-08-26 14:22:53 +02:00
Moritz Halbritter 717ddac137 Improve null-safety of core/spring-boot-test
See gh-46926
2025-08-26 14:22:53 +02:00
Moritz Halbritter 7ad90fb963 Improve null-safety of core/spring-boot-docker-compose
See gh-46926
2025-08-26 14:22:53 +02:00
Moritz Halbritter c76b087025 Improve null-safety of core/spring-boot-autoconfigure
See gh-46926
2025-08-26 14:22:53 +02:00
Moritz Halbritter ca7e025dfd Improve null-safety of buildpack/spring-boot-buildpack-platform
See gh-46926
2025-08-26 14:22:53 +02:00
Andy Wilkinson 50e5421467 Roll back to Log4j 2.24
This reverts:

 - 7a5e77fe67
 - 1590e4d2b3
 - 8cf0d17fbc

See gh-46334, gh-46372
2025-08-21 18:23:35 +01:00
Stéphane Nicoll 1590e4d2b3 Fix broken assertions on Windows
See gh-46334
2025-08-21 17:52:43 +02:00
Stéphane Nicoll 9c1e0e624e Polish "Avoid using deprecated Log4J constructors"
See gh-46372
2025-08-21 16:58:34 +02:00
Volkan Yazıcı f7f049da1c Avoid using deprecated Log4J constructors
See gh-46372

Signed-off-by: Volkan Yazıcı <volkan@yazi.ci>
2025-08-21 16:58:34 +02:00
Stéphane Nicoll 8cf0d17fbc Upgrade to Log4j2 2.25.1
Closes gh-46334
2025-08-21 16:54:01 +02:00
Phillip Webb ac2e6972d7 Provide configuration property to disable console logging
Add `logging.console.enabled` which when set will cause the
`logging.threshold.console` property to be set to `OFF`.

Closes gh-46592
2025-08-20 19:17:30 -07:00
Dmytro Nosan 26372e78c6 Switch Logback's file logging charset to UTF-8
This commit aligns the file charset between Log4j2 and Logback.

Prior to this commit, there was an inconsistency between the two: Log4j2
used UTF-8, while Logback used Charset.defaultCharset(), which is
platform-dependent.

See gh-46846

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
2025-08-18 17:52:51 +02:00
Stéphane Nicoll ff61cd0eba Merge branch '3.5.x'
Closes gh-46873
2025-08-18 13:58:05 +02:00
Stéphane Nicoll dc68142bd1 Restore configuration metadata for spring.web.resources.chain.enabled
See b6e4533296
2025-08-18 11:41:07 +02:00
Stéphane Nicoll 5d49f3a78f Merge branch '3.5.x'
Closes gh-46826
2025-08-13 15:09:14 +02:00
Moritz Halbritter c211b88594 Check for @NullMarked on packages
Projects which don't have JSpecify nullability annotations can opt out
by using

architectureCheck {
	nullMarked = false
}

in their build.gradle script.

See gh-46587
2025-08-13 13:27:48 +02:00
Stéphane Nicoll 759b8b11f7 Merge branch '3.5.x'
Closes gh-46770
2025-08-11 11:14:27 +02:00
Phillip Webb 449818d8bb Merge branch '3.5.x'
Closes gh-46722
2025-08-08 14:07:32 +01:00
Moritz Halbritter 9da666ba5b Add more nullability annotations to core/spring-boot
See gh-46587
2025-08-08 09:20:13 +02:00
Moritz Halbritter da612ba6f8 Add more nullability annotations to core/spring-boot-autoconfigure
See gh-46587
2025-08-07 10:48:44 +02:00
Stéphane Nicoll a3b1c020d2 Adapt to latest change in Spring Framework snapshots 2025-08-07 09:34:30 +02:00
Moritz Halbritter cc85b18c6a Add more nullability annotations to core/spring-boot
See gh-46587
2025-08-06 10:13:38 +02:00
Moritz Halbritter 65382a9f89 Add more nullability annotations to core/spring-boot
See gh-46587
2025-08-04 11:27:40 +02:00
Andy Wilkinson f9ebd0d4fc Migrate from RestClient to new Rest5Client
Closes gh-46061
2025-08-04 10:08:49 +01:00
Andy Wilkinson f0875cea68 Merge branch '3.5.x'
Closes gh-46647
2025-08-01 09:09:30 +01:00
Phillip Webb 067b4204b3 Start building against Spring Framework 7.0.0-M8 snapshots
See gh-46620
2025-07-31 09:36:58 +01:00
Moritz Halbritter f135a2d6ca Add more nullability annotations to core/spring-boot
See gh-46587
2025-07-29 17:11:37 +02:00
Moritz Halbritter bac4a38fe8 Add nullability annotations to core/spring-boot-test
See gh-46587
2025-07-29 16:21:24 +02:00
Moritz Halbritter 419a1c3359 Add nullability annotations to core/spring-boot-testcontainers
See gh-46587
2025-07-29 14:46:44 +02:00
Moritz Halbritter 4ad5d26cda Add nullability annotations to core/spring-boot-properties-migrator
See gh-46587
2025-07-29 14:45:06 +02:00
Moritz Halbritter cb2a26ceec Add nullability annotations to core/spring-boot-docker-compose
See gh-46587
2025-07-29 14:38:40 +02:00
Moritz Halbritter b6e4533296 Add nullability annotations to core/spring-boot-autoconfigure
See gh-46587
2025-07-29 14:33:21 +02:00
Moritz Halbritter 1b3e9e679f Add nullability annotations to core/spring-boot
See gh-46587
2025-07-29 12:38:55 +02:00
Moritz Halbritter c0f1f641ce Make auto-configurations final and remove public members
Closes gh-32883
2025-07-29 09:48:49 +02:00
Stéphane Nicoll 8827e29aec Merge branch '3.5.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Trigger Docs Build (push) Blocked by required conditions Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:24], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:24], map[id:windows-latest name:Windows]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:17], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:17], map[id:windows-latest name:Windows]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:windows-latest name:Windows]) (push) Waiting to run Details
Run CodeQL Analysis / run-analysis (push) Waiting to run Details
Run System Tests / Java ${{ matrix.java.version}} (map[toolchain:false version:17]) (push) Waiting to run Details
Run System Tests / Java ${{ matrix.java.version}} (map[toolchain:true version:21]) (push) Waiting to run Details
Closes gh-46544
2025-07-25 16:32:18 +02:00
Stéphane Nicoll 9c124de2a8 Merge branch '3.5.x'
Closes gh-46542
2025-07-25 16:21:04 +02:00
Stéphane Nicoll 4490c52162 Merge branch '3.5.x'
Closes gh-46540
2025-07-25 14:25:53 +02:00
Phillip Webb 4c70f7f2e7 Merge branch '3.5.x' 2025-07-22 11:09:21 +01:00
Phillip Webb 4c72ce69da Merge branch '3.5.x'
Closes gh-46481
2025-07-22 10:54:52 +01:00
Phillip Webb 51a6b5e12c Merge branch '3.5.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Trigger Docs Build (push) Blocked by required conditions Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:24], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:24], map[id:windows-latest name:Windows]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:17], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:17], map[id:windows-latest name:Windows]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:windows-latest name:Windows]) (push) Waiting to run Details
Run CodeQL Analysis / run-analysis (push) Waiting to run Details
Run System Tests / Java ${{ matrix.java.version}} (map[toolchain:false version:17]) (push) Waiting to run Details
Run System Tests / Java ${{ matrix.java.version}} (map[toolchain:true version:21]) (push) Waiting to run Details
2025-07-22 10:51:50 +01:00
Phillip Webb 64bf660321 Merge branch '3.5.x' 2025-07-22 09:53:50 +01:00
Phillip Webb a53524d8b6 Merge branch '3.5.x'
Closes gh-46475
2025-07-21 17:37:13 +01:00
Andy Wilkinson 94215d3fdc Move Threading enum from spring-boot-autoconfigure to spring-boot
The enum itself is not specifically tied to auto-configuration so
spring-boot is a better place for it. The related condition,
`@ConditionalOnThreading`, remains in spring-boot-autoconfigure. This
aligns things with the similar `CloudPlatform` and
`@ConditionalOnCloudPlatform`.

Closes gh-46406
2025-07-11 13:49:41 +01:00
Phillip Webb decc32dde3 Restructure project directories to better fit Gradle
Closes gh-46358
2025-07-10 17:54:08 -07:00