Commit Graph
242 Commits
Author SHA1 Message Date
Phillip Webb 8008076e04 Remove spring-boot-json-test module
Remove spring-boot-json-test module and spread code between
`spring-boot-test`, `spring-boot-test-autoconfigure` and JSON
technology modules.

See gh-46356
See gh-47322
2025-10-01 21:42:18 -07:00
Phillip Webb 4b2d358384 Refine spring-boot-test-autoconfigure dependencies
Make `spring-boot-test-autoconfigure` optionally depend on
`spring-boot-autoconfigure` so that it can be an `api` dependency
for `*-test` modules. Also relocate it to core.

See gh-47322
2025-10-01 21:41:55 -07:00
Phillip Webb 17e655b7e5 Relocate @PropertyMapping to spring-boot-test
Move `@PropertyMapping` and supporting code from the
`spring-boot-test-autoconfigure` module to `spring-boot-test`
since it's generally applicable.

See gh-46356
See gh-47322
2025-10-01 21:41:03 -07:00
Phillip Webb 2b3a8ff647 Relocate @TypeExcludeFilters to spring-boot-test
Move `@TypeExcludeFilters` and supporting code from the
`spring-boot-test-autoconfigure` module to `spring-boot-test`
since it's generally applicable.

See gh-46356
See gh-47322
2025-10-01 21:39:34 -07:00
Stéphane Nicoll eb307b91ec Merge branch '3.5.x'
Closes gh-47359
2025-09-30 07:50:09 +02:00
Andy Wilkinson 0b601118bd Modularize spring-boot-test
Closes gh-46356
2025-09-25 17:24:12 +01:00
Andy Wilkinson 5348880b69 Modularize spring-boot-test-autoconfigure
This commit modularizes spring-boot-test-autoconfigure. It now
contains only the code that's central to test auto-configuration.
Feature-specific functionality has moved out into -test modules,
some existing and some newly created. For example, `@DataJpaTest` can
now be found in spring-boot-data-jpa-test.

Closes gh-47322
2025-09-25 13:11:35 +01:00
Andy Wilkinson 51b606e941 Polish 2025-09-24 12:47:09 +01:00
Stéphane Nicoll c4cace3f74 Upgrade to Log4j2 2.25.2
See gh-46334
2025-09-24 12:14:32 +02:00
Stéphane Nicoll b7695200a9 Re-apply the upgrade to Log4j2 2.25.1
See gh-46372
See gh-46334
2025-09-24 12:13:54 +02:00
Phillip Webb 3a9ab15696 Reintroduce previous EnvironmentPostProcessor in deprecated form
Restore previous `EnvironmentPostProcessor` in deprecated form to help
lessen upgrade pain.

Closes gh-47272
2025-09-22 11:25:23 -07:00
Stéphane Nicoll 14703cbafd Revert "Remove mentions of JUnit 4"
This reverts commit 3b98af30f5.

See gh-47228
2025-09-19 17:05:00 +02:00
Stéphane Nicoll 3b98af30f5 Remove mentions of JUnit 4
This commit removes all mentions of JUnit 4 from the Javadoc and
reference documentation. It also harmonizes to simply refers to JUnit.

Closes gh-47228
2025-09-19 15:29:11 +02:00
Phillip Webb 2cf854c5b6 Polish 2025-09-18 13:29:47 -07:00
Moritz Halbritter aac1845cac Improve null-safety of core/spring-boot
See gh-46926
2025-09-18 11:35:52 +02:00
Stéphane Nicoll d9fce46848 Fix checkstyle 2025-09-18 03:43:59 +02:00
Phillip Webb 6642bf7beb Deprecate JUnit 4 OutputCaptureRule
Closes gh-47256
2025-09-17 16:40:32 -07:00
Phillip Webb fc68b001d8 Remove isImmutable and getPrefix from OriginLookup
Drop `isImmutable` and `getPrefix` from `OriginLookup` since
they're not really Origin concerns. Now that `env` is a
foundational layer we can add a dedicated `PropertySourceInfo`
interface and add that to the `o.s.b.env` package without
creating a package tangle.

Closes gh-45547
2025-09-17 14:57:33 -07:00
Phillip Webb 1acda68d39 Relocate AnsiOutputApplicationListener
Move `AnsiOutputApplicationListener` from `o.s.b.context.config`
to `o.s.b.support` since it's more of a supporting class than a
context concern.

See gh-47232
2025-09-17 14:57:32 -07:00
Phillip Webb c53ea0a08c Relocate DefaultPropertiesPropertySource to env
Move `DefaultPropertiesPropertySource` from
`org.springframework.boot` to `org.springframework.boot.env` since
it's not directly tied to `SpringApplication`.

See gh-47232
2025-09-17 14:57:32 -07:00
Phillip Webb 6c84674c33 Relocate EnvironmentPostProcessor and implementations out of env
Move the `EnvironmentPostProcessor` from `org.springframework.boot.env`
to `org.springframework.boot` so that we can make the `env` package
foundational.

Most `EnvironmentPostProcessor` implementation has also been relocated
to a new `org.springframework.boot.support` package.

See gh-47232
2025-09-17 14:57:10 -07:00
Phillip Webb 4ebf09ad12 Restructure bootstrap classes to a foundational layer
Move bootstrap code from `org.springframework.boot` to
`org.springframework.boot.bootstrap` and make them a foundational
layer.

This move helps reduce `org.springframework.boot.context.config`
dependencies to `org.springframework.boot`.

See gh-47232
2025-09-17 14:57:10 -07:00
Stéphane Nicoll ae1e700df9 Polish contribution
See gh-47244
2025-09-17 16:04:22 +02:00
Yanming Zhou 95305691ab Add support for SimpleTaskExecutor#cancel-remaining-tasks-on-close
See https://github.com/spring-projects/spring-framework/issues/35372
See gh-47244

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-09-17 16:04:03 +02:00
Stéphane Nicoll 2b6a0d533e Remove unused code
Closes gh-47235
2025-09-17 15:37:25 +02:00
Stéphane Nicoll cdd39bafd7 Introduce spring-boot-persistence
This commit adds a spring-boot-persistence module with data technology
independent features. This provides a better home for EntityScan and
PersistenceExceptionTranslationAutoConfiguration.

Closes gh-45328
2025-09-17 14:42:22 +02:00
Moritz HalbritterandPhillip Webb 7ada32ca77 Make ConfigDataLocation.of non-nullable
Update `ConfigDataLocation.of` to return an empty location rather than
null. Filtering of empty elements now happens in `ConfigDataProperties`
and `ConfigDataEnvironment` which allows us to simplify
`ConfigDataLocationBindHandler`.

Closes gh-47221

Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
2025-09-16 12:06:36 -07:00
Moritz Halbritter 009bd441f6 Improve null-safety of core/spring-boot
See gh-46926
2025-09-16 13:52:14 +02:00
Moritz Halbritter a6b4400de7 Improve null-safety of core/spring-boot-docker-compose
See gh-46926
2025-09-16 13:52:13 +02:00
Moritz Halbritter 8c0018d739 Further improve null-safety of JsonContentAssert
See gh-46926
2025-09-16 13:42:24 +02:00
Moritz Halbritter 3bfcfaa795 Improve null-safety of JsonContentAssert
See gh-46926
2025-09-16 11:55:16 +02:00
Phillip Webb eeac38b70b Make 'org.springframework.boot.ssl` a foundational package
Closes gh-47219
2025-09-15 20:44:30 -07:00
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 WebbandMoritz Halbritter 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