Throw an `InvalidConfigDataPropertyException` if bad properties are
detected in profile specific files. The following properties will now
trigger an exception if used in a profile specific file:
`spring.profiles.include`
`spring.profiles.active`
`spring.profiles.default`
`spring.config.activate.on-profile`
`spring.profiles`
Prior to this commit, profile based properties in a profile specific
file would be silently ignored, making them hard to find.
Fixes gh-24733
Update `DataSourceTransactionManagerAutoConfiguration` to respect
the `spring.dao.exceptiontranslation` setting. If `exceptiontranslation`
is `false` then we create a classic `DataSourceTransactionManager`
rather than a `JdbcTransactionManager`.
Fixes gh-24321
Previously, unlike the application plugin's run task, our bootRun task
ignored the project's Java toolchain. This meant that the application
was run on a JVM with the same Java version as the one being used by
Gradle itself. This could result in a failure if the application
required a more modern JVM.
This commit updates the plugin to configure the bootRun task's
JavaLauncher convention to be one derived from the project's Java
toolchain. Toolchain support was introduced in Gradle 6.7 so this is
only done when using Gradle 6.7 and later.
Fixes gh-24517
Previously, bootRun assumed that the Java version of the JVM that would
run the application would be the same as the Java version of the JVM
that is running the build. This assumption does not hold true when
Gradle's toolchain support is used to configure tasks that fork a new
JVM to use a version other than that being used by Gradle itself.
This commit updates the BootRun task to query the JavaLauncher property
when determining the version of Java on which the application will be
run. Toolchain support and the JavaLauncher property are new in Gradle
6.7. To support earlier versions of Gradle, NoSuchMethodError is caught
we continue as if no JavaLauncher has been configured and use the local
JVM's Java version.
Fixes gh-24512
This commit removes the `layout` and `layoutFactory` parameters
from the `build-image` goal in the Maven plugin while retaining
them for the `repackage` goal. The `build-image` goal currently
only supports jar archives, so allowing other layout types to be
configured for the goal could cause confusion.
Fixes gh-24105
Previously, an error would occur when a user contributed a
`ThemeResolver` or `FlashMapManager` bean because those beans would
would not properly override the default beans provided by Spring
Framework. This commit adds conditional auto-configuration of these
bean types, preferring user-provided beans and falling back to
Framework-provided defaults.
Fixes gh-24207
Update `FailureAnalyzers` to log errors at `trace` rather than `debug`.
This should reduce noise when an analyzer unexpectedly fails and the
user is running with `--debug`.
Fixes gh-24630
Update `ConfigDataEnvironment` so that the bootstrap `Binder` is
replaced as contributors are processed. The final `Binder` is now
also added without the `FAIL_ON_BIND_TO_INACTIVE_SOURCE` option so
that properties can be bound at the last stage even if values exist
in an inactive profile-specific document.
Closes gh-24669
Update `WebServer` implementations to return -1 from `getPort()` if
the server isn't listening on a port. This aligns the implementations
with the interface Javadoc.
See gh-24606
Prior to this commit, the configtree property source would not traverse
into a sub-directory in a property path if the sub-directory was a
symbolic link. This commit allows symlinked sub-directories to be
traversed like any other sub-directory in the property path.
Fixes gh-24530
Update `ConfigDataEnvironment` so that the `Binder` is registered as
a prototype bootstrap instance. This allows it to be accessed early
but still replaced when a more complete version is available.
Fixes gh-24559
Update `BootstrapRegistry` so that it can be used to register instances
in either a `singleton` or `prototype` scope. The prototype scope has
been added so that instances can be registered and replaced later
if needed.
See gh-24559
Update the jar `Handler` class to support a non-reflective fallback
mechanism when possible. The updated code attempts to capture a regular
jar URL before our handler is installed. It can then use that URL as
context when creating the a fallback URL. The JDK jar `Handler` will
be copied from the context URL to the fallback URL.
Without this commit, resolving new Tomcat URLs of the form
`jar:war:file:...` would result in an ugly "Illegal reflective access"
warning.
Fixes gh-18631
Refine the `PortInUseException` logic in `NettyWebServer` to only throw
an exception if the port is set. The prevents a misleading exception
from being thrown when a domain socket is being used.
Closes gh-24529
Update `NettyWebServer` to deal with any `UnsupportedOperationException`
thrown from `DisposableServer`. Specifically, this commit allows the
`NettyWebServer` to work with domain socket backed servers which cannot
provide a port.
Fixes gh-24529
Prior to this commit, running the bootBuildImage Gradle task on a
project configured for war packaging would result in a jar file being
built and used in the image instead of the war file. With this commit
an error will be thrown from the plugin in this case.
Fixes gh-24521
Add an overloaded `ConfigDataEnvironmentPostProcessor.applyTo` method
that accepts a listener that can used to track the updates that were
applied to the `Environment`.
The listener can be used to track the which `ConfigDataLocation` and
the `ConfigDataResource` were used to add a `PropertySource`. The lister
can also be used to tell which profiles were applied.
This enhancement is being added in a patch release because it's will
be useful for Spring Cloud 2020.0.0.
Closes gh-24504