3291 Commits

Author SHA1 Message Date
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 ec0d598ba43fa235c8022aa4c782916b031b5a70.
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 6cb7fb58975f142a096faba023450f2bdb4b389d.
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