Commit Graph

1032 Commits

Author SHA1 Message Date
Phillip Webb a8d099f6b8 Revert "Add start/stop goals to maven plugin"
This reverts commit 54e12a07e6.
2015-04-16 12:32:06 -07:00
Stephane Nicoll 54e12a07e6 Add start/stop goals to maven plugin
SpringApplicationLifecycle provides lifecycle operations on the current
Spring Boot application. It can be registered as an MBean of the platform
MBean server if a specific property is set. Besides, the JMX name can
also be customized via a property in case more than one Spring Boot
application is started in the same process.

The Maven plugin uses that MBean to check that the application is ready
before ending the "start" phase. It uses it to trigger a proper shutdown
of the application during the "stop" phase.

If the process has to be forked, the platform MBean server is exposed on
a configurable port so that the maven plugin can connect to it.

Such change permits the maven plugin to integrate a classical integration
test scenario where the "start" goal is invoked during the
pre-integration phase and the "stop" goal during the post-integration
phase.

Closes gh-2525
2015-04-16 11:50:18 +02:00
Andy Wilkinson 92702b4cd4 Merge branch '1.2.x' 2015-04-16 09:43:06 +01:00
Andy Wilkinson 337673b31d Support String values for factoryBeanObjectType attribute on bean def
To allow us to determine the type that Spring Integration’s
GatewayProxyFactoryBean will create, the bean definition created by
MessagingGatewayRegistrar needs to set the factoryBeanObjectType
attribute. The current implementation of BeanTypeRegistry requires the
attribute’s value to be a Class, however this would require Spring
Integration’s namespace handler to load the class and class loading
should be avoided in namespace handlers.

This commit updates BeanTypeRegistry so that it supports both Class and
String values for the factoryBeanObjectType. If the value is a String
it will interpret it as a class name and attempt to load it.

See gh-2811
2015-04-16 09:42:50 +01:00
Stephane Nicoll 578bd5dc37 Add TransactionTemplate auto-configuration
Provide a TransactionTemplate if one PlatformTransactionManager is
present.

Relocated the jta support as a nested package of the new transaction
package that hosts the transaction template auto-configuration. To avoid
package tangles, links between auto-configurations have been reversed.

Closes gh-2464
Closes gh-2809
2015-04-14 15:34:56 +01:00
Andy Wilkinson fdd3f12ee0 Merge branch '1.2.x' 2015-04-14 10:21:15 +01:00
Andy Wilkinson 4f988d2aec Polish log message in AutoConfigurationReportLoggingInitializer 2015-04-14 10:19:59 +01:00
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