Update `RepackageMojo` and supporting classes so that `exclusions`
on the repackage goal apply to both the contributed libraries and any
existing jar entries already contained in the original war.
Prior to this commit, exclusions would apply to contributed jars (for
example, those in `WEB-INF/lib-provided`) but not jars that were
packaged directly into `WEB-INF/lib` by the war plugin
Fixes gh-15808
Co-authored-by: Phillip Webb <pwebb@vmware.com>
Effectively revert commit 0da0d2d46 so that the `resolveProfileSpecific`
method of `ConfigDataLocationResolver` is again called when resolving
imports declared in a profile-specific file.
Fixes gh-26960
Previously, a project with a dependency on Spring Boot's configuration
processor would fail to build when the configuration cache is enabled
due to it accessing the Project during task execution.
Instead of accessing the project during task execution, this commit
updates the code to retrieve the resource locations from the matching
source set in advance. The locations are then stored in the action
that configures the compile task when needed.
Closes gh-26880
This commit modifies the output of BeanNotOfRequiredTypeFailureAnalyzer
to include type information for both the actual and the required types
and to remove ambiguity.
Fixes gh-26821
Previously, the URI template handler installed by the client metrics
interceptor would always capture the URI template and push it onto the
deque, irrespective of whether auto timing was enabled. When
auto-timing is disabled the deque is never polled so this led to its
unrestricted growth.
This commit updates the URI template handler so that a URI template is
only pushed onto the deque when the auto timing configuration enables
the interceptor.
Fixes gh-26915
The auto-config requires Spring JDBC for DataSource creation from
spring.flyway.url or spring.liquibase.url, checking Flyway migrations
exist, etc. Without it, the application fails to start due to missing
spring-jdbc classes.
This commit updates the auto-config so that it backs off in the
absence of spring-jdbc.
Closes gh-26849
Using the revision line means that the revision number is automatically
set. The revision number is then included by the HTML and PDF backends
in the standard location. In the HTML backend that's alongside the
list of authors. In the PDF backend that's on the title page.
Closes gh-26851
Change `CompositeHealth.getDetails()` to public so that it serializes
correctly when `MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS` is
disabled.
Fixes gh-26797
Allow groups to be used with standard locations so that order of
profile-specific files is consistent.
Prior to this commit, the default search locations considered for
application properties/yaml files was the following:
optional:classpath:/
optional:classpath:/config/
optional:file:./
optional:file:./config/
optional:file:./config/*/
Each of these locations was independent which could cause confusion
if certain combinations were used. For example, if profile-specific
files were added to `classpath:/` and `classpath:/config/` then the
latter would always override the former regardless of the profile
ordering.
This commit updates `StandardConfigDataLocationResolver` so that a
group of locations can be specified for each item. This allows us to
define the following set of search locations which provide more logical
ordering for profile-specific files
optional:classpath:/;optional:classpath:/config/
optional:file:./;optional:file:./config/;optional:file:./config/*/
Closes gh-26593
Update the `ConfigDataEnvironment` so that the `resolveProfileSpecific`
method of `ConfigDataLocationResolver` is no longer called when
resolving imports declared in a profile-specific file.
Fixes gh-26753
Update `StandardConfigDataLocationResolver` so that profile-specific
imports can only be used when there is no parent import.
Prior to this commit, given the following application.properties file:
spring.profiles.active=p1,p2
spring.config.import=other.properties
We would attempt to import `other.properties`, `other-p1.properties`
and `other-p2.properties`. This seems quite confusing and when we really
only need to support profile-specific properties for the initial root
set of locations.
Fixes gh-26752
Update `JarFile` and `JarFileWrapper` classes so that they no longer
close the `JarFile` early if a `SecurityManager` is in use.
Prior to this commit, the closed `JarFile` would cause (an ultimately
swallowed) NPE in `ZipFile` which manifested itself as a
`ClassNotFoundException` when starting the app.
Closes gh-25538
This commit aligns int and long so that a random number is generated
by delegating to ints/longs in the JDK's Random API. In the case of a
single bound value, it needs to be greater than 0 because 0 is used as
the lower bound.
Fixes gh-26628
Previously, LoggingSystem#get would chose Logback by the sole presence
of a class in logback-core, with the assumption that logback-classic is
also on the classpath. An app that only had the former would therefore
fail.
This commit updates the condition to check for a class in
logback-classic instead.
Closes gh-26711
Update `ImageName` and `ImageReference` to use distinct regex patterns
to parse specific parts of the value. Prior to this commit a single
regex pattern was used which could hang given certain input strings.
Fixes gh-23115
Change `SpringBootPlugin.PRODUCTION_RUNTIME_CLASSPATH_NAME` from package
private to public so that it can be accessed in user build scripts.
Fixes gh-26686
Update `StandardConfigDataLocationResolver` so that directory resources
are only required when the location is not optional.
Closes gh-26627
Co-authored-by: Phillip Webb <pwebb@vmware.com>
Update `ConfigData` so that it signal if is considered optional. This
update allows `ConfigDataLocationResolvers` to return results that
behave in the same way as `optional:` prefixed locations without the
user themselves needing to prefix the location string.
Closes gh-25894
Update `ManagementWebSecurityAutoConfiguration` so that the
`managementSecurityFilterChain` bean has an explicit order.
Prior to this commit, the `managementSecurityFilterChain` would override
the `securityFilterChain` in `RemoteDevtoolsSecurityConfiguration` which
would prevent the remote devtools endpoint from being accessed.
See gh-25868
Update `StandardConfigDataLocationResolver` to deal with patterns when
resolving empty directories. This update also fixes the handling of
mandatory pattern locations which would previously throw an exception.
The error message returned when a location with a pattern does not
contain any subdirectories has also been improved.
Fixes gh-26468
Fixes gh-26577
Fixes gh-26415
Update `Profiles` so that any profiles set programmatically on the
`Environment` are merged with `spring.profiles.active` properties.
Fixes gh-26151
Co-authored-by: Phillip Webb <pwebb@vmware.com>
Previously, @ConfigurationProperties was not annotated with @Indexed.
This meant that @ConfigurationPropertiesScan would not be able to
find them when the underlying
ClassPathScanningCandidateComponentProvider is using a
CandidateComponentsIndex.
This commit annotated @ConfigurationProperties with @Indexed so that
they can be found by index-based scanning.
Fixes gh-26459
Update `BufferingApplicationStartup` to use thread safe data structures.
Prior to this commit, it was possible for calls from different threads
(for example due to request scope beans) to cause a
NoSuchElementException to be thrown.
Closes gh-25792
This commit modifies the integration tests for the Maven and Gradle
image building goal and task to use a custom builder as a test harness
to verify that the plugins invoke the builder as expected.
Fixes gh-25838
This commit fixes a flawed assertion that was relying on a log message
to validate the TaskExecutor is lazy. The level of the log message has
changed in framework and broke the test. We now rather check the bean
definition.
Additional profiles were being processed after config file processing
when legacy processing was used.
This commit also restores the order in which additional profiles are added
when legacy processing is used.
Active profiles take precedence over additional profiles.
See gh-25817
Update `ConfigDataEnvironment.checkMandatoryLocations` to use the
actual locations that were imported, including those that were skipped
because the related `ConfigDataResource` had already been imported by a
different location.
Prior to this commit, any location that was skipped because it had
already been imported would throw a `ConfigDataNotFoundException`.
Closes gh-26147
Co-authored-by: Scott Frederick <sfrederick@vmware.com>
Co-authored-by: Madhura Bhave <mbhave@vmware.com>
Update `StandardConfigDataLoader` to mark profile specific files with
`Option.PROFILE` so that they are added in the correct order. This is
a variation of the same issue described in commit 5774ea3f0c.
Closes gh-26400
Co-authored-by: Scott Frederick <sfrederick@vmware.com>
Co-authored-by: Madhura Bhave <mbhave@vmware.com>
This commit updates config data property binding to ignore empty
elements in `spring.config.location` and `spring.config.import`
property values when a value is a comma-delimited string
representing a collection.
Fixes gh-26342
Previously DataRedisTest-annotated test could not use reactive
operations as RedisReactiveAutoConfiguration is not considered. This
commit includes this auto-configuration and adds a test to exercise this
scenario.
Closes gh-26319
Previously, users of the components.index could not use the index in
scenario where Spring Boot needs to locate the SpringBootConfiguration
to use to bootstrap the test context, as AnnotatedClassFinder scans
the classpath for that stereotype specifically and that requires a
dedicated entry for it.
This commit makes sure that a SpringBootConfiguration-annotated type has
a dedicated entry in the components index.
Closes gh-26308
This commit changes the Maven build-image goal to honor the `layout` and
`layoutFactory` parameters to ensure that the archive content sent to the
builder is the same as is used by the `repackage` goal to build the
archive file.
Fixes gh-26216
Previously, the targetJavaVersion property of bootBuildImage was set
using the project's target compatibility directly. This meant that
property's value would reflect the configured target compatibility at
the time of the task's creation and any subsequent changes to the
target compatibility would be missed.
This commit updates the registration of the bootBuildImage task to set
the value of the targetJavaVersion property using a provider. This
indirection means that the project's target compatibility isn't read
until the value of the targetJavaVersion is read, allowing any changes
to the target compatibility to be picked up even if they're made after
the bootBuildImage task has been created.
Fixes gh-26297