Commit Graph

1402 Commits (64ec67e6a4b5b150b2a8d63119b41017576ad1c3)

Author SHA1 Message Date
Andy Wilkinson 51dd806a98 Detect ConfigurableWebBindingInitializer bean and register with MVC
Previously, to use a custom ConfigurableWebBindingInitializer, it was
necessary to extend WebMvcConfigurationSupport and override
getConfigurableWebBindingInitializer. This had the unwanted
side-effect of switching off the auto-configuration of Spring MVC.

This commit updates the auto-configuration to look for a
ConfigurableWebBindingInitializer bean and register it with Spring
MVC.

Closes gh-2526
9 years ago
izeye eab7eff047 Polish documentation
Closes gh-3738
9 years ago
Dave Syer 84a3e3827b Ensure tomcat on the classpath does not imply web application 9 years ago
Andy Wilkinson 2ae8a021f9 Merge branch '1.2.x' 9 years ago
Andy Wilkinson a2f4c1cc4a Add support for configuring allowSessionOverride via the environment
This commit adds support for using the environment to configure the
Freemarker and Velocity view resolvers to allow session overrides.

Closes gh-3410
9 years ago
Andy Wilkinson 1e4c972c3d Fix customJodaDateTimeFormat to specify time zone when creating Date
See gh-3569
9 years ago
Dave Syer 2985b0e9d8 Clarify init params in Jersey autoconfig (only servlet and filter)
See gh-3557
9 years ago
Andy Wilkinson 9fcc860908 Polish contribution
Closes gh-3643
9 years ago
Joao Pedro Evangelista 7568af1710 Add auto-configuration of HttpPutContentFormFilter
Closes gh-3652
9 years ago
Phillip Webb 9a53707014 Add @ImportAutoConfiguration annotation for tests
Add a new `@ImportAutoConfiguration` annotation that can be used by
tests that wish to selectively import certain auto-configuration
classes. Also add `@AutoConfigurationPackage` so that package
registration is decoupled from `@EnableAutoConfiguration`.

An added benefit of the change is @EnableAutoConfigurationImportSelector
can now be subclassed to provide custom annotation support if needed.

Fixes gh-3660
See gh-2772
9 years ago
Phillip Webb 8d92236eea Polish 9 years ago
Phillip Webb 3ff878a94b Remove `include` from @EnableAutoConfiguration
Revert commit 1d31d23e29 to
remove `include` from `@EnableAutoConfiguration`. We'll
add a dedicated annotation instead to fix this.

See gh-3660
9 years ago
Eric Bottard 2b15ea65e2 Polish Javadoc
Closes gh-3667
9 years ago
Stephane Nicoll 6c7a5c5077 Harmonize Undertow's access log properties
Harmonize the configuration properties for Undertow to match the changes
made for gh-2491.

Move `spring.undertow.accessLog*` to `spring.undertow.accesslog.*`
9 years ago
Stephane Nicoll 62406546e2 Improve customization of Tomcat's access log
Add `directory`, `prefix` and `suffix` properties to further customize
how access logs are configured on Tomcat. Relocate all properties to the
`server.tomcat.accesslog` namespace.

`server.tomcat.accessLogPattern` and `server.tomcat.accessLogEnabled` are
deprecated and replaced by `server.tomcat.accesslog.pattern` and
`server.tomcat.accesslog.enabled` respectively.

Closes gh-2491
9 years ago
Andy Wilkinson 2a5a32b603 Add auto-configuration for H2’s web console
Three conditions must be met for the console to be enabled:

 - H2 is on the classpath
 - The application is a web application
 - spring.h2.console.enabled is set to true

If spring-boot-devtools is on the classpath, spring.h2.console.enabled
will be set to true automatically. Without the dev tools, the enabled
property will have to be set to true in application.properties.

By default, the console is available at /h2-console. This can be
configured via the spring.h2.console.path property. The value of this
property must begin with a '/'.

When Spring Security is on the classpath the console will be secured
based on the user's security.* configuration. When the console is
secured, CSRF protection is disabled and frame options is set to
SAMEORIGIN for its path. Both settings are required in order for the
console to function.

Closes gh-766
9 years ago
Phillip Webb 1d31d23e29 Add `include` support to @EnableAutoConfiguration
Update the `@EnableAutoConfiguration` annotation to include an `include`
attribute which can be used to specify specific auto-configuration
classes.

Primarily added to so that tests can selectively auto-configure without
needing to worry about class import order.

Fixes gh-3660
9 years ago
Phillip Webb 4279ffeddf Polish formatting 9 years ago
Stephane Nicoll 7669e888cb Polish
Closes gh-3649
9 years ago
jhernan d8bf3a72da Customize mail sender protocol
See gh-3649
9 years ago
Stephane Nicoll d18180e2e4 Add missing package-info 9 years ago
Stephane Nicoll bfe930a873 Auto-configure @EnableConfigurationProperties
Add an auto-configuration that avoid a Spring Boot user to add
`@EnableConfigurationProperties` to its configuration to benefit from
that feature.

As our own auto-configurations are tested independently, such annotation
is still present to avoid a useless reference to this new
auto-configuration.

Closes gh-2457
9 years ago
Andy Wilkinson 0e8812f0e9 Merge branch '1.2.x' 9 years ago
Andy Wilkinson 905346d0cd Consider @Bean methods with args to determine type created by factory
Previously, BeanTypeRegistry would only look for a @Bean method
with no arguments when trying to determine the type that will be
created by a factory bean. This meant that the type produced by a
factory bean declared via a @Bean that has one or more arguments would
be unknown and any on missing bean conditions look for a bean of the
type produced by the factory bean would match in error.

This commit updates BeanTypeRegistry to, where possible, use the
factory method metadata for the bean definition when determining the
type that will be created. This allows it to determine the type for
factory bean created by @Bean methods that take arguments and also
avoids the use reflection to find the factory method. Where factory
method metadata is not available, the existing reflection-based
approach is used as a fallback.

Closes gh-3657
9 years ago
Stephane Nicoll eb5d92f3f0 Exclude auto-configurations via property
Add `spring.autoconfigure.exclude` to control the list of
auto-configuration classes to exclude via configuration. Merge the
exclusions defined on the `@EnableAutoConfiguration` or
`@SpringBooApplication` if any.

Closes gh-2435
9 years ago
Rob Winch f543e3259e Add Test that HiddenHttpMethodFilter before FilterChainProxy
Fixes gh-3447
9 years ago
Phillip Webb 891dd5a0f6 Polish 9 years ago
Stephane Nicoll 15442b9667 Avoid wrong meta-data
Make `getFaviconLocations` package private so that it's not (wrongly)
exposed in the meta-data.

Closes gh-3647
9 years ago
Stephane Nicoll 3cae8e4d20 Remove outdated key 9 years ago
Stephane Nicoll d9648a36fe Add more specific test
Add an error controller test that translates a ResponseStatus annotated
exception that does not contain a reason attribute.

See gh-3623
9 years ago
Stephane Nicoll 96fc107ca1 Customize Thymeleaf default template resolver order
Currently, the default TemplateResolver had no specific order. Thymeleaf
handles that with a "always first" strategy (that can be confusing if
several TemplateResolver have a "null" order.

While it is a fine default (and changing it could lead to weird side
effects), it has to be changed as soon as another TemplateResolver bean
is defined in the project.

The `spring.thymeleaf.template-resolver-order` property has been added to
control  the order of the default TemplateResolver.

Closes gh-3575
9 years ago
izeye ee6fc8d917 Fix typos
Closes gh-3608
9 years ago
Stephane Nicoll 32128a6ac2 Polish 9 years ago
Stephane Nicoll 92871ea03e Polish
See gh-3600
9 years ago
Johannes Stelzer 64461bb978 Add locale customization of the ObjectMapper
Add a new spring.jackson.locale property to customize the locale of the
ObjectMapper.

Closes gh-3600
9 years ago
Stephane Nicoll 4c5a1036a3 Merge branch '1.2.x' 9 years ago
Pei-Tang Huang 3953baba81 Add SQLServer XA DataSource class name
Closes gh-3604
9 years ago
Stephane Nicoll 42e230192f Polish 9 years ago
Stephane Nicoll d6e914be87 Add auto-startup configuration property
Allow to disable the auto-startup flag of the default JMS and RabbitMQ
containers. This effectively permit to disable automatic listening via
configuration.

Closes gh-3587
9 years ago
izeye a242415bb1 Remove an unused parameter
Closes gh-3589
9 years ago
Stephane Nicoll 3b5fa5a6a3 Clean server.context-path if necessary
While the doc states that the default value is '/', setting that value
explicitly will lead to an error since we enforce that the default root
is the empty string.

Changing the doc will probably be more confusing than anything else so
we're now cleaning the user's provided value if necessary

Closes gh-3554
9 years ago
Andy Wilkinson 37edee4f5e List classes with no class-level conditions in the auto-config report
This commit adds a new "Unconditional classes" section to the
auto-configuration report. It lists any auto-configuration classes
that do not have any class-level conditions, i.e. the class will be
always be part of the application's configuration.

Closes gh-2209
9 years ago
Andy Wilkinson 24c63c9b55 Adopt RepositoryRestConfigurer and discourage subclassing
A RepositoryRestMvcConfiguration subclass provided by a user is
problematic in a Spring Boot application as it causes
RepositoryRestMvcConfiguration's bean declarations to be processed
before any auto-configuration runs.

One problem that this causes is that it switches off Boot's Jackson
auto-configuration due to RepositoryRestMvcConfiguration having
already declared multiple ObjectMapper beans. Unlike Boot's
auto-configured ObjectMapper, none of these ObjectMappers are marked
as @Primary. This then leads to wiring failures due to multiple
candidates being available.

To address this problem a new RepositoryRestConfigurer abstract has been
introduced in Spring Data Gosling. Its use is now strongly preferred
over subclassing RepositoryRestMvcConfiguration. Note that our own
RepositoryRestMvcConfiguration subclass remains. It is imported as part
of auto-configuration (avoiding the ordering problems described above),
and provides configuration properties binding for
RepositoryRestConfiguration. However, the Jackson ObjectMapper
configuration has been moved out into a new RepositoryRestConfigurer
implementation.

While SpringBootRepositoryRestMvcConfiguration remains, this commit
makes it package private to discourage users from subclassing it. While
this may break existing applications, it, coupled with the documentation
updates, will hopefully guide them toward using
RepositoryRestConfigurer.

Closes gh-3439
9 years ago
Dave Syer e1dec6061d Make MongoRepositoriesAutoConfiguration order more explicit
It has to come after MongoDataAutoConfiguration (not
MongoAutoConfiguration) because it looks for beans that are defined
there (e.g. MongoMappingContext which is the one that scans for entities).

Fixes gh-3577
9 years ago
Dave Syer da816526bd Add additional pre-validation check in ResourceServerProperties
With this change a user can have `@EnableOAuth2Client` without
`@EnableOAuth2Sso`.

Fixes gh-3568
9 years ago
Phillip Webb 6f6f898739 Polish 9 years ago
Dave Syer c5008f844c Make sure bean resolver is set in the OAuth2 expression evaluator
Also copies the ExpressionParser (the only public getter), trust
resolver and permission evaluator (if available in the context). Changes
the logic to not replace an existing OAuth2MethodSecurityExpressionHandler
so that users can override simply by providing a bean of that type.

Fixes gh-3542
9 years ago
Phillip Webb 3b4928c549 Restore ServerProperties.getSessionTimeout()
Restore the deprecated method to give people a change to migrate. The
@DeprecatedConfigurationProperties annotation is now used to generate
the deprecated meta-data, removing the need for manual meta-data.

Closes gh-3537
9 years ago
Stephane Nicoll db41e0d7d5 Fix duplicate meta-data for server.session-timeout
Closes gh-3537
9 years ago
Phillip Webb 08d1f6daf5 Allow persistent servlet sessions across restarts
Update Tomcat, Jetty and Undertow to serialize session data when the
application is stopped and load it again when the application restarts.

Persistent session are opt-in; either by setting `persistentSession`
on the ConfigurableEmbeddedServletContainer or by using the property
`server.session.persistent=true`.

Fixes gh-2490
9 years ago
Phillip Webb 728e64b929 Polish 9 years ago
Andy Wilkinson 352ff4e899 Rename Embedded Mongo configuration prefix to spring.mongodb.embedded
Previously, the prefix was spring.embedded-mongodb. This was
inconsistent with the prefixes for Artermis and HornetQ which are
spring.artemis.embedded and spring.hornetq.embedded respectively.

See gh-2002
9 years ago
Stephane Nicoll 538c8d04b1 Polish 9 years ago
Andy Wilkinson 2c81907d58 Flesh out and polish Embedded MongoDB auto-configuration contribution
Embedded MongoDB is now auto-configured when it is on the classpath.
The Mongo instance will listen on the port specified by the
spring.data.mongodb.port property. If this property has a value of
zero and randomly allocated port will be used. In such an event, the
MongoClient created by MongoAutoConfiguration will be automatically
configured to use the port that was allocated.

By default, MongoDB 2.6.10 will be used. This can be configured using
the spring.embedded-mongodb.version property. Mongo's sync delay
feature is enabled by default. This can be configured using the
spring.embedded-mongobd.features property.

Closes gh-2002
9 years ago
Henryk Konsek f2b2c085e9 Add auto-configuration support for Embedded MongoDB
See gh-2002
9 years ago
Stephane Nicoll 4aace564a2 Fix typo
Closes gh-3519
9 years ago
Stephane Nicoll aa483984c5 Polish 1683d8a8
Closes gh-3475
9 years ago
Josh Thornhill 1683d8a8f3 Customize default `RabbitListenerFactory`
Expose acknowledgment mode, concurrency, prefecth and transaction size
settings in configuration for the default
`RabbitListenerContainerFactory`.

Closes gh-3479
9 years ago
Stephane Nicoll 22a7b0cdee Customize default `JmsListenerFactory`
Expose acknowledgment mode and concurrency settings in configuration for
 the default `JmsListenerContainerFactory`

 Closes gh-3519
9 years ago
Andy Wilkinson bedf2edffa Update auto-configuration @Bean methods to return most specific type
Closes gh-2536
Closes gh-2403
9 years ago
izeye f4589e7cc3 Fix typos
Closes gh-3504
9 years ago
Stephane Nicoll f2d32d3e98 Add support for property deprecation
Previously, an item could only have a 'deprecated' boolean flag to
indicate that the property is deprecated. It is desirable to provide an
additional description for the deprecation as well as the name of the
property to use instead.

The `deprecated` boolean flag is now supported. Instead, a `deprecated`
object can be specified with two optional attributes: `reason` to provide
an explanation for the deprecation and `replacement` to refer to the
property that should be used instead. If none of them is present, an
empty deprecation object should be set.

For backward compatibility, the `deprecated` field is still set.

Deprecation information can only set via manual meta-data.

Closes gh-3449
9 years ago
Andy Wilkinson b1e9139efe Allow Jackson’s time zone to be configured via the environment
This commit adds a new property, spring.jackson.time-zone, that can be
used to configure the time zone that Jackson uses when configuring
dates. It affects the serialisation of both JDK and Joda date types.

Closes gh-3505
9 years ago
Phillip Webb f0f5f78e25 Polish 9 years ago
Stephane Nicoll e52c190b05 Narrow String properties to a more precise type
We envision that IDE will support auto-completion for known types in the
future, for instance Charset, MimeType, Resource and Locale. Some of our
own configuration keys use a raw String type whereas they actually
represent a higher-level concept.

We now make sure to expose these with a better type, if applicable.

Closes gh-2898
9 years ago
Stephane Nicoll eafee1ecb6 Fix ordering of mail auto-configuration
It is not possible to put `@Order` on nested `@Configuration` classes and
there is no ordering guarantee of them anyway. Previously, we relied on
the declaration order to check if the `test-connection` flag should apply
to an existing `JavaMailSenderImpl`. It turns out at the
`JavaMailSenderImpl` bean was not created at that time and so the
evaluation was wrongly failing.

To make that more explicit, that code is now in its own
auto-configuration with an explicit `@AutoConfigureAfter` declaration.

Since the JNDI support could be affected by the exact same issue, it has
been restored to its own package private configuration class that is
processed before the  `MailSenderAutoConfiguration` content is evaluated.

Closes gh-3478
9 years ago
Phillip Webb a158baf50f Back-off auto-conf on EntityManagerFactory bean
Don't auto-configure a LocalContainerEntityManagerFactoryBean if the
user directly defines an EntityManagerFactory bean.

Fixes gh-2803
9 years ago
Andy Wilkinson db50fb8704 Remove redundant metadata for JOOQ’s SQL dialect
Also add a test that I’d written before Phil fixed the problem in
5dbe623.

See gh-3468
9 years ago
Phillip Webb 5dbe6232b8 Use jOOQ enum for sqlDialect
Switch JooqProperties.sqlDialect from a String to the actual enum to
allow IDE hints and case insensitive binding.

Fixes gh-3468
9 years ago
Phillip Webb fd6024ebf1 Move and refactor Redis test server @Rule
Move the Redis JUnit @Rule so that it can be used with
SessionAutoConfigurationTests. Also refactored the internals a little.
9 years ago
Phillip Webb 9ebe15232e Polish 9 years ago
Dave Syer 28edc95f18 Ensure Spring Session autoconfig creates ServerProperties carefully
Without this change there can be more than one ServerProperties in a
context with different names.

Fixes gh-3476
9 years ago
Dave Syer e5d3fa0c6c Merge remote-tracking branch '1.2.x' 9 years ago
Dave Syer ff79138aa5 Alternative fix for Rabbit listener transactions
Never inject a transaction manager (user can create his own
"rabbitListenerContainerFactory" bean if he wants an actual
non-JTA transaction manager.

See gh-3432
9 years ago
Dave Syer 67933ab01f Add boolean flag spring.rabbit.listener.useTransactionManager
If set *and* there is a transaction manager in the context, then the
listener container created by Spring Boot will use the transaction
manager to execute the listeners.

Fixes gh-3432 (by virtue of not requiring a JtaTransactionManager any
more).
9 years ago
Stephane Nicoll cb5eccb5c1 Add missing handle-as meta-data
Liquibase has a `changeLog` property that is definitely used as a
`Resource` but cannot be defined as such as the original String value
should be kept against an API we don't control.

Update the tests also to make it more clear that if hints are added
against a property that is detected automatically, said property still
keeps all its auto-discovered capabilities.

Closes gh-3457
9 years ago
Stephane Nicoll 8ff8afec7c Add "handle-as" hint provider
Replace the enum provider by a more general purpose provider that can
substitute the type of the property for the purpose of auto-completing
the values.

"handle-as" can be used for enums but for any type that the IDE
understands such as locale, charset, mime-type and Spring's resource
abstraction.

Closes gh-3457
9 years ago
Phillip Webb 67f7079cb2 Formatting 9 years ago
Stephane Nicoll e344eece99 Remove hint for server.tomcat.compression
server.tomcat.compression has been removed in 00d594d so the hint for it
is no longer relevant.
9 years ago
Stephane Nicoll 97634e85ac Remove unnecessary keyword 9 years ago
Stephane Nicoll f77b0e4b6a Force documentation of nested group
The `strategy` group is not detected in the meta-data because the
Strategy inner class is not defined at the "right" level in the
hierarchy.

For now, `@NestedConfigurationProperty` was added to workaround the
issue. Once gh-3454 is solved, we should remove them.
9 years ago
Stephane Nicoll 4dda1814e2 Prevent bean early initialization
Fix `CacheManagerValidatorPostProcessor` that could lead to early bean
initialization.

Fixes gh-3440
9 years ago
Phillip Webb 3588ca8637 Add session configuration properties
Add support for the following server properties which can be used to
configure the session:

	server.session.tracking-modes
	server.session.cookie.name
	server.session.cookie.domain
	server.session.cookie.path
	server.session.cookie.comment
	server.session.cookie.http-only
	server.session.cookie.secure
	server.session.cookie.max-age

In addition `server.session-timeout` is now deprecated and has been
replaced with `server.session.timeout`.

Fixes gh-3240
9 years ago
Stephane Nicoll a073a505ae Move spring.oauth2.* to security.oauth2.*
Unfortunately, we have no other choice to flip the ignoreUnknownFields
attribute of `SecurityProperties` has many different target are now set
for that namespace outside the class. See gh-3445 for a potential way
to improve that.

Closes gh-3327
10 years ago
Phillip Webb ef39634e30 Polish 10 years ago
Phillip Webb 223a6bd062 Merge branch '1.2.x' 10 years ago
Phillip Webb 7da808918f Fix Flyway and Liquibase JPA 'depends-on' setup
Ensure that FlywayAutoConfiguration and LiquibaseAutoConfiguration occur
after HibernateJpaAutoConfiguration so that the DependsOnPostProcessor
condition can correctly check for a LocalContainerEntityManagerFactory
bean.

Fixes gh-3437
10 years ago
Phillip Webb 9b78f5d52e Replace @ConditionalOnExpression conditions
Replace @ConditionalOnExpression usage in auto-configuration in favor
of faster direct Environment access.
10 years ago
Phillip Webb b2fcd77d93 Rework EndpointWebMvcAutoConfiguration port logic
Update the `ManagementServerPort` detection logic to attempt direct
property resolution before looking for a local property bean
definition. Bean definitions provided by auto-configuration classes
are ignored.

This change allow `OnManagementMvcCondition` to use the
`ManagementServerPort` to determine when `EndpointWebMvcConfiguration`
should apply (removing the need to create a temporary context).

See gh-3345
10 years ago
Marten Deinum a3e62676af Extend TemplateViewResolverProperties for Groovy
Use AbstractTemplateViewResolverProperties as the base class for
GroovyTemplateProperties since the Spring GroovyMarkupViewResolver is
an AbstractTemplateViewResolver.

The auto-configuration for Groovy is now more aligned with the existing
Freemarker and Velocity auto-configuration, with a `resourceLoaderPath`
property being used instead of `prefix`.

Fixes gh-3365
Closes gh-3374
10 years ago
Phillip Webb 0cf6efca4f Polish 10 years ago
Stephane Nicoll eb10275f5a Polish
Polish 383e94c to validate any `JavaMailSenderImpl` and not only the
one that has been created by auto-configuration.

Closes gh-3409
10 years ago
Eddú Meléndez 6f31080f78 Add mail server connection check
If a `JavaMailSenderImpl` is available, check that the underlying mail
server is available on startup. Add a `spring.mail.test-connection`
property to control this behaviour.

Closes gh-3408
10 years ago
Dave Syer 20091b75c9 Tidy up some oauth2 features and add a test for request-scoped context 10 years ago
Stephane Nicoll 774474f8b7 Add hint providers for core properties
Closes gh-3322
10 years ago
Phillip Webb b1f8a692a8 Merge branch '1.2.x' 10 years ago
Phillip Webb 04dfac1c6c Formatting 10 years ago
Phillip Webb d61c38167e Formatting 10 years ago
Stephane Nicoll 533d36a468 Merge branch '1.2.x' 10 years ago
Stephane Nicoll 441049cf4e Auto-detect JMS sessionTransacted flag
If a JtaTransactionManager is present, it is associated with the
auto-created JmsListenerContainerFactory. However, if no such transaction
manager is present, local transaction support is not enabled.

This gives a default situation where the message is acknowledged even
before the listener is invoked. We now make sure to turn on local JMS
transactions if no JtaTransactionManager is present.

Fixes gh-3393
10 years ago
Andy Wilkinson 2159190713 Merge branch '1.2.x' 10 years ago
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
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