Commit Graph

1398 Commits

Author SHA1 Message Date
Phillip Webb
aae38db9af Fix compiler warnings only shown in Eclipse Mars 2015-10-07 23:40:28 -07:00
Phillip Webb
c9fb9916b8 Reformat code using Eclipse Mars 2015-10-07 23:37:10 -07:00
Phillip Webb
e473364e4e Merge branch '1.2.x' 2015-10-07 23:34:08 -07:00
Phillip Webb
6ab376e2e8 Reformat code use Eclipse Mars 2015-10-07 23:32:31 -07:00
Andy Wilkinson
291955613f Fix compile error in tests that doesn’t affect the compiler in Eclipse 2015-10-07 15:12:26 +01:00
Andy Wilkinson
0cdf19a4cb Update test to align with more precise information about target class
The latest Spring Framework 4.2.2 snapshots have reworked
EventListenerMethodProcessor so that it no longer queries a proxies
target class. Previously, when this was happening, it happened early
in the context's lifecycle when the bean's concrete type was unknown.
The led to the target class being set as the proxied interface.

With the latest 4.2.2 snapshots, the first call to
AopUtils.getTargetClass() happens in the test, by which time the
actual concrete type of the bean is known. This commit updates the
test so that its expectations match the more precise result.
2015-10-07 14:51:45 +01:00
Andy Wilkinson
953ef7091b Remove use of Ordered from auto-configuration classes
Closes gh-4056
2015-10-06 14:44:44 +01:00
Andy Wilkinson
bc590a8bf4 Polishing, primarily to keep Checkstyle happy 2015-10-06 11:14:05 +01:00
Andy Wilkinson
2c2c7cee8d Polish contribution
See gh-4082
2015-10-06 09:58:00 +01:00
Benedikt Ritter
6978694cb8 Improve error reporting when driver class version is unsupported
ClassUtils.isPresent(String, ClassLoader) swallows all Throwables when
trying to load a class by name. For this reason
UnsupportedClassVersionError will also be swallowed when user code is
trying to use a driver library which has been compiled with a later
JDK than the one the application is running with. All the user would

see was "Cannot load driver class". This change simply propagates the
UnsupportedClassVersionNumberError so that it is easier for users to
find the root cause of the problem.

Closes gh-4082
Closes gh-4091
2015-10-06 09:58:00 +01:00
Dave Syer
e17eab6430 Add placeholder resolution to OnResourceCondition
Users can write @ConditionalOnResource("${path.to.file}") and
placeholders are resolved from the environment.
2015-10-06 09:33:07 +01:00
Andy Wilkinson
cff1eea4c4 Make new configuration inner class static
See gh-4079
2015-10-05 14:35:00 +01:00
Alexander Tokarev
91a40dd66c Disable unnecessary database initialization
If a DataSource class is found in the classpath then
EmbeddedDataSourceConfiguration will not be used, so the in-memory
database will not be shutdown on application context closing.
As a result, unnecessary database initialization may cause subsequent
tests to fail, for example see [1].

[1] https://github.com/spring-projects/spring-boot/issues/1712
2015-10-05 14:18:39 +01:00
Andy Wilkinson
a4eec42813 Ensure that new JPA-based test doesn’t accidentally enable Bitronix 2015-10-05 14:07:01 +01:00
Andy Wilkinson
d01236db30 Fix compile failure that doesn’t occur in Eclipse but does on Travis 2015-10-05 13:47:35 +01:00
Andy Wilkinson
fd53cbf2f3 Stop JPA and a custom Flyway bean from causing a startup failure
Previously, if an application used JPA and declared its own Flyway bean,
startup would fail. The custom Flyway bean would switch off
auto-configuration of the FlywayMigrationInitializer bean but the
context’s entity manager factory beans would still be configured to
depend on the migration initialiser.

This commit splits the post-processor that configures the dependencies
into two. One that configures the dependency on the Flyway bean and
one that configures the dependency on the FlywayMigrationInitializer
bean. When to auto-configuration of the FlywayMigrationInitializer is
switched off, the auto-configuration of the latter dependency is also
switched off.

Closes gh-4079
2015-10-05 13:36:20 +01:00
Andy Wilkinson
917077c3dd Merge branch '1.2.x' 2015-10-05 11:41:30 +01:00
Andy Wilkinson
a94f3a0cbf Only try to auto-configure Jetty when jetty-webapp is on the classpath
Closes gh-4089
2015-10-05 11:41:23 +01:00
Andy Wilkinson
5c35d89fd1 Revert "Update tests to shut down in-memory databases proactively"
For reasons I don't (yet?) understand, shutting down the databases
proactively triggers a StackOverflowError in Jersey. Reverting the
change while I try to figure out what's going in.
2015-10-05 11:07:47 +01:00
Andy Wilkinson
72122ec965 Update tests to shut down in-memory databases proactively 2015-10-05 10:15:49 +01:00
Phillip Webb
d1b936ef2c Merge branch '1.2.x' 2015-10-02 15:44:25 -07:00
Phillip Webb
87a515f6a0 Fix TemplateAvailabilityProvider binding issues
Update all TemplateAvailabilityProvider implementations to use the
relaxed property binder. Also fix FreeMarkerTemplateAvailabilityProvider
to use `template-loader-path` rather than `path`.

Fixes gh-4085
2015-10-02 15:39:43 -07:00
Phillip Webb
5e58645202 Log warning for template folder not found problems
Update template auto-configurations to log a warning message rather
than throw an exception if the template folder cannot be found.

Fixes gh-4075
2015-10-02 15:37:39 -07:00
Phillip Webb
5ccd9afc78 Merge branch '1.2.x' 2015-10-02 15:08:25 -07:00
Phillip Webb
891faa9d35 Fix test cleanup to reset commons logging 2015-10-02 15:04:04 -07:00
Andy Wilkinson
fac42adb61 Use the right version of ClassUtils 2015-10-02 21:13:52 +01:00
Phillip Webb
2f694fa406 Add per-line match indicators to a/c report
Update the logged auto-configuration report so that each line includes
"matched", "did not match" text. This helps when looking to see if a
specific auto-configuration class was applied or not.

Fixes gh-4084
2015-10-02 13:09:31 -07:00
Andy Wilkinson
eae7b0364b Replace use of deprecated JdkVersion API by looking for presence of classes
This commit updates ConditionalOnJava to remove a dependency on the
deprecated JdkVersion API from Spring Framework. In its place it now
looks for the presence of certain classes to determine the version of
Java on which its running.

Closes gh-4005
2015-10-02 19:55:38 +01:00
Phillip Webb
c3b7764b72 Polish 2015-10-02 11:25:56 -07:00
Stephane Nicoll
19b5e59234 Use spring.velocity.charset for template encoding
Previously `spring.velocity.charset` only controlled the output encoding
with the templates being loaded with the default encoding. We now
consistently set the same value for both the input and output encodings.

It is still possible to override it to a different value using
`spring.velocity.properties.input.encoding`

Closes gh-3994
2015-10-02 16:22:08 +02:00
Stephane Nicoll
8978f54cc3 Use spring.velocity.charset for template encoding
Previously `spring.velocity.charset` only controlled the output encoding
with the templates being loaded with the default encoding. We now
consistently set the same value for both the input and output encodings.

It is still possible to override it to a different value using
`spring.velocity.properties.input.encoding`

Closes gh-3994
2015-10-02 16:12:42 +02:00
Stephane Nicoll
c6040e42a8 Fix typo 2015-10-02 14:06:10 +02:00
Stephane Nicoll
b2c3e7e2ed Rename error.* properties to server.error.*
Closes gh-4050
2015-10-02 14:03:24 +02:00
Andy Wilkinson
f86eed8646 Polish contribution 2015-10-02 09:03:26 +01:00
mackeprm
942da8bdd3 Support configuration of defaultValue and emptyStringIsFalse
This commit adds support for configuring defaultValue and
emptyStringIsFalse to MustacheCompilerFactoryBean.

Closes gh-4057
2015-10-02 08:57:43 +01:00
Phillip Webb
33ce160251 Automatically X-Forwarded-For in the cloud
Update `ServerProperties` to automatically enable `use-forward-headers`
when running on a cloud platform.

A new `CloudPlatform` enum has been introduced that detects Heroku and
Cloud Foundry.

See gh-4018
2015-10-02 00:00:14 -07:00
Phillip Webb
20b29db512 Unify ServerProperties X-Forwarded-For support
Add a new `server.use-forward-headers` property which can be used to
switch on X-Forwarded-For header support in all supported embedded
servlet containers.

This commit reverts the decision to enable `RemoteIpValve` with Tomcat
by default (gh-3782) and requires that either `user-forward-headers` is
set to true or that `server.tomcat.protocol-header` or
`server.tomcat.remote-ip-header` are set.

See gh-4018
See gh-3782
2015-10-01 23:59:59 -07:00
Phillip Webb
6be072ae07 Polish 2015-10-01 14:44:23 -07:00
Phillip Webb
0b36ba97b3 Polish order 2015-10-01 12:02:32 -07:00
Stephane Nicoll
93d12494e5 Migrate Spring Data Rest settings
In order to have more control on the structure of the configuration, we
do not bind to `RepositoryRestConfiguration` directly anymore. This
commit introduces `RepositoryProperties` instead.

See gh-3854
Closes gh-4073
2015-10-01 17:56:32 +02:00
izeye
5b211706c0 Polish
Closes gh-4069
2015-10-01 09:56:33 +02:00
Phillip Webb
acde5407e8 Polish 2015-09-30 15:48:19 -07:00
Stephane Nicoll
eeaa1df1dd Allow Mongo support without Spring Data MongoDB
Closes gh-4049
2015-09-30 14:56:59 +02:00
Andy Wilkinson
1e50d988ab Tighten up the conditions on WebSocketMessagingAutoConfiguration
See gh-2445
2015-09-29 17:24:56 +01:00
Andy Wilkinson
204cb6f195 Auto-configure WebSocket JSON converter to use context’s ObjectMapper
This commit adds auto-configuration support for WebSocket-based
messaging. When the user enables WebSocket messaging (typically via
@EnableWebSocket and @EnableWebSocketMessageBroker) and an ObjectMapper
bean exists, a MappingJackson2MessageConverter that uses the
ObjectMapper will be configured. This causes any spring.jackson.*
configuration to affect WebSocket message conversion in the same way
as it affects HTTP message conversion.

Closes gh-2445
2015-09-29 16:48:02 +01:00
Michael Stummvoll
a1e0f01103 Support error.include-stacktrace configuration
Add `error.include-stacktrace` configuration option to determine when
stack trace attributes should be added. Options are `never`, `always`
or `on-trace-param`.

Prior to this commit stacktrace attributes were never includes in HTML
responses, and only included in JSON responses when a `trace` request
parameter was set to `true`. This has now been changed so that,
by default, stacktrace attributes are never included.

The BasicErrorController includes a protected method that can be
overridden if includes should be different depending on the `produces`
mapping.

Closes gh-2371
2015-09-28 12:14:38 -07:00
Stephane Nicoll
f918bf9c11 Fix broken build 2015-09-28 17:16:27 +02:00
Dave Syer
2e3658fd91 Enable RemoteIpValve by default
Fixes gh-3782
2015-09-28 13:58:29 +01:00
Phillip Webb
57a698f388 Fix broken Cassandra tests
See gh-2064
2015-09-25 23:59:00 -07:00
Julien Dubois
c401330901 Add Cassandra support
Add auto-configuration support and health checks for Cassandra and
Spring Data Cassandra.

Fixes gh-2064
Closes gh-2214
2015-09-25 23:00:53 -07:00