Older versions of JBoss AS have a classpath clash with an older
SLF4J (pre 1.6.5), so to prevent an app from blowing up on
startup we defensively catch a NoSuchMethodError.
Fixes gh-339
Locate PropertySourcesLoaders using SpringFactoriesLoader and refactor
the interface to expose file extensions and support 'profiles' within
documents.
Rework ConfigFileApplicationListener for consistent profile loading.
Profiles are now loaded in a consistent order for both profile specific
files, and contained profile documents (i.e. YAML sub-sections).
Also update ConfigFileApplicationListener so that it no longer directly
processes @ProperySource annotations. Instead the standard Spring
ConfigurationClassPostProcessor will insert @PropertySource items with
ConfigFileApplicationListener later re-ordering them.
The SpringApplication can no longer be configured using @ProperySource
annotations, however, application.properties may still be used.
Fixes gh-322
Update ConfigFileApplicationListener so that custom names and custom
locations use consistent ordering. i.e. earlier items take precedence
(same as @ProperySource).
Change `EmbeddedWebApplicationContext` to no longer automatically call
`registerShutdownHook()`. Shutdown hooks must now be registered by the
caller (for users of SpringApplication this will happen automatically).
Fixes gh-314
Previously the core Spring processing of @PropertySource would
resolve placeholders in the location attribute, but the pre-loading
of the property source by Spring Boot didn't do that. Now implemented
using Environment.resolvePlaceholders() (N.B. at a time when the only
Environment entries available are system properties and OS env vars).
E.g.
@Configuration
@PropertySource("classpath:/${source.location}.properties")
protected static class WithPropertySourcePlaceholders {
...
}
When binding a nested map structure, RelaxedDataBinder pre-populates
the target object with default empty maps. Previously, when these
structures overlapped, each step in pre-population process could
potentially overwrite what had come before it. This led to the output
of the pre-population process being incomplete which would lead to a
binding failure.
This commit updates the pre-population process so that it checks to see
if a property's value has already been set by an earlier step in the
process. If it has been set, the existing value is now reused rather
than being overwritten by a new empty map.
Fixes#328
Previously, the Gradle plugin would package all of a project's
dependencies in the jar's lib directory, irrespective of each
dependency's type. This led to non-jar artifacts being packaged in
the lib directory where only jar dependencies are expected. See #334
for an example failure.
This commit updates the Gradle plugin such that it only packages
dependencies of type jar, ejb, ejb-client, test-jar, or bundle. This
brings the Gradle plugin into line with the Maven plugin.
Fixes#334.
Update the `ArtifactsLibraries` used by the maven plugin to filter
based on artifact types. This prevent `.pom` files from accidentally
being packaged in `/libs` and ultimately resulting in 'Unable to find
ZIP central directory records' errors.
Fixes gh-324
Add `mainClass` property option to the Repackage task. If the property
is defined within a task, it works in the same way as if it defined
within the springBoot{} 'ext' properties section.
Option is valid only for that specific task where it is defined, and
will override option defined in springBoot{} ext properties.
Fixes gh-283
Add a setRegisterShutdownHook option to SpringApplication allowing the
shutdown hook to not be registered.
Also update SpringApplicationBuilder to automatically disable shutdown
hooks for child contexts.
Fixes gh-314
Disable Mongo auto-configuation when @EnableMongoRepositories is used
and adapt the test helper classes accordingly.
Change the property prefix and dependency management version property
from `...mongo` to `...mongodb` for consistency with Spring Data.
Fixes gh-315
Update javadoc and method names to indicate that ApplicationInitializer
and ApplicationListeners are `Order` sorted before being invoked.
Also remove specific sorting from SpringApplicationBuilder, relying
instead on the Order sorting.
Fixes gh-316
Restore the previous `spring.profiles.active` logic effectively
reverting commit 37069d9. This ensures that active profiles defined in
a higher `PropertySource` replace those lower down.
In addition, add support for a `+` prefix that can be used to indicate
that a profile should be added to the active set.
For example:
# application-prod.properties
spring.profiles.active=+proddb,+prodmq
Fixed gh-308, gh-309
Update `EndpointWebMvcAutoConfiguration` to use '-1' to indicate that
the management context should be disabled. This brings consistency
between the server settings and the management settings and allows '0'
to be used to pick a random port.
Fixed gh-311
Fix `ConfigFileApplicationListener` to repeatedly load property sources
and activate profiles using any defined `spring.active.profiles`
properties.
This restores the ability to have a property in a profile specific
file that defines additional profiles.
Fixes gh-308