Jetty apparently does it differently (different version of
Jasper maybe), so you need a unique jarFileURL for each
nested JAR (previously they were all set to the parent
archive URL).
Also added the root of the main archive as a valid
document root.
For gh-367
The DispatcherServletAutoConfiguration had a condition on it that
meant it wasn't used at all if there was no EmbeddedServletContainerFactory.
It's amazing that any WAR ever deployed.
Also added some info logging to servlet and filter registrations.
Restore the order that `ConfigFileApplicationListener` attempts to load
application.properties so that local files always have a higher
precedence than bundled classpath files.
This fixes a regression introduced with 1.0.0.RC2.
Fixes gh-370
Here's what I think works best:
* Any profile in the Environment before application.yml
is processed takes precedence (i.e. it will be last in the
list of active profiles in the live app)
* Any profile in the Environment before SpringApplication
starts takes precedence (so any added on the command line or
with System properties come after ones added using
the SpringApplication API)
* The order of profiles in application.yml is irrelevant -
profiles are applied in the order they come out of
Environment.getActiveProfiles()
Fixes gh-342
Ordering: profiles are applied in order (from the active profiles
list in the Environment), with the last one winning as far as
property values goes. This *does* mean that a profile activated
inside application.yml is applied last and hence takes precedence.
It's debatable whether that is the right semantics, but that's
what it is for now.
Re gh-342: a profile added via SpringApplication also takes
precedence over one added on the command line. Also debatable
but at least it's predictable.
Naming: a profile adds "#<profile>" to the end of a property source
name (no more, no less)
Fix ConfigFileApplicationListener to correctly bind
`application.properties` to SpringApplication. Binding in RC2 failed
due to the fact that `ConfigurationPropertySources` did not extend
`EnumerablePropertySource`.
Fixes gh-346
Rename EnvironmentDelegateApplicationContextInitializer to
DelegatingApplicationListener and EnvironmentDelegateApplicationListener
to DelegatingApplicationListener.
Fix ConfigFileApplicationListener to load profile specific files
(*-profile.ext) both as a root document, and again with the profile
active.
This allows profile specific files to still include a 'spring.profiles'
property if they wish.
Issue: gh-340
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
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
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
Fix package tangle between the `org.springframework.boot` and the
`event` sub-package. A new `SpringApplicationRunParticipant` abstraction
has been introduced, with the `event` package solely responsible for
handling event multi-casting.
Detect when an application is running in development (by the presence
of a build file) and automatically add a 'development' profile.
Additional detectors can be developed by implementing the
`ProfileDetector` interface and registering with the `SpringApplication`
Fixes gh-296
Update SpringApplication so that ApplicationListener and
ApplicationInitializer methods must be called separately. This helps
to prevent unexpected side effects when calling the setters and
also encourages separation of concerns.
The few situations where a class was both an ApplicationInitializer
and ApplicationListener are now handled by registering an inner
listener from the `initialize` method.