Commit Graph

3563 Commits

Author SHA1 Message Date
Andy Wilkinson 86c988d653 Improve compatibility with SnakeYAML 2.0
Closes gh-34405
2023-03-08 17:25:42 +00:00
Scott Frederick 9f0108496c Consolidate web server SSL configuration 2023-03-01 16:54:09 -06:00
Moritz Halbritter 944862389b Merge branch '3.0.x'
Closes gh-34420
2023-03-01 12:51:23 +01:00
Moritz Halbritter 7ea56a2fdb Merge branch '2.7.x' into 3.0.x
Closes gh-34419
2023-03-01 12:51:15 +01:00
1993heqiang 277784b17d Update logger to use GracefulShutdown.class
See gh-34220
2023-03-01 12:50:31 +01:00
Phillip Webb a7f2be8b14 Merge branch '3.0.x'
Closes gh-34411
2023-02-28 14:59:33 -08:00
Phillip Webb 285097d746 Bind nested record types even if they have an existing value
Update logic in `DefaultBindConstructorProvider` introduced in commit
84b13f0748 so that record types are always bound.

Fixes gh-34407
2023-02-28 14:55:43 -08:00
Andy Wilkinson e21c9090b1 Merge branch '3.0.x'
Closes gh-34375
2023-02-24 16:11:40 +00:00
Andy Wilkinson 72de4a8937 Use ResourceLoader's ClassLoader to load ConfigDataLoaders
Fixes gh-34372
2023-02-24 16:10:49 +00:00
Phillip Webb b20b5edf2a Polish 2023-02-23 13:00:30 -08:00
Andy Wilkinson 982e922c0b Fix formatting 2023-02-23 16:58:03 +00:00
Andy Wilkinson 2c0c89454c Upgrade to Log4j2 2.20.0
Closes gh-34349
2023-02-23 16:50:05 +00:00
Phillip Webb 157091a811 Merge branch '3.0.x' 2023-02-22 18:36:57 -08:00
Phillip Webb 0b15962aca Merge branch '2.7.x' into 3.0.x 2023-02-22 18:36:16 -08:00
Phillip Webb c0cf81dbf0 Merge branch '3.0.x' 2023-02-22 12:40:38 -08:00
Phillip Webb 1132b5e8a5 Merge branch '2.7.x' into 3.0.x 2023-02-22 12:40:23 -08:00
Phillip Webb b126c33195 Enable and fix ImportCandidatesTests 2023-02-22 12:39:00 -08:00
Andy Wilkinson 7aba96d132 Merge branch '3.0.x'
Closes gh-34341
2023-02-22 19:49:14 +00:00
Andy Wilkinson 31b1c3e8ad Replace property placeholders in Logback component class names
Closes gh-34336
2023-02-22 19:47:41 +00:00
Phillip Webb eddee5321f Merge branch '3.0.x' 2023-02-22 00:50:29 -08:00
Phillip Webb e04c09ceae Merge branch '2.7.x' into 3.0.x 2023-02-22 00:50:18 -08:00
Phillip Webb 891ce3bd1b Disable recently renamed tests 2023-02-22 00:49:23 -08:00
Phillip Webb 01e8c42c16 Merge branch '2.7.x' into 3.0.x 2023-02-21 23:55:34 -08:00
Phillip Webb bcfb250da2 Merge branch '3.0.x' 2023-02-21 23:52:02 -08:00
Phillip Webb 66016921c6 Merge branch '2.7.x' into 3.0.x 2023-02-21 23:51:52 -08:00
Phillip Webb 3651ba348d Fix checkstyle test violations 2023-02-21 23:49:56 -08:00
Phillip Webb b07269a018 Merge branch '3.0.x' 2023-02-21 23:20:07 -08:00
Phillip Webb c4de86c244 Merge branch '2.7.x' into 3.0.x 2023-02-21 23:17:57 -08:00
Phillip Webb df5898a146 Reformat code following spring-javaformat upgrade 2023-02-21 22:53:27 -08:00
Andy Wilkinson 7aa27e1167 Merge branch '3.0.x'
Closes gh-34320
2023-02-21 16:36:54 +00:00
Andy Wilkinson bc19e398ba Report Logback configuration errors when running in a native image
Closes gh-34315
2023-02-21 16:10:26 +00:00
Andy Wilkinson 0e67fbc855 Merge branch '3.0.x'
Closes gh-34174
2023-02-13 14:50:48 +00:00
Andy Wilkinson a0de59c209 Fix property binding to Kotlin data class in a native image
Fixes gh-34157
2023-02-13 14:49:04 +00:00
Andy Wilkinson b0c376546d Upgrade to MariaDB 3.1.2
Closes gh-34093
2023-02-06 14:46:07 +00:00
Andy Wilkinson f595b46bd3 Upgrade to HttpClient5 5.2.1
Closes gh-34086
2023-02-06 14:46:05 +00:00
Yubao Liu 6ba5329a79 Allow different log level for FILE and CONSOLE appender
- java.util.logging isn't supported yet

See gh-32076
2023-01-31 14:31:51 +01:00
Luka Hartwig 6d05cf3efb Add Nomad to cloud platforms
See gh-32880
2023-01-31 14:11:08 +01:00
lionel benychou 4f17a9cc9d Allow JoranConfigurators to be passed ahead of time in logback
See gh-33643
2023-01-31 11:13:21 +01:00
Moritz Halbritter 23f1c896c9 Merge branch '3.0.x'
Closes gh-34015
2023-01-31 10:20:36 +01:00
Johnny Lim bc7fc90550 Replace Base64Utils with JDK's Base64
See gh-33967
2023-01-31 10:20:06 +01:00
Phillip Webb 390892f11b Merge branch '3.0.x'
Closes gh-33998
2023-01-26 21:45:57 -08:00
Krzysztof Krason f4af93fb03 Use for loop rather than iterator
See gh-33987
2023-01-26 20:47:35 -08:00
Krzysztof Krason 55a50d565c Use Comparator.comparing
See gh-33987
2023-01-26 20:47:34 -08:00
Krzysztof Krason d3efd7e091 Use try with close
See gh-33987
2023-01-26 20:36:38 -08:00
Krzysztof Krason 0e68cae57f Use instanceof patterns
See gh-33987
2023-01-26 20:36:25 -08:00
Krzysztof Krason 6e46423983 Use diamond operators
See gh-33987
2023-01-26 20:35:08 -08:00
Moritz Halbritter a4e7a8bae0 Use bean name for servlet and filter registrations if name is not set
If the name is set, it is used. If not, the bean name is used. If that's
not set, the convention based name is taken.

Registration failures now throw an IllegalStateException instead of
being logged. DynamicRegistrationBean.setIgnoreRegistrationFailure
can be used to restore the old behavior.

See gh-33911
2023-01-24 09:14:06 +01:00
Phillip Webb 0a50b83c75 Add DataSourceBuilderRuntimeHints
Add hints for DataSourceBuilderRuntime.

Closes gh-33692
2023-01-19 10:52:34 -08:00
Moritz Halbritter ae79c60619 Remove instance suppliers in bean definitions
Remove instance suppliers in bean definitions and depend instead
on reflection. This allows the AOT engine to correctly process
the definitions.

Fixes gh-33763
2023-01-18 19:55:56 -08:00
Phillip Webb 71efc55bf9 Merge branch '2.7.x' 2023-01-18 16:31:53 -08:00
Phillip Webb 7c508fa324 Update copyright year of changed files 2023-01-18 15:37:58 -08:00
Moritz Halbritter 94f4a4396c Merge branch '2.7.x'
Closes gh-33880
2023-01-18 17:35:52 +01:00
Moritz Halbritter e8d809fe65 Replace 'via' with 'over' or 'through' in the documentation
Closes gh-33878
2023-01-18 16:56:42 +01:00
Andy Wilkinson a2f593c15f Merge branch '2.7.x'
Closes gh-33876
2023-01-18 14:02:56 +00:00
Andy Wilkinson b5cebed120 Improve failure description when bean def has no resource description
Closes gh-33765
2023-01-18 13:52:56 +00:00
Moritz Halbritter c939e27925 Only set AWT headless property if not already set
Closes gh-28803
2023-01-18 14:28:26 +01:00
Phillip Webb fad88232b9 Update copyright year of changed files 2023-01-17 10:12:38 -08:00
Phillip Webb a889c539ab Merge branch '2.7.x' 2023-01-17 10:12:25 -08:00
Phillip Webb a0fe8241a7 Update copyright year of changed files 2023-01-17 10:07:03 -08:00
Moritz Halbritter 47c1aa2724 Merge branch '2.7.x'
Closes gh-33771
2023-01-12 09:48:21 +01:00
Moritz Halbritter d6f682da7e Polish JavaBeanBinder
Closes gh-33762
2023-01-12 09:45:36 +01:00
Moritz Halbritter e45b47565c Use Threadlocal.remove instead of .set(null)
See https://github.com/spring-cloud/spring-cloud-sleuth/issues/27 for
reference.
2023-01-11 11:38:48 +01:00
Phillip Webb 84b13f0748 Refine constructor detection logic when binding to existing values
Update `DefaultBindConstructorProvider` so that deduced constructors
are not used if there is an existing value.

Prior to this commit, constructor detection logic was not compatible
with earlier versions of Spring Boot. With Spring Boot 3.0.1, given
a class of the following form:

	@ConfigurationProperties(prefix = "example")
	public class ExampleProperties {

	    @NestedConfigurationProperty
	    private final NestedProperty nested = new NestedProperty(
	    		"Default", "default");

	    public NestedProperty getNested() {
	        return nested;
	    }

	}

If `NestedProperty` has a single constructor with arguments, constructor
binding would be used. In Spring Boot 2.x, setter injection would have
been used.

The updated code now only uses constructor injection if an explicit
`@ConstructorBinding` annotation is present, or if there is no existing
value.

Fixes gh-33409
See gh-33710
2023-01-09 16:57:56 -08:00
Phillip Webb a2ac38e203 Update copyright year of changed files 2023-01-09 15:46:07 -08:00
Phillip Webb 80cfcb71ec Update copyright year of changed files 2023-01-09 15:18:10 -08:00
Krzysztof Krason cf6493f65c Simplify AssertJ assertions and also make them more readable
See gh-33653
2023-01-09 11:10:20 +01:00
Kaveh Shamsi 2d95e4a31e Fix JavaDoc typo in LocalServerPort
See gh-33683
2023-01-09 10:27:40 +01:00
Phillip Webb 2e90b71c30 Do not attempt constructor binding for items with an existing value
Update `DefaultBindConstructorProvider` so that it no longer detects
constructors when the `Bindable` has an existing value. This update
allows us change `ConfigurationPropertiesBindingPostProcessor` and
related classes so that all instances created from `@Bean` methods
are treated as `JAVA_BEAN` bindings and will not be accidentally
re-created using constructor binding.

Fixes gh-33710
2023-01-06 17:23:03 -08:00
Phillip Webb f588793445 Update copyright year of changed files 2022-12-22 01:00:42 -08:00
Phillip Webb 0254619782 Merge branch '2.7.x' 2022-12-22 00:59:40 -08:00
Phillip Webb e4772cf3b7 Update copyright year of changed files 2022-12-22 00:59:32 -08:00
Phillip Webb 2e7ca6f82d Warning if <springProfile> is used in phase 2 model elements
Add `SpringProfileIfNestedWithinSecondPhaseElementSanityChecker` which
will provide a warning if `<springProfile>` is used within a phase 2
model element. This is similar to Logback's own `<if>` warnings.

The `LogbackLoggingSystem` has also been updated so that warning are
printed when present.

Fixes gh-33610
2022-12-22 00:57:59 -08:00
Phillip Webb 2ed512ddb5 Use model.deepMarkAsSkipped in SpringProfileModelHandler
Switch `model.markAsSkipped` to `model.deepMarkAsSkipped` in
`SpringProfileModelHandler`.

Although the current call doesn't appear to be causing issues,
it seems best to align our <springProfile> support with the way
that Logback implements its own `<if>` support.

Closes gh-33618
2022-12-22 00:54:06 -08:00
Phillip Webb c257f2b1d2 Merge branch '2.7.x' 2022-12-21 11:37:41 -08:00
Phillip Webb bc6fc33498 Polish 2022-12-21 10:16:25 -08:00
Moritz Halbritter 08659baeba Polish away public modifier on tests 2022-12-16 16:08:44 +01:00
Moritz Halbritter f36e2ecb7b Use AutoClosables with try-with-resources
Closes gh-33538
2022-12-16 15:43:15 +01:00
Moritz Halbritter 725337f976 Make fields final
Closes gh-33537
2022-12-16 14:28:44 +01:00
Moritz Halbritter 47eb3b11b9 Upgrade Tomcat to 10.1.4
Closes gh-33167
Closes gh-33071
2022-12-12 11:19:30 +01:00
Moritz Halbritter a4779b7859 Merge branch '2.7.x'
Closes gh-33433
2022-12-01 13:33:43 +01:00
Moritz Halbritter 16569099ba Polish "Fix bug in webserver start when loading PKCS#11 KeyStore"
See gh-32179
2022-12-01 12:17:34 +01:00
cdanger 716a839d54 Fix bug in webserver start when loading PKCS#11 KeyStore
See gh-32179
2022-12-01 11:53:51 +01:00
Andy Wilkinson 276b288891 Prevent repeat configuration of DB init bean dependencies
Fixes gh-33374
2022-11-30 12:36:24 +00:00
Moritz Halbritter b3878e84ae Fix bug where using a YAML with anchors couldn't be loaded
Closes gh-33404
2022-11-29 11:21:24 +01:00
Andy Wilkinson c1dab0f9e6 Fix AOT processing of add method with array parameter in Logback model
Fixes gh-33387
2022-11-28 14:09:01 +00:00
Andy Wilkinson b9e57c73b5 Consider Kotlin when checking if parameter names are available
See gh-33182
2022-11-17 12:05:16 +00:00
Phillip Webb a50d1f0bd6 Switch to use BeanUtils.getPropertyDescriptors
Update `BindableRuntimeHintsRegistrar` to use
`BeanUtils.getPropertyDescriptors` rather than `BeanInfoFactory`.

Closes gh-33232
2022-11-16 16:28:08 -08:00
Phillip Webb 2e8d766889 Fix BindableRuntimeHintsRegistrarTests inner class to be static 2022-11-16 13:54:34 -08:00
Phillip Webb d6151858f2 Merge pull request #32851 from tumit
* pr/32851:
  Polish 'Add test for BindableRuntimeHintsRegistrar'
  Add tests for BindableRuntimeHintsRegistrar

Closes gh-32851
2022-11-16 13:41:37 -08:00
Phillip Webb 13a4902018 Polish 'Add test for BindableRuntimeHintsRegistrar'
See gh-32851
2022-11-16 13:37:48 -08:00
tumit 7e424bdf0c Add tests for BindableRuntimeHintsRegistrar
See gh-32851
2022-11-16 13:37:31 -08:00
Andy Wilkinson 421f2fac67 Fail fast when constructor bound and not compiled with -parameters
Closes gh-33182
2022-11-16 21:00:55 +00:00
Andy Wilkinson f39b297677 Merge branch '2.7.x'
Closes gh-33227
2022-11-16 18:09:35 +00:00
Andy Wilkinson 04353e4961 Merge branch '2.6.x' into 2.7.x
Closes gh-33226
2022-11-16 16:41:02 +00:00
Stephane Nicoll d9a93a1514 Update copyright year of changed file
See gh-33108
2022-11-16 10:00:50 +01:00
Johnny Lim 6027508cf7 Polish
See gh-33108
2022-11-16 10:00:36 +01:00
Phillip Webb 28dd6b3215 Merge branch '2.7.x'
Closes gh-33212
2022-11-15 19:33:04 -08:00
Phillip Webb e077060a1b Merge branch '2.6.x' into 2.7.x
Closes gh-33211
2022-11-15 19:32:46 -08:00
Phillip Webb 46acb6fb97 Ignore bridge methods when binding java beans
Update `JavaBeanBinder` so that bridge methods are ignored when binding.

Fixes gh-33105
2022-11-15 19:31:06 -08:00
Stephane Nicoll 2baac78175 Only contribute hints for matching methods
Closes gh-33203
2022-11-15 16:56:09 +01:00
Stephane Nicoll fc17171be6 Upgrade to R2DBC Pool 1.0.0.RELEASE
Closes gh-33196
2022-11-15 15:06:21 +01:00
Andy Wilkinson 55b5a32254 Try to stabilize JBoss Logging provider tests
See gh-33155
2022-11-15 07:35:04 +00:00
Andy Wilkinson 6d8a1c90a4 Revert "Upgrade to Tomcat 10.1.2"
This reverts commit 4ccdfc66d6.

See gh-33167
See gh-33071
2022-11-14 20:15:17 +00:00
Andy Wilkinson 45ec107e2f Correct ClassUtils import
See gh-33155
2022-11-14 20:05:35 +00:00
Andy Wilkinson 4ccdfc66d6 Upgrade to Tomcat 10.1.2
Closes gh-33167
Closes gh-33071
2022-11-14 19:46:33 +00:00
Andy Wilkinson b5bdee24c2 When Logback's in use, route JBoss Logging straight into SLF4J
Prior to this change, when using spring-boot-starter-logging, JBoss
Logging would route like this:

JBoss Logging -> Log4j2 API -> SLF4J -> Logback

This is inefficient as there's no need for it to go via the Log4j2
API.

This commit updates the Logback logging system to configure a system
property that controls JBoss's routing. With this change in place,
JBoss Logging will route like this:

JBoss Logging -> SLF4J -> Logback

Closes gh-33155
2022-11-14 18:06:35 +00:00
Andy Wilkinson a2f65cd887 Consider user classes when finding bind constructor
Update `@Autowired` detection logic to consider all constructors and to
search user classes.

Fixes gh-33061

Co-authored-by: Phillip Webb <pwebb@vmware.com>
2022-11-10 11:05:34 -08:00
Andy Wilkinson ac867c3c40 Polish 2022-11-09 19:32:44 +00:00
Andy Wilkinson 7eb0fe4c89 Contribute reflection hints for JsonComponent inner classes
Closes gh-33089
2022-11-09 19:24:15 +00:00
Johnny Lim ea4f22684d Polish Log4j2 changes
See gh-32742
2022-11-08 13:27:01 +00:00
Johnny Lim 6b385a4f79 Fix configLocationsWithConfigurationFileSystemProperty
See gh-32740
2022-11-08 13:17:22 +00:00
Andy Wilkinson beb1e398c9 Polish "Add reflection hints for Tomcat 10.1"
See gh-33064
2022-11-08 09:56:26 +00:00
Sébastien Deleuze 7972224313 Add reflection hints for Tomcat 10.1
In Tomcat 10.0, reflection hints on Http11AprProtocol were
registering hints on AbstractProtocol as a side effect.

Tomcat 10.1 removed this protocol and related hints, breaking
Http11NioProtocol usage in Spring Boot.

This commit contributes reflection hints for protocol properties
accessed reflectively from org.apache.catalina.connector.Connector.

See gh-33064
2022-11-08 09:56:06 +00:00
Phillip Webb 0bdf7e8af7 Allow spring properties to be used in logback <if> blocks
Reorder `SpringBootJoranConfigurator.addModelHandlerAssociations` so
that handlers are added before calling the super method. Prior to this
commit, handlers were added behind filters which prevented them from
being used in `<if>` blocks.

Fixes gh-33028
2022-11-07 14:45:43 -08:00
Andy Wilkinson b67c427259 Upgrade to Servlet 6.0 and related EE 10 specs
Co-authored-by: Phillip Webb <pwebb@vmware.com>

Closes gh-33036
Closes gh-33037
Closes gh-33038
Closes gh-33039
Closes gh-33040
Closes gh-33041
Closes gh-33042
Closes gh-33043
2022-11-07 17:33:38 +00:00
Andy Wilkinson 651f4f7236 Polish "Polish ImportCandidates"
See gh-33013
2022-11-06 11:30:29 +00:00
biergit d7090b500b Polish ImportCandidates
See gh-33013
2022-11-06 11:30:29 +00:00
Phillip Webb 0fa7dba87a Fix formatting
See gh-33013
2022-11-05 19:32:19 -07:00
biergit 8d98ae3435 Polish
See gh-33013
2022-11-05 18:47:37 -07:00
Phillip Webb 34b4ae8e05 Merge branch '2.7.x'
Closes gh-33019
2022-11-05 16:36:55 -07:00
Phillip Webb 2ab1f49442 Merge branch '2.6.x' into 2.7.x
Closes gh-33018
2022-11-05 16:35:26 -07:00
Phillip Webb caf46043c6 Add @DirtiesUrlFactories annotation
Add `@DirtiesUrlFactories` annotation that can be used to reset URL
factories.

Closes gh-33017
2022-11-05 16:30:27 -07:00
Andy Wilkinson 3fce1e9715 Fix reflection hint registration for @JsonMixins
The hints need to be registered for the mixin not the target of the
mixin.

Closes gh-32929
2022-11-03 17:57:27 +00:00
Andy Wilkinson 89af931c29 Update coordinates of jaybird dependency
See gh-32954
2022-11-02 14:59:31 +00:00
Phillip Webb 2b5a29d514 No longer log hostname during application start
Remove hostname logging since `InetAddress.getLocalHost().getHostName()`
causes a network lookup and can take a long time.

Closes gh-32908
2022-10-31 13:46:47 -07:00
Moritz Halbritter 6a138e1753 Polish 2022-10-31 17:03:16 +01:00
Moritz Halbritter 4fef5291bf Fix build
Commit 29f085bd1a690ff7281e00b3a925e1160850ffbb in Spring Framework
automatically registers hints for enclosing directories. This fixes the
tests to use a contains instead of exact match.
2022-10-31 16:59:15 +01:00
Moritz Halbritter 5e034eab59 Revert "Fix build"
This reverts commit ec0d598ba4.
2022-10-31 16:54:06 +01:00
Moritz Halbritter ec0d598ba4 Fix build
Commit 29f085bd1a690ff7281e00b3a925e1160850ffbb in Spring Framework
automatically registers hints for enclosing directories. This fixes the
tests to expect hints for those directories as well.
2022-10-31 13:34:14 +01:00
Johnny Lim 5067aab552 Polish
See gh-32840
2022-10-27 16:33:14 +02:00
Johnny Lim 7dd083ad69 Polish "Remove spring.xml.ignore flag usages"
See gh-32846
2022-10-27 16:27:29 +02:00
Moritz Halbritter 1f0cf1ac2b Make EmbeddedDatabaseConnection GraalVM compatible
Without those changes, if @AutoConfigureTestDatabase is used, the
native image build process fails with:

  EmbeddedDatabaseConnection was unintentionally initialized at build
  time.

Closes gh-32865
2022-10-27 09:21:19 +02:00
Moritz Halbritter 0985e3d237 Add resource hint for banner.txt
Closes gh-32882
2022-10-26 15:59:50 +02:00
Phillip Webb a59b6cb1f3 Polish 2022-10-25 21:56:53 -07:00
Phillip Webb 4be3218cb6 Merge branch '2.7.x' 2022-10-25 15:48:26 -07:00
Phillip Webb c8676a81de Merge branch '2.6.x' into 2.7.x 2022-10-25 15:48:04 -07:00
Phillip Webb d7ac20cd6c Update copyright year of changed files 2022-10-25 15:47:30 -07:00
Phillip Webb 9505673d6f Ensure application event listeners are always refreshed
Update `EventPublishingRunListener` to ensure that application event
listeners are always refreshed before multicasting initial events.

Prior to this commit, refreshing occurred after multicasting which
meant that listeners added by a different `SpringApplicationRunListener`
would not be picked up. This caused properties from tests that have
`UseMainMethod` set to `ALWAYS` or `WHEN_AVAILABLE` to be missing.

Fixes gh-32860
2022-10-25 15:41:57 -07:00
Phillip Webb 159910b0d9 Polish 2022-10-25 14:49:04 -07:00
Andy Wilkinson e6c37d698f Reinstate support for read timeouts with RestTemplateBuilder
Refactor the way `ClientHttpRequestFactory` instances are created in
order to support setting read timeouts.

Prior to this commit, the reflection based approach would call
`setReadTimeout`. As of Spring Framework 6.0, the
`HttpComponentsClientHttpRequestFactory` class no longer supports this
approach. The timeout must be set on the `HttpClientConnectionManager`
used in the `HttpClient` which can be passed in to the constructor.

In order to support this approach, the `ClientHttpRequestFactory` can
now be created using a `Function` rather than a `Supplier`. The
function accepts a `ClientHttpRequestFactorySettings` which provides
the timeout settings to apply.

The `ClientHttpRequestFactories` utility class provides methods to
create `ClientHttpRequestFactory` instances that respect the settings.
Whenever possible, these are created without using reflection.

Fixes gh-32857

Co-authored-by: Phillip Webb <pwebb@vmware.com>
2022-10-25 14:41:19 -07:00
Andy Wilkinson 99edda735e Polish 2022-10-25 12:57:58 +01:00
Andy Wilkinson b0b2818f0b Improve type discovery in Logback AOT contribution
Logback can infer the Java class to which an XML tag should be mapped
by looking for a setter method on the class to which the parent tag
was mapped. This commits ensures that reflection hints are added for
such classes.

Fixes gh-32839
2022-10-21 16:38:52 +01:00
Phillip Webb ea094ddba6 Fix package tangles caused by ConfigurationProperties hints
Relocate `ConfigurationPropertiesReflectionHintsProcessor` and refactor
it to be a general purpose `BindableRuntimeHintsRegistrar`.

Prior to this commit, `ConfigurationPropertiesReflectionHintsProcessor`
was used to declare binding hints for classes that were bound, but
might be `@ConfigurationProperties`. By moving and renaming the class,
it's now better aligned to the way it's used.

Support for `@NestedConfigurationProperties` has been implemented by
adding a `@Nestable` meta-annotation. This allow us to create the
appropriate hints, without the `Binder` needing to be directly aware of
the `@NestedConfigurationProperties` annotation.

Closes gh-32815
2022-10-20 17:05:54 -07:00
Phillip Webb eb1d72e7b7 Merge branch '2.7.x' 2022-10-20 17:05:49 -07:00
Phillip Webb d8c4aec946 Merge branch '2.6.x' into 2.7.x 2022-10-20 17:04:37 -07:00
Phillip Webb 1a14f39f83 Polish 2022-10-20 17:04:29 -07:00
Phillip Webb 7db93aeb90 Merge branch '2.7.x'
Closes gh-32827
2022-10-20 15:20:15 -07:00
Phillip Webb 1c7bff7cc1 Merge branch '2.6.x' into 2.7.x
Closes gh-32826
2022-10-20 15:01:00 -07:00
Phillip Webb 463a614d27 Fix package tangle between SpringApplication and Environment types
Update `SpringApplication` so that it no longer directly decides the
type of `Environment` that should be created.

Closes gh-32825
2022-10-20 14:51:13 -07:00
Andy Wilkinson 482eb49391 Support <import> in logback.xml during AOT processing
See gh-32756
2022-10-20 14:56:25 +01:00
Sébastien Deleuze 3002779195 Remove LogbackConfigurationAotContribution from native image
Remove `LogbackConfigurationAotContribution` from the reachable
code path from a native image POV.

See gh-32793
2022-10-19 23:49:34 -07:00
Madhura Bhave cedd553b83 Remove error page security filter
Spring Security now re-applies the authorization rules
to the error page by default. Additionally, it configures
RequestAttributeSecurityContextRepository as the default for
stateless applications allowing those applications to have access
to the original authentication during an error dispatch.

Closes gh-31703
2022-10-19 11:46:27 -07:00
Andy Wilkinson e6c69061b5 Upgrade to Jackson 2.14.0-rc2
Closes gh-32771
2022-10-19 11:47:40 +01:00
Andy Wilkinson 391e2f7a26 Make META-INF/spring/logback-pattern-rules repeatable
See gh-32756
2022-10-19 10:04:49 +01:00
Andy Wilkinson a87aca2744 Merge branch '2.7.x'
Closes gh-32782
2022-10-19 10:02:56 +01:00
Andy Wilkinson a19e394ebb Merge branch '2.6.x' into 2.7.x
Closes gh-32781
2022-10-19 10:00:48 +01:00
Henning Poettker 4ed072a06b Upgrade MySQL Connector/J and use new Maven identifiers
See gh-32747
2022-10-19 09:58:32 +01:00
Phillip Webb 8dadf86f93 Merge branch '2.7.x'
Closes gh-32778
2022-10-18 17:15:03 -07:00
Phillip Webb fcaac2b343 Merge branch '2.6.x' into 2.7.x
Closes gh-32777
2022-10-18 17:14:48 -07:00
Phillip Webb 2c7114fa17 Polish 'Use exclamation character for the document separator prefix'
See gh-32521
2022-10-18 17:08:21 -07:00
Guirong Hu 33e379c4a2 Use exclamation character for the document separator prefix
See gh-32521
2022-10-18 17:07:51 -07:00
Scott Frederick 76c7263eff Provide default groupId for AOT processing
Framework requires the `groupId` passed to the AOT processing
to be non-empty, so a default should be used if the build
system does not provide a value.

See gh-32696
2022-10-18 16:39:17 -05:00
Andy Wilkinson 4a76fbf93c Support logback.xml in a native image
Closes gh-32756
2022-10-18 21:37:28 +01:00
Andy Wilkinson 7bae02be2d Adapt to breaking changes to AotProcessor settings
See gh-32696
2022-10-18 17:42:00 +01:00
Moritz Halbritter 8cd9f49fad Add runtime hints for ConfigDataProperties
Closes gh-32608
2022-10-18 14:31:39 +02:00
Andy Wilkinson 93436f29dd Correct assertion in test for member with private constructor
See gh-32639
2022-10-18 10:05:09 +01:00
Phillip Webb a34b1d3c6e Don't detect private constructors on member classes for binding
Refine constructor binding detection logic so that `private`
constructors on member classes are no longer automatically picked for
constructor binding. This provides users a way of signalling that
they wish to use the constructor directly.

Closes gh-32639
2022-10-18 00:59:46 -07:00
Phillip Webb e3df6c5b6f Move @ConstructorBinding annotation and support add default support
Relocate `@ConstructorBinding` from the `boot.context.properties`
package to `boot.context.properties.bind` and update the
`DefaultBindConstructorProvider` to support it.

Closes gh-32660
2022-10-18 00:59:45 -07:00
Moritz Halbritter db248b80bb Add info log message if AOT mode is enabled
Closes gh-32396
2022-10-18 09:40:05 +02:00
Moritz Halbritter 99765e785f Revert "Add info log message if AOT mode is enabled"
This reverts commit 6cb7fb5897.
2022-10-18 09:05:57 +02:00
Moritz Halbritter 6cb7fb5897 Add info log message if AOT mode is enabled
Closes gh-32396
2022-10-17 15:29:38 +02:00
Phillip Webb cec090c32e Polish 'Resolve URLs using Log4J2 mechanisms'
See gh-32735
2022-10-14 10:13:33 -07:00
Ralph Goers 5286785127 Resolve URLs using Log4j2 mechanisms
Update `Log4J2LoggingSystem` to that non file URLs are resolved using
Log4j2's `UrlConnectionFactory` mechanism rather than directly.

See gh-32735
2022-10-14 10:13:30 -07:00
Phillip Webb 5a7964af2b Polish 'Support profile specific Log4j2 configuration'
See gh-32734
2022-10-14 10:12:31 -07:00
Ralph Goers 27ed30fdbf Support profile specific Log4j2 configuration
Add a `SpringProfileArbiter` Log4j2 plugin which allows Log4j2
configuration to be included or skipped based on the active Spring
`Environment` profiles.

See gh-32734
2022-10-14 10:12:27 -07:00
Phillip Webb ed424d3adb Polish 'Add Log4J2 PropertySource backed by the Spring Environment'
See gh-32733
2022-10-14 10:11:25 -07:00
Ralph Goers 4f8a9441c2 Add Log4J2 PropertySource backed by the Spring Environment
Register a new `PropertySource` when initializing Log4j2 so that
properties may be resolved against Spring's Environment.

See gh-32733
2022-10-14 10:11:21 -07:00
Phillip Webb 71f5857363 Polish 'Support Log4J2 string lookups from the Spring Environment'
See gh-32732
2022-10-14 10:10:23 -07:00
Ralph Goers 5228b99b22 Support Log4J2 string lookups from the Spring Environment
Add a Log4j2 `SpringLookup` plugin which can be used to resolve strings
from the Spring Environment.

See gh-32732
2022-10-14 10:10:17 -07:00
Phillip Webb d665441ca9 Polish 'Add Spring Environment to LoggerContext'
See gh-32731
2022-10-14 10:09:02 -07:00
Ralph Goers 05a2bd4585 Add Spring Environment to LoggerContext
Update `Log4J2LoggingSystem` to add the Spring `Environment` to Log4j2's
`LoggerContext`. This allow Log4j2 plugins to access the `Environment`
if they need it.

See gh-32731
2022-10-14 10:08:48 -07:00
Phillip Webb a08a6378f0 Polish 'Support 'log4j.configurationFile' system property'
See gh-32730
2022-10-14 10:06:01 -07:00
Ralph Goers 64eb36b7a1 Support 'log4j.configurationFile' system property
Update `Log4J2LoggingSystem.getStandardConfigLocations()` so that
any configured 'log4j.configurationFile' system property is also
included as a location.

See gh-32730
2022-10-14 10:05:44 -07:00
Scott Frederick fc93e6bf8b Adapt to changes in Spring Framework snapshots
See gh-32696
2022-10-13 15:04:05 -05:00
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 e0c79ce598
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