Commit Graph

1025 Commits

Author SHA1 Message Date
Stephane Nicoll f480c0de2f Merge branch '1.2.x' 2015-04-14 09:51:58 +02:00
Stephane Nicoll 0f14210937 Polish documentation 2015-04-14 09:51:14 +02:00
Stephane Nicoll 452ce0ffad Polish
Add setter for cache names so that it can be bound both via indexed
access and comma-separated list.
2015-04-10 17:20:29 +02:00
Phillip Webb ebccedcfdd Add FlywayMigrationStrategy support
Update FlywayAutoConfiguration to support pluggable migration
strategies. Rather than always calling flyway.migrate(), users can now
provide a FlywayMigrationStrategy @Bean to call whatever methods they
wish.

Fixes gh-1814
2015-04-09 15:34:50 -07:00
Andy Wilkinson ba3d4e9e3c Upgrade to Spring Security 4
This commit updates Spring Boot to use Spring Security 4. As a result
of this, the coordinates of Thmyeleaf's Spring Security extra, for
which dependency management and auto-configuration is provided, have
been updated to the Spring Security 4 variant.

Closes gh-2727
2015-04-09 13:55:02 +01:00
Andy Wilkinson d13878e193 Upgrade to Spring Data Fowler RELEASE
The versions in the dependency management for the various datastore
dependencies have been aligned with those used by Spring Data Fowler.

The Data REST tests and sample application has been updated to configure
the base path in favour of the deprecated base uri property

Closes gh-2673
2015-04-09 12:20:45 +01:00
Andy Wilkinson 1dcf18b16e Allow Jackson's serialization inclusion to be configured via the env
This commit adds support for configuring an ObjectMapper's
serialization inclusion using the environment via the
spring.jackson.serialization-inclusion property. The property's value
should be one of the values on the JsonInclude.Include enumeration.
Relaxed binding of the property value to the enum is supported. For
example:

spring.jackson.serialization-inclusion: non_null

Closes gh-2532
2015-04-08 16:47:49 +01:00
Andy Wilkinson 2a5eecaf4a Merge branch '1.2.x' 2015-04-08 15:57:13 +01:00
izeye b45bb6d082 Make all of GsonHttpMessageConvertersConfiguration conditional on Gson
Previously GsonHttpMessageConvertersConfiguration was unconditional
with its nested configuration class being
@ConditionalOnClass(Gson.class). This led to the unnecessary
registration of the GsonHttpMessageConvertersConfiguration bean when
Gson isn't on the classpath.

This commit moves the condition up onto the outer class so that no
Gson-related beans are created when Gson is not on the classpath.

Closes gh-2778
2015-04-08 15:56:39 +01:00
Andy Wilkinson 507520aab9 Merge branch '1.2.x' 2015-04-08 15:50:08 +01:00
Andy Wilkinson 5547f91bfb Correct name of check-template-location property in error message
Closes gh-2788
2015-04-08 15:48:54 +01:00
Phillip Webb c4ddce6b73 Polish 2015-04-07 13:14:21 -07:00
Andy Wilkinson 8b1022effa Upgrade to Spring Batch 3.0.4 snapshots
Closes gh-2712
2015-04-07 18:47:28 +01:00
Stephane Nicoll 0fc54b7c5b Add ConditionalOnSingleCandidate
Add a new ConditionalOnSingleCandidate condition that determines if the
condition should match only if autowiring by type is guaranteed to
succeed. Used by auto-configuration that relies on a single candidate of
a given type (for instance, the JdbcTemplate auto-configuration relies on
the presence of a DataSource).

Such wiring by type will succeed if only one bean of that type is present
or if one matching instance is flagged "primary" amongst the candidates.

ConditionalOnSingleCandidate is a basic version of ConditionalOnBean that
only accepts a single type and does not determine a defaut based on its
presence on a bean definition.

Closes gh-1702
2015-04-07 16:20:55 +02:00
Andy Wilkinson a69cd36dbc Merge branch '1.2.x' 2015-04-07 11:40:41 +01:00
Andy Wilkinson d4ffab2f02 Provide additional config metadata for spring.http.gzip.enabled
See gh-2776
2015-04-07 11:40:05 +01:00
Andy Wilkinson 3df6cb1325 Merge branch '1.2.x' 2015-04-07 11:37:43 +01:00
Andy Wilkinson 212520fa15 Add a property to disable auto-configuration of GzipFilter
Closes gh-2776
2015-04-07 11:24:24 +01:00
Phillip Webb 59692cd938 Polish formatting 2015-04-06 18:03:59 -07:00
Stephane Nicoll fbe9774890 Use spring.cache.config with JCache
According to the spec, specifying a custom URI when retrieving a
`javax.cache.CacheManager` might be used as a way to transmit the
location of a custom configuration file to initialize the underlying
cache manager.

If `spring.cache.config` is set, we use that information to retrieve a
CacheManager with that configuration file. Unfortunately, hazelcast does
not support this feature so we are setting the property key it expects
instead.

See https://github.com/hazelcast/hazelcast/issues/4943

Closes gh-2743
2015-04-03 15:24:58 +02:00
Eddú Meléndez fcae5a7df8 Add missing type check on EhCacheCacheConfiguration
Previously, EhCacheCacheConfiguration could be triggered even if the
ehcache library is not present. This commit adds the missing
`ConditionalOnType` that now guards the configuration properly.

See gh-2633
2015-04-03 15:10:52 +02:00
Stephane Nicoll 3b99ba9d61 Add missing classpath checks
Certain cache manager implementations are located in the
spring-context-support module that isn't pulled automatically.

As a result, the related cache auto-configurations should make sure that
the relevant CacheManager implementation is available.

See gh-2633
2015-03-31 11:26:25 +02:00
Stephane Nicoll 9f1475d708 Fix wrong import in Guava auto-config
Remove the need for `commons-collections`

See gh-2633
2015-03-31 11:22:11 +02:00
Stephane Nicoll 24d9afa67b Fix wrong import in JCache auto-config
Remove the need for `commons-collections`

See gh-2633
2015-03-31 11:20:45 +02:00
Stephane Nicoll ff7c66c0d2 Fix annotation() javadoc 2015-03-31 08:18:54 +02:00
Spring Buildmaster e03c11dda8 Next development version 2015-03-30 22:56:20 -07:00
Phillip Webb 5d9efe40d0 Merge branch '1.2.x' 2015-03-30 17:01:08 -07:00
Dave Syer 18afe8bd0c Fixup incorrect property name
The property in XADataSourceAutoConfigurationTests should be
`data-source-class-name`. Previously the `-name` was missing.
2015-03-30 16:45:02 -07:00
Phillip Webb fbf34e261e Polish 2015-03-30 10:37:02 -07:00
Phillip Webb d07e18143d Merge branch '1.2.x' 2015-03-30 10:23:13 -07:00
Phillip Webb e3f203a8a5 Polish 2015-03-30 10:22:54 -07:00
Andy Wilkinson 8850286937 List excluded auto-config classes in the auto-config report and endpoint
Prior to this commit, the auto-configuration report (both in its logged
form and the actuator endpoint) listed the positive and negative matches
but did not list the classes, if any, that the user had excluded.

This commit updates the logged report and the actuator endpoint to
expose a list of the excluded class names configured via the exclude
attribute on @EnableAutoConfiguration.

Closes gh-2085
2015-03-30 16:23:34 +01:00
Andy Wilkinson ed5853e60e Merge branch '1.2.x' 2015-03-30 10:57:11 +01:00
Andy Wilkinson c3571d416a Improve YAML-based configuration of Tomcat compression
Tomcat uses the strings “on” and “off” to enable and disable
compression. YAML interprets on as true and off as false, leaving
ServerProperties.Tomcat.compression configured with “true” and “false”
respectively. One solution is to use “on” rather than on and “off”
rather than off in the YAML file but users may not realise that they
need to do so.

This commit updates the connector customiser that configures compression
to map “true” to “on” and “false” to “off”.

Closes gh-2737
2015-03-30 10:56:07 +01:00
Stephane Nicoll 72561f8969 Fix typo 2015-03-30 09:42:08 +02:00
Phillip Webb 85319c0793 Fix Java 8 Javadoc errors 2015-03-27 18:59:47 -07:00
Eddú Meléndez 48959f2553 Add support for EhCache
Include auto-configuration support for EhCache with auto-detection of
the default `ehcache.xml` at the root of the classpath. EhCache
configuration can also be set via `spring.cache.config`.

See gh-2633
2015-03-27 15:55:42 -07:00
Stephane Nicoll 151220f41d Add cache manager auto-configuration
Add support for cache manager auto-configuration that is triggered when
the `EnableCaching` annotation is added to a Spring Boot application.

A new "spring.cache" set of configuration keys is also provided. The
"spring.cache.mode" allows the user to specify the cache provider that
should be auto-configured. If no explicit configuration is provided,
the environment is checked for the best suited cache implementation,
that is:

- Generic if at least one `Cache` bean is defined in the context.
- Hazelcast if either a default configuration file is present or the
  `spring.cache.config` property is set.
- JCache if one JSR-107 provider is present
- Redis if a `RedisTemplate` is defined in the context
- Guava
- Simple as a fallback option, using concurrent maps
- NoOp (that is, no cache) if the mode is set to "none"

If the provider supports it, it is possible to specify the caches
to create on startup via `spring.cache.cache-names`. If the provider
relies on a configuration file and a custom one needs to be used
`spring.cache.config` can be set to such custom resource.

If more than one JSR-107 provider is present, it is possible to force
the provider to use by setting the mode to `jcache` and specifying the
fully qualified class name of the CachingProvider to use via
`spring.cache.jcache.provider`.

See gh-2633
2015-03-27 15:55:36 -07:00
Phillip Webb 10da3d390e Polish 2015-03-27 11:30:58 -07:00
Stephane Nicoll e21d8042ad Upgrade event listener to GenericApplicationListener
SmartApplicationListener has been superseded by GenericEventListener as
of Spring Framework 4.2. It will be eventually deprecated and removed.

Migrate our event listeners to use the new contract.

Closes gh-2576
2015-03-27 17:13:25 +01:00
Andy Wilkinson d7818b441e Merge branch '1.2.x' 2015-03-26 18:03:23 +00:00
Andy Wilkinson 0da24f82e3 Polishing: move tests for mustache.web into the correct package 2015-03-26 18:02:43 +00:00
Andy Wilkinson dd748eda19 Use the configured charset, if any, in MustacheViewResolver
Closes gh-2670
2015-03-26 18:02:37 +00:00
Andy Wilkinson 95a0be3cb2 Merge branch '1.2.x' 2015-03-25 17:27:35 +00:00
Andy Wilkinson 219317e8c7 Make web security config require spring-security-web on classpath
Previously, SpringBootWebSecurityConfiguration required a web
application and @EnableWebSecurity to be on the classpath.
@EnableWebSecurity is in spring-security-config so this could lead
to the configuration being active when spring-security-web isn't
on the classpath but the rest of Spring Security is.

This commit updates SpringBootWebSecurityConfiguration to also make it
conditional on a class in spring-security-web.

Fixes gh-2717
2015-03-25 17:22:30 +00:00
Andy Wilkinson bc99ad2120 Ignore Batch tests that use JDBC as they don’t work with Spring 4.2
Spring Framework’s ParamterizedRowMapper has been deprecated since
3.1 and has been removed in 4.2. Spring Batch currently relies on
ParameterizedRowMapper, making it incompatible with 4.2. To allow us to
build successfully against 4.2, this commit ignores Spring Boot’s tests
that use Spring Batch’s JDBC support.

See gh-2575
2015-03-25 10:48:00 +00:00
Andy Wilkinson 7a73c5883f Avoid using @Order on @Configuration classes as Spring now honours it
In Spring Framework 4.1, @Order on a @Configuration class had no effect.
This allowed us to use it on auto-configuration classes to control
the ordering of auto-configuration classes without it having any
broader implications for configuration class ordering.

Spring Framework 4.2 now honours @Order on @Configuration classes. This
breaks a number of tests where we were relying on the order that the
classes were passed to register when evaluating various bean conditions.

This commit replaces the use of @Order on auto-configuration classes
with a new annotation, @AutoConfigureOrder. The new annotation is
handled by AutoConfigurationSorter where it’s used to order
auto-configuration classes. This allows us to order auto-configuration
classes without the unwanted side-effect of this also affecting the
general ordering of configuration classes.

See gh-2575
2015-03-25 10:47:44 +00:00
Stephane Nicoll b963a82f36 Merge branch '1.2.x' 2015-03-23 11:09:52 +01:00
Raphael Ackermann 1235a35f2a fix typo in javadoc
{@code tomat-embedded.jar} --> {@code tomcat-embedded.jar}
2015-03-23 11:08:48 +01:00
Andy Wilkinson 9444a25de3 Merge branch '1.2.x' 2015-03-18 14:06:36 +00:00