Commit Graph

54053 Commits

Author SHA1 Message Date
Dave Syer 2f138d84dd Merge pull request #336 from jkubrynski/master
* pull336:
  Now custom SpringApplication class can be used when extending SpringApplicationContextLoader
2014-02-11 15:09:10 +00:00
Jakub Kubrynski 6f2e133a0a Now custom SpringApplication class can be used when extending SpringApplicationContextLoader 2014-02-11 15:08:48 +00:00
Dave Syer 76c56c6aa9 Add placeholder resolution to @PropertySource processing
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 {
           ...
	}
2014-02-11 14:48:35 +00:00
Andy Wilkinson ca7201b4b2 Fix binding of overlapping nested maps
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
2014-02-11 13:42:02 +00:00
Dave Syer 8de9890757 Add scope=test to hsqldb (fixes #330) 2014-02-11 13:36:50 +00:00
Andy Wilkinson 4f677bec08 Filter non-jar artifacts when packaging libs in Gradle plugin
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.
2014-02-10 15:51:29 +00:00
Phillip Webb af93ae2dac Ignore failing JMS tests for now
Ignore JMS sample which intermittently fails to run on CI.

See gh-323
2014-02-07 10:30:19 -08:00
Phillip Webb 5e7d6e608d Update copyright header 2014-02-07 10:12:54 -08:00
Phillip Webb d4f5cf4496 Filter non 'jar' types from nested libs
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
2014-02-07 10:10:03 -08:00
Phillip Webb 2d8f66e3c5 Add more JMS sample log output 2014-02-06 15:30:32 -08:00
Phillip Webb dd66f119d3 Revert Automatically detect 'development' profile
Revert commit a97bcfe3cd as adding
profiles automatically may be problematic.

Updates gh-296
2014-02-06 14:18:11 -08:00
Christian Dupuis af75dd0e40 Move remaining properties for consistency 2014-02-06 14:50:35 +01:00
Phillip Webb c09ca17ca2 Update gradle example builds 2014-02-05 23:17:27 -08:00
Phillip Webb d137bcd80d Polish gradle repackage task formatting 2014-02-05 23:16:37 -08:00
Phillip Webb f8ab5a1f67 Merge pull request #302 from jvalkeal/gradle-mainclass
* gradle-mainclass:
  Add mainClass option for Repackage task
2014-02-05 22:55:21 -08:00
Janne Valkealahti 32453b27d3 Add mainClass option for Repackage task
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
2014-02-05 22:54:47 -08:00
Phillip Webb ed9735361e Apply source cleanup and formatting 2014-02-05 22:53:28 -08:00
Phillip Webb 80f2336f17 Polish 2014-02-05 22:31:56 -08:00
Phillip Webb 65b6cf8bcb Merge pull request #304 from adambro/patch-1
* patch-1:
  Prevent 404s in README.md links
2014-02-05 21:24:04 -08:00
Adam Brodziak f67b165f5a Prevent 404s in README.md links
Fix links to ensure that they don't cause 404 errors when published to
Github Pages.

Fixes gh-304
2014-02-05 21:22:57 -08:00
Phillip Webb 3749b1a3b7 Merge pull request #313 from madorb/master
* pull313:
  Document that applicaiton.yml requires snakeyaml
2014-02-05 21:15:08 -08:00
Ben c251e33bf8 Document that applicaiton.yml requires snakeyaml
Update documentation to reference the need for a yaml library to be on
the classpath.

Fixes gh-313
2014-02-05 21:14:51 -08:00
Phillip Webb 75af7a44d0 Add SpringApplication.setRegisterShutdownHook
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
2014-02-05 21:08:02 -08:00
Phillip Webb 0b7eda89d4 Don't eagerly initialize FactoryBeans
Fix `EmbeddedServletContainerAutoConfiguration` so that it does not
accidentally eagerly initialize factory beans.

Fixes gh-306
2014-02-05 20:24:21 -08:00
Phillip Webb 8763fab0e7 Extract inner configuration property classes
Extract all inner @ConfigurationProperties classes from @Configuration
classes for consistency.
2014-02-05 18:12:41 -08:00
Phillip Webb 5188ee5266 Extract Mongo auto-configuration from Spring Data
Extract Mongo auto-configuration classes from Spring Data specific
auto-configuration, allowing Mongo to be used without Spring Data
if require.
2014-02-05 17:52:25 -08:00
Oliver Gierke cf4df1befb Improve Mongo auto-configuration
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
2014-02-05 17:29:39 -08:00
Phillip Webb 16df38e928 Ordering of Application Initializer and Listeners
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
2014-02-05 15:36:06 -08:00
Phillip Webb f6f8c26f69 Consistent use of Ordered constants
Prefer Ordered HIGHEST_PRECEDENCE and LOWEST_PRECEDENCE constants to
Integer MAX_VALUE or MIN_VALUE.
2014-02-05 15:35:50 -08:00
Phillip Webb 37c2c89bcb Restructure packages
Improve package structure and attempt to co-locate related classes.
2014-02-05 14:39:01 -08:00
Phillip Webb 6ddbf3bd92 Restore active profile logic and support `+`
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
2014-02-04 14:06:02 -08:00
Phillip Webb 31c385470e Update ErrorMvcAutoConfiguration for Spring 4
Update ErrorMvcAutoConfiguration thymeleaf condition to use the
`spring4` package.

Fixes gh-310
2014-02-04 12:29:40 -08:00
Phillip Webb 69f7f38403 Document Listener/Initializer changes
Fixes gh-312
2014-02-04 12:26:14 -08:00
Phillip Webb 8ede73066d Polish 2014-02-04 12:22:03 -08:00
Phillip Webb 676cacd308 Use '-1' to disable management port
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
2014-02-04 12:03:29 -08:00
Phillip Webb 9049291d9a Attempt to fix Travis-CI log size error 2014-02-04 00:21:42 -08:00
Phillip Webb 37069d91d8 Fix spring.active.profiles repeated loading
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
2014-02-03 23:36:56 -08:00
Phillip Webb 0f083c2f9d Fix CLI class tangle 2014-02-03 21:25:12 -08:00
Phillip Webb 1061d582dc Fix CLI package tangles 2014-02-03 21:25:12 -08:00
Phillip Webb 70cb8cfed6 Fix CLI package and class tangles 2014-02-03 21:25:04 -08:00
Phillip Webb 1552759584 Fix package tangle by moving AsciiBytes 2014-02-03 17:26:10 -08:00
Phillip Webb f7d4490b2d Fix package tangle with AutoConfigurationReport
Rename AutoConfigurationReport to ConditionEvaluationReport and
co-locate with conditions.
2014-02-03 17:25:50 -08:00
Phillip Webb 32f3e353b4 Fix class tangle 2014-02-03 16:40:49 -08:00
Phillip Webb 042e512d3d Fix package tangle
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.
2014-02-03 16:34:40 -08:00
Phillip Webb c0a5c763b6 Fix class tangle 2014-02-03 15:20:20 -08:00
Phillip Webb 8ff5ce3528 Polish 2014-02-03 15:16:53 -08:00
Phillip Webb f6a341e79f Don't consider sources as Initializer or Listener
Update SpringApplication so that source objects are no longer considered
as ApplicationListeners or ApplicationContextInitializer.
2014-02-03 15:14:18 -08:00
Christian Dupuis 5e2cfe1cfe Add some javadoc. Fix typos. 2014-02-03 09:55:46 +01:00
Phillip Webb 6431fef91e Polish 2014-01-31 22:51:41 -08:00
Phillip Webb a97bcfe3cd Automatically detect 'development' profile
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
2014-01-31 22:51:31 -08:00