Commit Graph

1322 Commits (d09805fd750163d1d03f1c5b1e85d8a2162e048c)

Author SHA1 Message Date
Andy Wilkinson b1ad2c30eb Ignore type-constrained converter when auto-configuring Jackson converter
Previously, JacksonHttpMessageConvertersConfiguration would configure a
general-purpose MappingJackson2HttpMessageConverter only if there was
no existing MappingJackson2HttpMessageConverter in the application
context. This was problematic when a
TypeConstrainedMappingJackson2HttpMessageConverter bean was present.
Such a bean is only capable of performing conversion for a specific
type, and therefore is no substitute for a general purpose converter,
yet its presence was causing the auto-configuration of a general
purpose converters to be turned off. This would leave Spring MVC’s
default converter being used for application/json requests which would
not honour the user’s Jackson configuration.

This commit enhances @ConditionalOnMissingBean so that the annotation
can be used to specify one or more types that should be ignored when
searching for beans. This allows the
TypeConstrainedMappingJackson2HttpMessageConverter beans that are
published by Spring Data REST to be ignored such that the
general-purpose MappingJackson2HttpMessageConverter is still
auto-configured.

Fixes gh-2914
10 years ago
Dave Syer 8c3f80eb64 Use mock servlet container for welcome page tests
Fixes gh-3371
10 years ago
Phillip Webb b5c435f8c4 Polish Actuator MVC customization support
See gh-3345
10 years ago
Phillip Webb df3ced1a45 Merge branch '1.2.x' 10 years ago
Phillip Webb 8ec10c8425 Use buildView() to create MustacheView
Update MustacheViewResolver so that buildView() is called to create
the MustacheView. This sets fields such as `contentType` and allows us
to remove explicit setApplicationContext() and setServletContext()
calls.

Fixes gh-3265
10 years ago
Andy Wilkinson 5a1e66b3d6 Make GzipFilterAutoConfiguration conditional on HttpMethod
GzipFilterProperties uses HttpMethod so GzipFilterAutoConfiguration,
which uses GzipFilterProperties, needs to be conditional on HttpMethod
being on the classpath.

Closes gh-3362
10 years ago
Dave Syer 1e464da248 Refactor the Actuator MVC configuration to allow more customization
There is a new spring.factories entry for
org.springframework.boot.actuate.autoconfigure.EndpointWebMvcConfiguration
which loads extra beans into the MVC config for the Actuator.
If the management context is a child context all the beans go in the
child (except the Spring Security filter still). A big bonus is that
you can add WebConfigurerAdapters to configure static resources etc.
A new component called ManagementContextResolver can be used to
locate the ApplicationContext for the MVC endpoints.

Fixes gh-3345
10 years ago
Phillip Webb 8d948dfa6c Be more lenient about expected exceptions 10 years ago
Phillip Webb 5c6fef903d Polish 10 years ago
Phillip Webb 268b7911dd Rename ResourceProperties.Chain.html5AppCache
Rename the `html5AppCache` property from `ResourceProperties.Chain` to
`html-application-cache`.

Fixes gh-3354
10 years ago
Phillip Webb d213cc05d5 Polish 10 years ago
Andy Wilkinson cc3aea2b69 Prevent Jetty’s singleton shutdown thread from breaking restarts
By default, Jetty uses a singleton shutdown thread, registered as a
shutdown hook, to stop its components. This single thread breaks the
restart logic in devtools as a second restart causes a second attempt to
start the singleton shutdown thread which fails with an
IllegalStateException. This processing is unnecessary in a Spring Boot
application as the application context’s lifecycle when ensure that
Jetty is shutdown.

This commit updates the embedded Jetty container to remove its
components from Jetty’s shutdown thread. This leaves the thread with
no components to manage at which point it removes its registration as a
shutdown hook.

Closes gh-3343
10 years ago
Andy Wilkinson 00d594dcda Replace GzipFilter and Tomcat compression with general purpose approach
Closes gh-3296
10 years ago
Ivan Sopov dde194e2b9 Use native compression for all embedded containers, not just Tomcat
See gh-3296
10 years ago
Stephane Nicoll 31a6d53a95 Fix typo 10 years ago
Stephane Nicoll a6ccb4a6e0 Polish
Polish resource handling chain support. Make sure that the chain is
enabled automatically if at least one strategy is enabled.

See gh-1604
10 years ago
Brian Clozel dd561d15cf Improve Spring Resource Handling support
This commit improves support of the Resource Handling features
introduced in Spring Framework 4.1. Those features add new ways to
resolve and transform static resources in applications.
See [this blog
post](https://spring.io/blog/2014/07/24/spring-framework-4-1-handling-static-web-resources)
for more details.

The `ResourceUrlEncodinFilter` is added for compatible template engines:
Velocity and Thymeleaf. It assists them with rewriting the URLs of
static resources when rendering templates.

New keys are added in the `ResourceProperties` in order to configure
the Resource Handling chain. `ResourceResolvers` and
`ResourceTransformers` are registered accordingly in
`WebMvcAutoConfiguration`.

Here is an example of enabling a `ContentVersionStrategy` on all
static resources, meaning their names will be changed for cache
busting purposes by adding a content hash at the end of the file name.
Like "/js/jquery.js -> /js/jquery-872ca6a9fdda9e2c1516a84cff5c3bc6.js".

```
spring.resources.chain.enabled:true
spring.resources.chain.strategy.content.enabled:true
spring.resources.chain.strategy.content.paths:/**
```

Closes gh-1604
Closes gh-3123
10 years ago
Stephane Nicoll 43b9ea53d6 Polish (avoid dot at the end of the line) 10 years ago
Phillip Webb 4236a9336d Make FlywayMigrationStrategy an interface
Change FlywayMigrationStrategy from a class to an interface.

Fixes gh-3217
10 years ago
Stephane Nicoll 1d66aa35ed Fix typo 10 years ago
cohee016 d948ec5810 Add Freemarker `prefer-file-system-access` support
Add a `spring.freemarker.prefer-file-system-access` property and update
FreeMarkerAutoConfiguration to support it.

Fixes gh-2901
10 years ago
Phillip Webb 61fc4f3f12 Polish copyright headers 10 years ago
Stephane Nicoll d0698bd8ed Remove unnecessary System.out in tests 10 years ago
Andreas Ahlenstorf a08b09563b Add support for jOOQ
Add auto-configuration and a starter POM for jOOQ.

See gh-2804
10 years ago
Andy Wilkinson 24ef2e506b Merge branch '1.2.x' 10 years ago
Andy Wilkinson 8681a8ad2a Map empty virtual host to "/" when parsed from an address
Previously, an address that ended in a "/" would result in the virtual
host being an empty string. This was inconsistent with setVirtualHost
which would map an empty string to "/".

This commit updates the address parsing logic to call setVirtualHost
rather than assigning the value directly to this.virtualHost. This
ensures that the special handling for an empty string is applied
consistently.

Closes gh-3304
10 years ago
Andy Wilkinson d30dd1fa98 Merge branch '1.2.x' 10 years ago
Andy Wilkinson 01ba0f7571 Make RemoteIpValve's protocolHeaderHttpsValue configurable via the env
Closes gh-3289
10 years ago
Artur Konczak 2e66f17491 Enable non local node Elasticsearch instances
Update ElasticsearchAutoConfiguration to allow `http.enabled` and
`node.local` settings to be specified by ElasticsearchProperties.

Fixes gh-2805
Closes gh-2913
10 years ago
Eddú Meléndez 8859824efc Add Apache Artemis support
Add auto-configuration support for Apache Artemis which was formed when
HornetQ was donated to the Apache Foundation. The majority of this code
is based on the HornetQ auto-configuration.

Fixes gh-3154
Closes gh-3246
10 years ago
Phillip Webb e6d5d7c7ab Fix failing MongoDataAutoConfigurationTests 10 years ago
Phillip Webb 2f16a01dd5 Polish 10 years ago
izeye 436054053c Fix default MBeanServer bean name in doc
Closes gh-3283
10 years ago
Andy Wilkinson fd6d61e8b4 Add auto-configuration support for Spring Session
This commit adds support for automatically configuring Spring Session.
In a web application when both Spring Session and Spring Data Redis
are on the classpath, Spring Session's Redis Http Session support
will be auto-configured. The max inactive interval for Redis-backed
sessions can be configured via the environment using the existing
server.session-timeout property.

Closes gh-2318
10 years ago
Eddú Meléndez 58ca6cdc76 Add support for FieldNamingStrategy
Closes gh-3031
Closes gh-3069
10 years ago
Kamil Szymanski 008dee5dce Add JDBC url to Driver class name mappings for DB2, Teradata and Firebird
See gh-2843
10 years ago
dgomesbr 1ebbf8ac4d Upgrade to Hazelcast 3.5
Closes gh-3267
Closes gh-3272
10 years ago
Stephane Nicoll be5e30b409 Migrate spring.view properties
Migrate `spring.view.prefix` and `spring.view.suffix` to
`spring.mvc.view.prefix` and `spring.mvc.view.suffix` respectively. The
former properties are still handled in a backward compatible way and are
defined as deprecated in the meta-data.

Closes gh-3250
10 years ago
Phillip Webb c3b344fdc2 Polish 10 years ago
Stephane Nicoll b5d49b3099 Expose additional admin features
Improve SpringApplicationAdminMXBean to expose additional information:

* Whether the application uses an embedded container
* The properties exposed by the `Environment`

This allows to know if the application is web-based and the HTTP port
on which it is running.

Closes gh-3067
10 years ago
Stephane Nicoll cb98ee25ff Polish
See gh-2900
10 years ago
Eddú Meléndez 4883a5240a Remove deprecated SimpleMongoDbFactory call
Update MongoAutoConfiguration to create a `MongoClient` bean rather than
`Mongo` and update `MongoDataAutoConfiguration` to remove the call to
the deprecated `SimpleMongoDbFactory`.

Fixes gh-3105
Closes gh-3126
10 years ago
Phillip Webb 73d5a858c5 Polish 10 years ago
Sebastien Deleuze 78a7b6ed66 Add async request timeout property
Add a new `spring.mvc.async.request-timeout` property which can be used
to configure AsyncSupportConfigurer.setDefaultTimeout(..).

Fixes gh-2900
Closes gh-3236
10 years ago
Eddú Meléndez 6d5ff33bdf Fix typos
Closes gh-3247
10 years ago
Phillip Webb 93a7dc21da Merge branch '1.2.x' 10 years ago
Phillip Webb cca0b76ac8 Support Velocity toolbox configurations from jar
Create an EmbeddedVelocityToolboxView which supports loading toolbox.xml
files from the application classpath as well as the ServletContext. The
VelocityAutoConfiguration class has been updated to use the new view.

This change allows the `spring.velocity.toolbox-config-location`
property to work with embedded servlet containers.

Fixes gh-2912
10 years ago
Phillip Webb 49039c33ea Polish 10 years ago
Phillip Webb d87f2713af Merge branch '1.2.x' 10 years ago
Phillip Webb 75ffd1b017 Polish 10 years ago
Phillip Webb a83d999f27 Add missing MultipartProperties.enabled property
Fixes gh-3209
10 years ago
Phillip Webb 135e9d10a6 Polish 10 years ago
Stephane Nicoll 961350735b Add test for CacheConfigFileCondition
CacheConfigFileCondition was not properly tested, leading to various
potential source of errors (that last one being gh-3233). This condition
is now tested properly.
10 years ago
Stephane Nicoll b7742a7267 Merge branch '1.2.x' 10 years ago
Stephane Nicoll 321a149297 Only associate JTA transaction manager
This is related to 38cca9c but for the Rabbit support. Update
RabbitAnnotationDrivenConfiguration to only associate a JTA transaction
manager, if any.

Closes gh-3222
10 years ago
izeye 0112260767 Fix typo in cache auto-configurations
Make sure that the EhCache support is triggered if
`spring.cache.ehcache.config` is set and the cache type is set to `auto`.

Same thing for Hazelcast.

Closes gh-3227
10 years ago
Stephane Nicoll c2b606de4c Merge branch '1.2.x' 10 years ago
Stephane Nicoll dc94fafaaa Fix dependency of AmqpAdmin
AmqpAdmin does not require a CachingConnectionFactory. Using the more
general CachingConnectionFactory provides more flexibility.

Closes gh-3220
10 years ago
Stephane Nicoll bc4ae336f9 Fix meta-data for spring.jmx.server
See gh-3211
10 years ago
Phillip Webb 24fc94461b Polish 10 years ago
Dave Syer 462c5f29b1 UserInfoTokenServices should not throw UserRedirectRequiredException
It can just catch all exceptions from the remote /user endpoint
because in a resource server it needs to throw `InvalidTokenException`
and in an SSO setting it will never be called.

Fixes gh-3205
10 years ago
Stephane Nicoll 34e4163ebc Improve configuration keys documentation 10 years ago
Phillip Webb ad7ed1dbae Formatting 10 years ago
Andy Wilkinson 6e79677df8 Merge branch '1.2.x' 10 years ago
Andy Wilkinson defceec90c Reinstate support for spring.groovy.template.configuration.*
Previously, spring.groovy.template.configuration.* was mapped onto both
GroovyTemplateProperties.configuration and GroovyMarkupConfigurer. The
former being a Map and the latter being specific type with getters and
setters. This clash caused problems with the IDE support.

GroovyTemplateProperties.configuration appeared to be dead code so it
was removed in 326bdf2. Unfortunately this broke the use of
spring.groovy.template.configuration.* properties as
GroovyTemplateProperties uses a prefix of spring.groovy.template and it
no longer had a configuration property.

This commit addresses the problem by updating GroovyTemplateProperties
to ignore unknown fields. This allows
spring.groovy.template.configuration.* properties to be used and bound
to GroovyMarkupConfigurer without reintroducing the clash which prompted
the initial change.

Closes gh-3198
10 years ago
Stephane Nicoll bd3a40c0ea Polish class name 10 years ago
Stephane Nicoll ea3816b550 Fix typo 10 years ago
Stephane Nicoll c1dea3797a Add documentation for SpringApplicationAdminMXBean
Closes gh-3179
10 years ago
Stephane Nicoll e0787cbaf0 Polish
Review 105039c that still refer to "lifecycle" instead of "admin". In
particular, harmonized the configuration properties.

Closes gh-3124
10 years ago
Phillip Webb d0fd6145b1 Fix CacheType outer class tangle
Fixes gh-3168
10 years ago
Phillip Webb 105039cdb2 Rename SpringApplicationLifecycle => Admin
Rename SpringApplicationLifecycle JMX beans to SpringApplicationAdmin
and relocate to a dedicated package.

Fixes gh-3124
10 years ago
Phillip Webb cc8120f9eb Use bean classloader for Mongo entity scanning
Fixes gh-3162
10 years ago
Phillip Webb 196b9c9b2a Polish 10 years ago
Stephane Nicoll dd52334c70 Merge branch '1.2.x' 10 years ago
Stephane Nicoll 38cca9c1f3 Only associate JTA transaction manager to JMS factory
The JMS MessageListenerContainer supports the PlatformTransactionManager
abstraction with either a `JmsTransactionManager` for local transactions
or `JtaTransactionManager` for distributed transactions. The former is
kind of deprecated (`setTransacted` should be used instead). In any case,
any other `PlatformTransactionManager` implementation is not supported.

Update JmsAnnotationDrivenConfiguration to only associated a JTA
transaction manager, if any.

Closes gh-3150
10 years ago
Dave Syer 8590950d70 Discontinue use of deprecated @EnableWebMvcSecurity 10 years ago
Dave Syer a226005f94 Merge branch '1.2.x' 10 years ago
Stephane Nicoll 3dcd8e2346 Support for Hibernate naming strategy delegator
hibernate.ejb.naming_strategy_delegator and hibernate.ejb.naming_strategy
cannot be used at the same time but Boot sets the latter automatically.

We now only set the naming strategy if no delegator has been specified
via configuration

Closes gh-3149
10 years ago
Dave Syer 1c0bcc13cf Set UserDetailsService in default AuthenticationManagerBuilder
Only affects the default AuthenticationManagerBuilder (so when users
are not overriding the default global user details). Makes the
UserDetailsService effectively available as it would be if we used
AuthenticationManagerBuilder.inMemoryAuthentication() as a
shared object in the HttpSecurity.

Fixes gh-3152
10 years ago
Stephane Nicoll 432c00e857 Polish redis connection timeout support
Closes gh-3142
10 years ago
Eddú Meléndez 50eedefec1 Add connection timeout property for redis
See gh-3142
10 years ago
Phillip Webb 7609c43685 Switch Javadoc <code>...</code> to {@code ...}
Update Javadoc to use the {@code ...} syntax when possible.
10 years ago
Eddú Meléndez baca62a6c0 Fix typos 10 years ago
Phillip Webb 5ab4b49534 Fix broken Javadoc 10 years ago
Phillip Webb bce4bb8860 Polish start stop support 10 years ago
Phillip Webb 09a29a7207 Polish OAuth SSO 10 years ago
Phillip Webb d2f11c465e Polish cache code 10 years ago
Phillip Webb 412b7b9e50 Polish 10 years ago
Spring Buildmaster 5d81c87b43 Next Development Version 10 years ago
izeye dd24212165 Polish Javadoc
Closes gh-3101
10 years ago
Phillip Webb 09617121b9 Merge branch '1.2.x' 10 years ago
Phillip Webb df8c311280 Add OrderedHiddenHttpMethodFilter
Add OrderedHiddenHttpMethodFilter and use it in WebMvcAutoConfiguration
to ensure that it is applied before Spring Security.

Fixes gh-2773
10 years ago
Phillip Webb 49c4710f63 Merge branch '1.2.x' 10 years ago
Phillip Webb 968b68c322 Polish 10 years ago
Stephane Nicoll 328e07ebf3 polish mail jndi support
Closes gh-2419
10 years ago
Eddú Meléndez 28cb13c31d Add mail jndi support
See gh-2419
10 years ago
Phillip Webb a0087170e0 Polish 10 years ago
Stephane Nicoll 91ce0abe48 Fix Redis cache auto-configuration
Add an explicit link to the `RedisAutoConfiguration` to make sure it is
applied before the cache counter-part. Request the general
`redisTemplate` so that non String-values can be handled by default as
well.

See gh-2633
10 years ago
Stephane Nicoll 6ea27024c3 Expose RedisTemplate with explicit type
Fixes gh-3075
10 years ago
Stephane Nicoll 1457a55e41 Remove spring.cache.config property
Remove `spring.cache.config`  as it is too generic and does not express
enough what is configured. This property is replaced by cache library
specific properties, that is `spring.cache.ehcache.config`,
`spring.cache.hazelcast.config`, `spring.cache.infinispan.config` and
`spring.cache.jcache.config`.

See gh-2633
10 years ago
Stephane Nicoll c5566e2755 Fix broken build
Update EnableAutoConfigurationImportSelectorTests to match the new
`excludeName` property.

Closes gh-2660
10 years ago
Stephane Nicoll a6f671be3e Add excludeName to EnableAutoConfiguration
Allow user to exclude an auto-configuration class by specifying the fully
qualified name instead of the class reference.

Closes gh-2660
10 years ago
Stephane Nicoll fc61f2e837 Improve documentation for JMX related keys
Closes gh-2747
10 years ago
Stephane Nicoll e3a124d0f9 Expose additional RabbitMQ settings
Allow SSL to be configured via standard configuration as well as the
requestedHeartbeat. Switch to RabbitConnectionFactoryBean.

Closes gh-2655, gh-2676
10 years ago
Stephane Nicoll ab55331863 Improve configuration keys documentation 10 years ago
Stephane Nicoll 9f010ed8c0 Merge branch '1.2.x' 10 years ago
Stephane Nicoll 160f2d341f Fix Gzip filter properties
Fix `excludeAgentPatterns`, `excludePaths` and `excludePathPatterns`
properties. Introduce `excludedMimeTypes` property.

Fixes gh-3042
10 years ago
Dave Syer c5dc3f564b Add @EnableOAuth2Sso and spring.oauth2.sso.*
User can enable OAuth2 SSO by declaring the intent (@EnableOAuth2Sso)
and also configuring the client properties (spring.oauth2.client.*).
The spring.oauth2.sso.* are only needed to change the path for the
login (defaults to /login) - any other security configuration for the
protected resources can be added in a WebSecurityConfigurerAdapter
which carries the @EnableOAuth2Sso annotation.
10 years ago
Dave Syer af320b49bf Rationalize some features and merge in customizers from Spring Cloud 10 years ago
Dave Syer 5468949a55 Update to latest 1.3 code 10 years ago
Greg Turnquist 53f67a448f Auto-configure Spring Security OAuth2 when detected on the classpath
* Automatically spin up Authorization Server and Resource Server
* Automatically configures method level security included OAuth2Expression handler
* Wrote extensive unit tests verifying default behavior as well as the auto-configuration backing off when custom Authorization/Resource servers are included
* Created org.springframework.boot.security.oauth2 subpackage to contain it
* Can also disable either resource of authorization server completely with a single property for each
* Print out the auto-generated secrets and other settings
* Added spring-boot-sample-secure-oauth2 to provide a sample that can be run and poked with curl as well as some automated tests.
* Make users ask for which servers to install by adding @Enable*
* User has to @EnableGlobalMethodSecurity instead of using properties files

Add Spring Security OAuth2 support to Spring Boot CLI

* Triggered from either @EnableAuthorizationServer or @EnableResourceServer
* Needs to have @EnableGlobalMethodSecurity to allow picking the annotation model.
* By default, comes with import support for @PreAuthorize, @PreFilter, @PostAuthorize, and @PostFilter via a single start import
* Also need import support for the enable annotations mentioned above.
* Added extra test case and sample (oauth2.groovy)
10 years ago
Stephane Nicoll b8106ae773 Improve transaction manager detection
Switch the condition used to trigger the creation of a transaction
manager from the default name to the actual type.

Fixes gh-3012
10 years ago
Stephane Nicoll bd6f7a589c Expose enableFallback property
Add an extra property to control the support of fallback resolution for
mobile views.

Fixes gh-3009, gh-3019
10 years ago
Andy Wilkinson 95f31b0d30 Polish Undertow access logs contribution
- Apply project’s code formatting and conventions
 - Don’t use the IO and worker thread configuration when creating the
   worker for the AccessLogReceiver. The IO and worker thread
   configuration is for HTTP request processing and a worker in its
   default configuration should be sufficient for the access log
   receiver.
 - Don’t use a temporary directory as the default for the access log
   directory. A temporary directory makes (some) sense for Tomcat as it
   requires a directory for its basedir. Undertow has no such
   requirement and using a temporary directory makes it hard to locate
   the logs. The default has been updated to a directory named logs,
   created in the current working directory.
 - Document the new properties in the application properties appendix

Closes gh-3014
10 years ago
Marcos Barbero 90e43737bb Add support for configuring Undertow's access log via the environment
This commit adds support for configuring Undertow's access log via the
environment using the following properties:

server.undertow.access-log-enabled
server.undertow.access-log-pattern
server.undertow.access-log-dir

See gh-3014
10 years ago
Andy Wilkinson 1f63fac623 Update ServerPropertiesTests to reflect updated default internalProxies
See gh-2699
10 years ago
Andy Wilkinson 1fe1aa8939 Update RemoteIpValve’s default internal proxies to include 172.16/12
Closes gh-2699
10 years ago
Andy Wilkinson 5e4a745620 Don’t register Jackson Module beans with all ObjectMappers
Previously, JacksonAutoConfiguration would register any Jackson Module
beans with every ObjectMapper found in the application context. This
was not consistent with the rest of the Jackson auto-configuration,
which is only applied to ObjectMappers that are created or configured
via the auto-configured Jackson2ObjectMapperBuilder.

This commit removes the code that registers Jackson Module beans with
every ObjectMapper. Such beans will still be registered with
ObjectMappers created or configured using the auto-configured
Jackson2ObjectMapperBuilder. This aligns the configuration of Module
with the rest of the ObjectMapper configuration and makes it possible
for users to create an ObjectMapper bean and still have complete control
over the modules that are registered with it.

Closes gh-2489
10 years ago
Andy Wilkinson 9be1d158a6 Don't use reflection to verify interceptor registration
A recent change to the internals of RequestMappingHandlerMapping
broke to Spring Mobile-related tests as they were using reflection
to verify that the configuration had been applied correctly.

This commit makes the tests more robust by using the Java API to
access the interceptors for a request and verify that the expected
interceptor is present. To further simplify the tests, the unnecessary
use of an embedded servlet container factory has also been removed.
10 years ago
Stephane Nicoll e0dfe9fb86 Add start/stop goals to maven plugin
SpringApplicationLifecycle provides basic lifecycle operations on the
current Spring Boot application (that is checking if the application has
fully started and gracefully terminate the app). It can be registered as
an MBean of the platform MBean server if a specific property is set.

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
10 years ago
Stephane Nicoll e0f59d8a74 polish batch table prefix customization
See gh-2132
10 years ago
Eddú Meléndez d6818e96f5 Customize table prefix of batch meta-data tables
Add 'spring.batch.table-prefix' to customize the prefix of the
batch meta-data tables.

Closes gh-2132, gh-3002
10 years ago
Stephane Nicoll 62a2dd659b Add display-name option
Allow the display-name of the application to be customized when deployed
in an embedded container via the `server.display-name` property.

Closes gh-2600
10 years ago
Stephane Nicoll 0a9b8cbb41 Polish Infinispan support
Updated to the `EmbeddedCacheManager` interface and added support for
default cache configuration.

Added dependencies management for the JCache support with tests

Fixes gh-2906, see gh-2633
10 years ago
Eddú Meléndez 76ac781a65 Add support for Infinispan
Include auto-configuration support for Infinispan. It is possible
to specify the caches to create via `spring.cache.cache-names`.
Provider also allow to set configuration file via `spring.cache.config`.

See gh-2633
10 years ago
Andy Wilkinson e3a53cb087 Remove classes and methods deprecated since 1.2 and earlier
Closes gh-2697
10 years ago
Andy Wilkinson aa1f84d037 Make OnBeanCondition package private again
It was accidentally made public in 45b579c.

Closes gh-2741
10 years ago
Stephane Nicoll b466229231 Restore proper customization of JCache CacheManager
Work in 1b3efd4 actually introduced a regression: if a CacheManager is
created via a custom configuration file, it is no longer post-processed.

This commit makes sure to also customize a CacheManager that was
created that way.

See gh-2848
10 years ago
Stephane Nicoll c0e9ed1e34 Fix typo 10 years ago
Stephane Nicoll 1b3efd41f5 Expose caching-specific infrastructure
Expose the underlying cache infrastructure bean if Boot auto-configures
it. This is the case for ehCache, hazelcast and JCache. This change has
two side effects:

1. It is now possible to customize the underlying cache infrastructure
and let Boot only wrap it in the Spring's CacheManager abstraction. No
customizations are applied if the caching-specific service is customized
2. Such infrastructure is disposed when the application terminates as
it is now defined as `@Bean` and both `close()` and `shutdown()` methods
are invoked if present on the target type.

While the latter can be troublesome, we feel that a particular cache
instance is not meant to be shared and must be disposed when the
application terminates.

Closes gh-2848
10 years ago
Andy Wilkinson d4dfa8d979 Polish 18453c0e
Document new configuration properties and remove redundant code
10 years ago
Andy Wilkinson 18453c0eb0 Allow JspServlet's init parameters to be configured via the environment
This commit adds support for configuring the JSP servlet’s init
parameters via the environment using server.jsp-servlet.init-parameters.*.
As part of this change the configuration of registerJspServlet and
jspServletClassName have been moved onto a new type, JspServlet, and the
existing setters on ConfigurableEmbeddedServletContainer have been 
deprecated. In addition to providing a model for configuring the JSP
servlet that’s consistent with the model for other configuration (SSL,
for example), this change also means that the class name and whether or
not the servlet is registered at all can now also be configured via the
environment.

Closes gh-2825
10 years ago
Andy Wilkinson f0c0742eaf Merge branch '1.2.x' 10 years ago
Craig Walls 88d72e0598 Upgrade to Spring Social Facebook 2.0.1.RELEASE
While this is a breaking change, continuing with Spring Social
Facebook 1.1.x is also broken as it is no longer compatible with
Facebook's API. Upgrading to 2.0.1.RELEASE may require some changes
to be made to users' applications, but it will allow their
applications to use the Facebook API once again.

Closes gh-2837
10 years ago
Andy Wilkinson ee7c86a07d Start building against Reactor 2.0.1 snapshots
See gh-2719
10 years ago
Andy Wilkinson 6847608308 Merge branch '1.2.x'
In addition to the changes already made in 1.2.x, this commit updates
the tests in spring-boot-actuator to ensure that any Elasticsearch
data files are written into the target directory. This avoids problems
when switching branches caused by different versions of Elasticsearch
trying to read the files.
10 years ago
Andy Wilkinson dabbb02dfe Prevents tests that use Elasticsearch from polluting the filesystem
By default, Elasticsearch writes it data to ./data. This led to data
being left on the filesystem after a mvn clean which could cause
failures when moving between branches that use different versions of
Elasticsearch.

This commit updates the tests for the Elasticsearch sample and
the Elasticsearch auto-configuration classes to write the
Elasticsearch data and logs into the target directory.
10 years ago
Stephane Nicoll 30df9093a6 Merge branch '1.2.x' 10 years ago
Stephane Nicoll 326bdf29c2 Remove unused configuration map
Remove the configuration map defined in `GroovyTemplateProperties` which
isn't used. Ironically, that configuration map was exposed with the exact
same prefix as `GroovyMarkupConfigurer`, which broke IDEs support since
two entries had the exact same prefix.

Fixes gh-2840
10 years ago
Phillip Webb a8d099f6b8 Revert "Add start/stop goals to maven plugin"
This reverts commit 54e12a07e6.
10 years ago
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
10 years ago
Andy Wilkinson 92702b4cd4 Merge branch '1.2.x' 10 years ago
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
10 years ago
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
10 years ago
Andy Wilkinson fdd3f12ee0 Merge branch '1.2.x' 10 years ago
Andy Wilkinson 4f988d2aec Polish log message in AutoConfigurationReportLoggingInitializer 10 years ago
Stephane Nicoll f480c0de2f Merge branch '1.2.x' 10 years ago
Stephane Nicoll 0f14210937 Polish documentation 10 years ago
Stephane Nicoll 452ce0ffad Polish
Add setter for cache names so that it can be bound both via indexed
access and comma-separated list.
10 years ago
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
10 years ago
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
10 years ago
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
10 years ago
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
10 years ago
Andy Wilkinson 2a5eecaf4a Merge branch '1.2.x' 10 years ago
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
10 years ago
Andy Wilkinson 507520aab9 Merge branch '1.2.x' 10 years ago
Andy Wilkinson 5547f91bfb Correct name of check-template-location property in error message
Closes gh-2788
10 years ago
Phillip Webb c4ddce6b73 Polish 10 years ago
Andy Wilkinson 8b1022effa Upgrade to Spring Batch 3.0.4 snapshots
Closes gh-2712
10 years ago
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
10 years ago
Andy Wilkinson a69cd36dbc Merge branch '1.2.x' 10 years ago
Andy Wilkinson d4ffab2f02 Provide additional config metadata for spring.http.gzip.enabled
See gh-2776
10 years ago
Andy Wilkinson 3df6cb1325 Merge branch '1.2.x' 10 years ago
Andy Wilkinson 212520fa15 Add a property to disable auto-configuration of GzipFilter
Closes gh-2776
10 years ago
Phillip Webb 59692cd938 Polish formatting 10 years ago
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
10 years ago
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
10 years ago
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
10 years ago
Stephane Nicoll 9f1475d708 Fix wrong import in Guava auto-config
Remove the need for `commons-collections`

See gh-2633
10 years ago
Stephane Nicoll 24d9afa67b Fix wrong import in JCache auto-config
Remove the need for `commons-collections`

See gh-2633
10 years ago
Stephane Nicoll ff7c66c0d2 Fix annotation() javadoc 10 years ago
Spring Buildmaster e03c11dda8 Next development version 10 years ago
Phillip Webb 5d9efe40d0 Merge branch '1.2.x' 10 years ago
Dave Syer 18afe8bd0c Fixup incorrect property name
The property in XADataSourceAutoConfigurationTests should be
`data-source-class-name`. Previously the `-name` was missing.
10 years ago
Phillip Webb fbf34e261e Polish 10 years ago
Phillip Webb d07e18143d Merge branch '1.2.x' 10 years ago
Phillip Webb e3f203a8a5 Polish 10 years ago
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
10 years ago
Andy Wilkinson ed5853e60e Merge branch '1.2.x' 10 years ago
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
10 years ago
Stephane Nicoll 72561f8969 Fix typo 10 years ago
Phillip Webb 85319c0793 Fix Java 8 Javadoc errors 10 years ago
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
10 years ago
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
10 years ago
Phillip Webb 10da3d390e Polish 10 years ago
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
10 years ago
Andy Wilkinson d7818b441e Merge branch '1.2.x' 10 years ago
Andy Wilkinson 0da24f82e3 Polishing: move tests for mustache.web into the correct package 10 years ago
Andy Wilkinson dd748eda19 Use the configured charset, if any, in MustacheViewResolver
Closes gh-2670
10 years ago
Andy Wilkinson 95a0be3cb2 Merge branch '1.2.x' 10 years ago
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
10 years ago
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
10 years ago
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
10 years ago
Stephane Nicoll b963a82f36 Merge branch '1.2.x' 10 years ago
Raphael Ackermann 1235a35f2a fix typo in javadoc
{@code tomat-embedded.jar} --> {@code tomcat-embedded.jar}
10 years ago
Andy Wilkinson 9444a25de3 Merge branch '1.2.x' 10 years ago
Andy Wilkinson 0a38b9b3ab Enable the configuration of arbitrary Elasticsearch client properties
Previously, only a handful of properties could be set when
auto-configuring an Elasticsearch client. This commit introduces support
for configuring arbitrary properties using the
spring.data.elasticsearch.properties prefix. For example,
client.transport.sniff can be configured using
spring.data.elasticsearch.properties.client.transport.sniff.

Closes gh-1838
10 years ago
Andy Wilkinson 99de71bf65 Upgrade to Jackson 2.5.1
Closes gh-2332
10 years ago
Andy Wilkinson b2a68d700f Merge branch '1.2.x' 10 years ago
Andy Wilkinson 89b4cac8b0 Allow Elasticsearch client-transport-sniff to be configured via the env
Previously, a TransportClient sniff property could not be configured
while using Spring Boot’s Elasticsearch auto-configuration. This commit
adds a new property, spring.data.elasticsearch.client-transport-sniff,
that can be used to configure the TransportClient while continuing to
use the auto-configuration support.

Closes gh-1838
10 years ago