Commit Graph

2256 Commits

Author SHA1 Message Date
Phillip Webb
813128a410 Add support for configuration properties binding
Create a new `Binder` class specifically designed to bind properties
from one or more `ConfigurationPropertySources` to an object.

The binder provides a replacement for `RelaxedBinder` and attempts to
fix the limitations of the previous solution.

Closes gh-8868
2017-04-27 13:59:25 -07:00
Phillip Webb
a5651b75de Create ConfigurationPropertySource abstraction
Add a new abstraction that represents a source for configuration
properties. The new source is similar to the `Environment` abstraction
provided by Spring Framework but follows a stricter set of rules.

The `ConfigurationPropertySource` provides a uniform view onto a source
and will help to move responsibility for accessing properties in a
"relaxed" way away from the caller.

The `ConfigurationPropertyName` class enforces strict naming rules
that callers must follow when accessing properties. Configuration
names are lowercase, dot separated and may contain dashes. In
addition "indexed" name elements may be defined by using square
brackets.

Mapping is provided to existing Spring PropertySources implemented with
the relaxed rules that users are used to. For example the configuration
property `server.local-host` can still be written in a property files
as `server.localHost` or in an environment variable as SERVER_LOCALHOST.

Closes gh-4910
2017-04-27 13:59:25 -07:00
Phillip Webb
dbc7e938c8 Restructor and improve Origin support
Move the `Origin` and related classes from `o.s.boot.env` to
`o.s.boot.orgin` and extend support. The concept of an origin can now
be used outside of just the Spring Environment abstraction.

Closes gh-9001
2017-04-27 13:59:25 -07:00
Phillip Webb
b10e2f3a05 Deprecate relaxed property concepts
Deprecate `RelaxedDataBinder`, `RelaxedPropertyResolver` and related
classes in preparation for the updated configuration properties binder
work.

See gh-9000
2017-04-27 13:59:25 -07:00
Phillip Webb
39b33d30e1 Rework SpringApplication sources property
Update `SpringApplication` so that the `sources` property is
independent to the primary source provided on construction.

Prior to this commit the sources property was a little unusual in that
calling set would add to the existing collection.

Closes gh-8910
2017-04-27 13:59:07 -07:00
Phillip Webb
102da8b3c6 Polish 2017-04-27 13:58:30 -07:00
Phillip Webb
1ad318d8a6 Refine Mustache support
Refine Mustache support to provide a cleaner separation between the
reactive and servlet implementations. The views have now moved to the
`spring-boot` project and the auto-configuration has been split into
two distinct `@Imports` to save needing full package declarations.

See gh-8941
2017-04-25 10:07:22 -07:00
Madhura Bhave
c2e5fd031a Replace usage of WebMvcConfigurerAdapter
Closes gh-8964
2017-04-24 15:31:39 -07:00
Spring Buildmaster
9768b0a8c2 Next Development Version 2017-04-21 08:32:01 +00:00
Spring Buildmaster
d719d2cbbc Next Development Version 2017-04-20 12:46:19 +00:00
Phillip Webb
383640d5ec Merge branch '1.5.x' 2017-04-17 22:15:33 -07:00
Phillip Webb
f46d799f31 Polish 2017-04-17 22:08:51 -07:00
Madhura Bhave
7afec5c16f Fail hard if snakeyaml not present when loading yaml
Closes gh-8900
2017-04-17 11:45:11 -07:00
Stephane Nicoll
aa4051727b Merge branch '1.5.x' 2017-04-12 14:37:08 +02:00
Stephane Nicoll
6567018b70 Merge branch '1.4.x' into 1.5.x 2017-04-12 14:36:48 +02:00
Stephane Nicoll
2579023035 Fix javadoc
Closes gh-8892
2017-04-12 14:36:02 +02:00
Stephane Nicoll
d4251125fc Make sure Admin MBean works also with webflux
This commit improves `SpringApplicationAdminMXBeanRegistrar` so that it
work with traditional Servlet-based app but also with Spring WebFlux.

Closes gh-8533
2017-04-12 14:30:42 +02:00
Phillip Webb
d21a5076fe Upgrade to Reactor BOM Bismuth SNAPSHOT
See gh-8884
2017-04-11 14:53:46 -07:00
Brian Clozel
b91e03b91c Fix devtools support in NettyWebServer
This commit improves the lifecycle of the `NettyWebServer` and allows
multiple restarts when using devtools. Previously, the lifecycle was
tailored for a single start/stop cycle.

Fixes gh-8771
2017-04-10 14:57:29 +02:00
Andy Wilkinson
858bd8554d Align test logging config with latest change in Spring Framework
See spring-projects/spring-framework@ea5cb26d75
2017-04-10 09:39:05 +01:00
Andy Wilkinson
7a4b87be6b Merge branch '1.5.x' 2017-04-07 12:21:09 +01:00
Andy Wilkinson
c74f0a70ca Merge branch '1.4.x' into 1.5.x 2017-04-07 12:14:47 +01:00
Andy Wilkinson
5dad7182db Address deprecation warnings 2017-04-07 12:01:01 +01:00
Andy Wilkinson
d43a75f0b7 Upgrade to Log4j2 2.8.2
Closes gh-8854
2017-04-07 11:47:39 +01:00
Andy Wilkinson
f0c5372642 Align with Spring Framework 5's new Commons Logging adapter
Closes gh-8825
2017-04-06 13:22:53 +01:00
Phillip Webb
2de7e9c310 Merge branch '1.5.x' 2017-04-04 10:07:38 -07:00
Phillip Webb
ad38776de3 Polish 2017-04-04 09:48:10 -07:00
Phillip Webb
ddcb5ee328 Polish 2017-04-04 09:36:27 -07:00
Andy Wilkinson
9c56003865 Merge branch '1.5.x' 2017-04-04 10:03:35 +01:00
Andy Wilkinson
4d71bfbf5c Merge branch '1.4.x' into 1.5.x 2017-04-04 10:03:19 +01:00
Andy Wilkinson
4b1e5e9c43 Improve diagnostics when loading a property source from a file fails
Closes gh-8294
2017-04-04 10:02:10 +01:00
Brian Clozel
ba3b83c739 Fix dependency scope for reactor-test
This is a test dependency and should be marked as such.

Fixes gh-8789
2017-03-31 17:26:45 +02:00
Stephane Nicoll
4a8d353263 Merge branch '1.5.x' 2017-03-31 15:10:08 +02:00
Stephane Nicoll
52527c7298 Polish "Use git.commit.id.abbrev if present" contribution
Closes gh-8781
2017-03-31 15:09:43 +02:00
Pablo Tamarit
30b6166bc1 Use git.commit.id.abbrev if present
Currently GitProperties always shortens the property git.commit.id to an
hardcoded length of 7.

However, both the Maven plugin git-commit-id-plugin and the Gradle
plugin gradle-git-properties are now providing the property
git.commit.id.abbrev along with the propery git.commit.id.
Moreover, the Maven plugin allows to customize the length of the
abbreviated commit ID with the configuration abbrevLength. The Gradle
plugin doesn't allow (yet) to configure this length.

Closes gh-8773
2017-03-31 15:09:43 +02:00
Andy Wilkinson
99aa155412 Update tests that use WebClient following changes to its API 2017-03-29 21:02:57 +01:00
Johnny Lim
287520a810 Polish
Closes gh-8698
2017-03-28 10:06:00 +02:00
Johnny Lim
46a0aaac7a Add a missing test for "Fix properties parsing for comment chars"
Closes gh-8699
2017-03-28 10:01:27 +02:00
Stephane Nicoll
28a4d5e01b Merge branch '1.5.x' 2017-03-26 12:12:09 +02:00
Stephane Nicoll
c6182d510c Merge branch '1.4.x' into 1.5.x 2017-03-26 12:11:54 +02:00
Kyle Anderson
57977a654a Fix typo
Closes gh-8718
2017-03-26 12:10:04 +02:00
Madhura Bhave
cfb1defb9e Log the port used by Netty
Closes gh-8681
2017-03-24 12:19:28 -07:00
Madhura Bhave
f32f7c51e1 Merge branch '1.5.x' 2017-03-17 16:19:02 -07:00
Madhura Bhave
e6f4d84618 Support setting log level ALL in logback
Fixes gh-8639
2017-03-17 15:51:30 -07:00
Stephane Nicoll
78431478e8 Remove System.out
Closes gh-8647
2017-03-17 09:15:55 +01:00
Dave Syer
fe8fa2831a Fix properties parsing for comment chars
Update `OriginTrackedPropertiesLoader` to correctly deal with property
values that happen to contain comment characters.

Prior this this commit, values of the following form would not be
parsed correctly:

	foo=bar!
	bar=spam

Closes gh-8647
2017-03-16 13:43:18 -07:00
Stephane Nicoll
b7d3aad54b Merge branch '1.5.x' 2017-03-16 12:43:47 +01:00
Stephane Nicoll
fa3679af71 Merge branch '1.4.x' into 1.5.x 2017-03-16 12:40:12 +01:00
Stephane Nicoll
cd76da9a4c Avoid using immutable collections for configuration proprerties
Closes gh-8620
2017-03-16 12:39:48 +01:00
Phillip Webb
b76ca0bf8f Restructure web auto-configuration
Restructure `org.springframework.boot.autoconfigure.web` to better align
with the new package structure in `spring-boot`.

Auto-configuration is now split into client, servlet and reactive
sub-packages. In addition a new `http` package now handles common
HTTP concerns.

Fixes gh-8616
2017-03-14 22:06:28 -07:00