Update `ConfigurationPropertiesBindingPostProcessor` to once again allow
beans to be bound again following changes to the underlying property
sources.
Fixes gh-9160
Update `SpringApplicationJsonEnvironmentPostProcessor` so that the
returned `PropertyOrigin` uses the source property name and not the
JSON key.
See gh-8932
Update `SpringApplication` so that the `run` methods and constructors
now require `Class<?>` arguments, rather than `Objects`. String based
sources can still be loaded, but must now be set on the `getSources()`
collections. `Package` and `Resource` types are no longer directly
supported.
This change should help IDEs offer better content assist, and will
help integrations with alternative languages such as Ceylon.
Users currently passing in Class references or using the
`spring.main.sources` property should not be affected by this change. If
an XML resource is being used, some refactoring may be required (see the
changes to `SampleSpringXmlApplication` in this commit).
Fixes gh-9170
The `spring.resources.static-locations` key (see `ResourceProperties`)
lists many locations by default, including `"classpath:/static"` and
`"/"`. The latter is about exposing resources located in the root
servlet location.
Reactive web applications don't depend on a Servlet-related
`ApplicationContext`/`ResourceLoader`, so `"/"` is then resolved as
`"classpath:/"`, which exposes the whole classpath.
To avoid such situations, the `GenericReactiveWebApplicationContext`
overrides the `getResourceByPath(String path)` method and always returns
non existent resources if the path starts with `"/"`.
Fixes gh-8485
Previously, when the liquibase.url, .username, and .password
properties were used to configure a DataSource specifically for
Liquibase that DataSource would never be explicitly closed. As it is
created by DataSourceBuilder with no explicitly configured type it
will use whichever connection pool is available and, therefore, will
create and keep open the pool's minimum number of connections. This
is an unnecessary use of resources both in the application and in the
database.
This commit updates LiquibaseAutoConfiguration so that if it uses
DataSourceBuilder to create a DataSource then it will also close that
DataSource once the database has been migrated.
Closes gh-9218
This commit allows to specify a deprecation level to a manual metadata
entry. The purpose of that new attribute is to distinguish cases where
the property is still bound (default) from cases where the property no
longer exists and won't be bound.
This gives the opportunity to IDEs to still show the property as an
error and offer documentation and an action to rename it if a
replacement exists.
Closes gh-9074