Commit Graph

11837 Commits

Author SHA1 Message Date
Stephane Nicoll 64dae5ec3a Merge branch '1.5.x' 2017-05-02 13:26:04 +02:00
Stephane Nicoll 035e27b1d1 Merge branch '1.4.x' into 1.5.x 2017-05-02 13:21:03 +02:00
Stephane Nicoll 8e5bf4b22a Polish CachePublicMetrics
CachePublicMetrics wasn't explicitly tested and was still using field
injection. This commit improves the situation in preparation of the fix
for gh-8984
2017-05-02 13:15:31 +02:00
Stephane Nicoll 43fb99aafa Merge branch '1.5.x' 2017-05-02 12:14:00 +02:00
Stephane Nicoll 652a5e7baa Merge branch '1.4.x' into 1.5.x 2017-05-02 12:13:44 +02:00
Stephane Nicoll f060922350 Fix cache example in the doc
Closes gh-8983
2017-05-02 11:58:50 +02:00
Andy Wilkinson e0d5c447a8 Upgrade to Rxjava2 2.1.0
Closes gh-9062
2017-05-02 09:38:37 +01:00
Andy Wilkinson 7ed8737382 Upgrade to Rxjava 1.2.10
Closes gh-9061
2017-05-02 09:38:36 +01:00
Eddú Meléndez 4c96e95ad9 Simplify Netty dependency management by importing its BOM
See gh-9021
Closes gh-9050
2017-05-02 09:16:31 +02:00
Phillip Webb 00c67f1962 Support SpringApplicationBuilder with bound sources
Update `SpringApplicationBuilder` so that the `sources(...)` method
updates the primary sources. Prior to this commit, the fix for #8910
had the unfortunate side effect of stopping the
`SpringApplicationBuilder` from being used with
`spring.application.main` properties.

Fixes gh-9053
2017-05-02 00:14:35 -07:00
Phillip Webb 5ae1798ec5 Don't rely on ConfigurationPropertyName exceptions
Update `ConfigurationPropertySourcesPropertySource` to no longer use
`try/catch` when checking for valid names. A new `isValid` method has
been introduced to `ConfigurationPropertyName` which is offers better
performance.

Fixes gh-9058
2017-05-01 23:07:28 -07:00
Phillip Webb 8b1625b41d Short circuit binding if possible
Update the `Binder` to short circuit potentially expensive bean binding
if there are no known child properties. The shortcut can only be applied
when all used `ConfigurationPropertySources` return a non empty
`containsDescendantOf` result. This should be the case for most
Spring Boot applications, the exception being any apps that are running
in a security restricted environment.

Fixes gh-9023
2017-05-01 23:07:28 -07:00
Phillip Webb c22a21e386 Add 'contains descendant of' support
Update `ConfigurationPropertySource` with a `containsDescendantOf`
method that can be used to tell if a source contains any descendants
of the given name.

The result is Optional so that sources that cannot determine a result
may return `empty()`.

The existing `IterableConfigurationPropertiesSource` has a default
implementation that works by iterating the contained values. Most other
sources return `empty()` with the exception of the adapted
`RandomProperySource` with will return true for `random.*` names.

See gh-9023
2017-05-01 23:07:21 -07:00
Phillip Webb 35a51e45d8 Ignore nested with NoUnboundElementsBindHandler
Update `NoUnboundElementsBindHandler` to also support ignoring
nested properties. This change is required to allow the
`NoUnboundElementsBindHandler` to be used alongside the
`IgnoreNestedPropertiesBindHandler`.

See gh-9000
2017-05-01 22:47:55 -07:00
Phillip Webb 3153117429 Fix ConfigurationPropertyName ancestor bug
Fix an issue with `ConfigurationPropertyName` where the `isAncesorOf`
method would not work with `ConfigurationPropertyName.EMPTY`

See gh-9000
2017-05-01 22:46:45 -07:00
Phillip Webb 10b8eb3109 Split ConfigurationPropertySource for iteration
Create separate `IterableConfigurationPropertySource` and
`ConfigurationPropertySource` interfaces so that it's possible to
work out if a source can truly iterate the values that it contains.

Prior to this commit there was only a single
`ConfigurationPropertySource` interface, which returned an empty
Iterator when values could not be iterated. This design made it
impossible to tell the difference between a source that was empty, and
a source that could not be iterated.

The `ConfigurationPropertySources` class has been updated to adapt
non-enumerable and enumerable Spring PropertySources to the correct
`ConfigurationPropertySource` interface. It also deals with the edge
case of the `SystemPropertySource` running in a security restricted
environment.

Fixes gh-9057
2017-05-01 22:39:31 -07:00
Phillip Webb 53fd1f7f2e Fix cache sizing bug
Fix a cache size bug in `DefaultPropertyMapper` which caused the
cache to be purged immediately.

See gh-9000
2017-05-01 22:33:27 -07:00
Phillip Webb 6cdb02050d Reduce InMemoryAuditEventRepository default capacity
Lower the default capacity used in `InMemoryAuditEventRepository` from
4000 to 1000. This should help reduce memory consumption.

Fixes gh-9056
2017-05-01 22:31:39 -07:00
Phillip Webb 77d427af6c Fix occasional Jetty test failures
Update `DefaultServletWebServerFactoryCustomizerTests` so that the Jetty
access log tests use the default timezone. Prior to this commit it was
possible that running the tests outside of UTC could result in Jetty
throwing a "negative delay" IllegalArgumentException.

See gh-8819
2017-05-01 21:50:54 -07:00
Stephane Nicoll da0d7b5558 Merge pull request #9042 from michael-simons:fix-source-links
* pr/9042:
  Fix several broken links to sources
2017-04-29 21:22:36 +02:00
Michael J. Simons 18230d7f23 Fix several broken links to sources
Closes gh-9042
2017-04-29 21:22:16 +02:00
Phillip Webb d6099bafa3 Reduce ConfigurationPropertyName garbage
Update the `ConfigurationPropertyNameBuilder` to reduce the number of
objects created.

Fixes gh-9022
2017-04-28 14:25:25 -07:00
Phillip Webb 19f166a56f Delete remaining old `bind` classes
Remove the last deprecated class from `org.springframework.boot.bind`

See gh-9000
2017-04-28 14:24:15 -07:00
Phillip Webb 3f71b8453f Migrate missed tests to new Binder
Migrate a few tests that were missed to use the new `Binder`.

See gh-9000
2017-04-28 14:23:20 -07:00
Phillip Webb 528d776d2b Polish 2017-04-28 14:21:34 -07:00
Madhura Bhave 0759652b24 Tests for missing placeholders during binding
Add a test to ensure that that there is a hard failure when trying to
bind properties with missing placeholders.

Closes gh-8693
2017-04-28 12:09:50 -07:00
Phillip Webb 76593a3806 Merge branch '1.5.x' 2017-04-28 10:59:53 -07:00
Phillip Webb 72813a47e7 Polish 2017-04-28 10:59:14 -07:00
Phillip Webb 76ee2f401c Polish 2017-04-28 09:48:13 -07:00
Andy Wilkinson 1ee9653f7c Group tasks and provide descriptions for tasks and configurations
Closes gh-8817
2017-04-28 17:40:05 +01:00
Phillip Webb 4db4c81b9b Polish 2017-04-28 09:38:56 -07:00
Brian Clozel 3cc0f7b70d Document embedded web server refactoring
Closes gh-8532
2017-04-28 18:25:36 +02:00
Michael J. Simons 4a58e87201 Remove references to *EmbeddedServletContainerFactory
See gh-8532
2017-04-28 18:25:36 +02:00
Michael J. Simons 0436070b98 Fix docs howto customize the embedded webserver
This reflects the changes from 67556ba8.
See gh-8532.
2017-04-28 18:25:36 +02:00
Andy Wilkinson 762a13e84f Configure assemble to depend upon bootJar or bootWar
Closes gh-8824
2017-04-28 16:48:48 +01:00
Andy Wilkinson 0a8494ec74 Merge branch '1.5.x' 2017-04-28 15:44:05 +01:00
Andy Wilkinson df05aa4701 Merge branch '1.4.x' into 1.5.x 2017-04-28 15:41:53 +01:00
Andy Wilkinson bd95ad6430 Upgrade to Spring Restdocs 1.1.3.RELEASE
Closes gh-9040
2017-04-28 15:33:43 +01:00
Andy Wilkinson 5291fb5ff7 Upgrade to Hsqldb 2.3.5
Closes gh-9039
2017-04-28 15:33:43 +01:00
Andy Wilkinson 344255807b Upgrade to Jaybird 2.2.13
Closes gh-9038
2017-04-28 15:33:42 +01:00
Andy Wilkinson 59d04d0679 Upgrade to Elasticsearch 2.4.5
Closes gh-9037
2017-04-28 15:33:42 +01:00
Andy Wilkinson c3c2a91916 Upgrade to Groovy 2.4.11
Closes gh-9036
2017-04-28 15:33:41 +01:00
Andy Wilkinson bc464adba3 Upgrade to Tomcat 8.5.14
Closes gh-9035
2017-04-28 15:33:41 +01:00
Andy Wilkinson b5811986b0 Upgrade to Ehcache 2.10.4
Closes gh-9034
2017-04-28 15:33:41 +01:00
Andy Wilkinson d0a85550d7 Upgrade to H2 1.4.195
Closes gh-9033
2017-04-28 15:33:40 +01:00
Stephane Nicoll 7c4a1a221d Merge branch '1.5.x' 2017-04-28 15:45:44 +02:00
Brian Clozel b8fe06c103 Manage all Netty dependencies
Until we can use the Netty BOM (see gh-9021), this change adds all
Netty modules as managed dependencies so as to avoid version
clashes between managed and unmanaged Netty dependencies.

Fixes gh-8553
2017-04-28 14:13:06 +02:00
Brian Clozel f2c63706da Change default file extension for Mustache templates
This commit changes the default file extension for Mustache templates,
from `.html` to `.mustache`, which is the file extension used in the
official reference documentation and by most IDE plugins.

Fixes gh-8997
2017-04-28 14:12:26 +02:00
Brian Clozel 4d5dcca553 Add Thymeleaf auto-configuration for WebFlux
Thymeleaf 3.0 implements the Spring 5.0 view infrastructure for WebMVC
and the new WebFlux framework. This commit adds auto-configuration for
the WebFlux support.

In that process, the configuration property for `spring.thymeleaf` has
been changed to add `spring.thymeleaf.servlet` and
`spring.thymeleaf.reactive` for MVC/WebFlux specific properties.

Now that the `spring-boot-starter-thymeleaf` does not only support
Spring MVC, the transitive dependency on `spring-boot-starter-web` is
removed from it.

Fixes gh-8124
2017-04-28 14:11:45 +02:00
Stephane Nicoll 1de2316a0b Refine validator and MVC validator configuration
This commit ensures that a primary JSR 303 and Spring Validator will be
exposed if the auto-configuration kicks in. As `LocalValidatorFactoryBean`
exposes 3 contracts (JSR-303 `Validator` and `ValidatorFactory` as well as
the `Spring` validator one), this makes sure that those types can be
injected by type.

`LocalValidatorFactoryBean` exposes 3 contracts and we're only checking
for the absence of a `javax.validation.Validator` to auto-configure a
`LocalValidatorFactoryBean`. If no standard JSR validator exists but a
Spring's `Validator` exists and is primary, we shouldn't flag the
auto-configured one as `@Primary`. Previous iterations on this feature
have made sure that we'll auto-configure at most one
`javax.validation.Validator` so not flagging it `@Primary` is no problem.

This commit also restores and adds tests that validates
`ValidationAutoConfiguration` will configure a JSR validator even if a
Spring Validator is present.

This effectively fixes gh-8495 in a different way.

Closes gh-8979
Closes gh-8976
2017-04-28 11:41:42 +02:00