Commit Graph

1366 Commits (57d9b58f7938d6774b93fe3e63494e264f2f9856)

Author SHA1 Message Date
Phillip Webb 0f6b60d8c8 Organize imports 9 years ago
Phillip Webb 690da89c82 Fix warnings 9 years ago
Phillip Webb 4aa2fed48b Revert "configure JRE that is different from compiler target level"
This reverts commit 678f36cfef.
9 years ago
Phillip Webb 6193b640a4 Polish 9 years ago
Phillip Webb db41fb16c0 Polish Hazelcast auto-configuration
Extract a HazelcastInstanceFactory class and cleanup some formatting.

See gh-2942
9 years ago
Phillip Webb 138d66706a Polish nested conditions 9 years ago
Stephane Nicoll fa099ff8df Polish 9 years ago
Stephane Nicoll 1a60056f9e Polish contribution
Closes gh-3831
9 years ago
james 560ffc9056 Do not attempt to restart non-restartable jobs
Closes gh-3830
9 years ago
Stephane Nicoll cd1ace0c15 Merge branch '1.2.x' 9 years ago
Barry Lagerweij 8d75aa0ea9 Fix Oracle XA datasource class name
Closes gh-3846
9 years ago
Stephane Nicoll 8f520dafc7 Remove hard-coded list of values in description
Since the meta-data now provide an explicit support for value hints, we
should not copy/paste them in the description as the IDE is able to
process them any way it wants.

Closes gh-3863
9 years ago
Dave Syer 2b3d419e10 Add FilterRegistrationBean.REQUEST_WRAPPER_FILTER_MAX_ORDER constant
All the filters added explicitly by Spring Boot now have order <=
FilterRegistrationBean.REQUEST_WRAPPER_FILTER_MAX_ORDER (value 0).
There is nothing we can do about the DispatcherServlet and anything
else downstream of the filter chain.

Fixes gh-3613
9 years ago
Andy Wilkinson be640965a6 Support resolution of HAL link titles from a resource bundle
Spring HATEOAS 0.19.0.RELEASE provide support for resolving a link’s
title by looking up the key _links.$rel.title. For us to take advantage
of this in Spring Boot, HalHandlerInstantiator must be created using
the link relation message source that’s automatically created by
HateoasConfiguration.

Closes gh-3860
9 years ago
Stephane Nicoll bd942a35fb Fix upgrade to Spring Data Gosling RELEASE
Closes gh-3860
9 years ago
Andy Wilkinson bb92387928 Polishing 9 years ago
Rob Winch 34772e4177 Add Auto Configuration for SecurityEvaluationContextExtension
Fixes gh-3840
9 years ago
Stephane Nicoll bd15a0c03a Polish contribution
Closes gh-3818
9 years ago
madorb b69152571e Consistently apply table prefix
Make sure that if a custom table prefix is specified, it is set on the
JobRepository as well.

Closes gh-3798
9 years ago
Stephane Nicoll 2c619232b3 Add ComponentScan aliases on SpringBootApplication
Add aliases for `@ComponentScan`attributes on `@SpringBootApplication`
so that it is possible to customize how the component scan should be
applied on the project.

Previously, one would have to revert to `@EnableAutoConfiguration` to
achieve the same result.

Closes gh-3368
9 years ago
Eric Fenderbosch ea4061fe99 Add AllNestedConditions and NoneOfNestedConditions
Fixes gh-2400
9 years ago
Stephane Nicoll 721b5a2395 Hazelcast auto-configuration
Provide a general purpose Hazelcast integration (i.e. not tied to caching).

Auto-configure a `HazelcastInstance` either based on the presence of a
`Config` bean or a configuration file. Said configuration file can be
specified explicitly or automatically found from default locations.

The cache integration already supports Hazelcast so it has been reworked
to automatically reuse an existing `HazelcastInstance` if available.

Closes gh-2942
9 years ago
Andy Wilkinson 90668584c3 Polish contribution
Closes gh-3703
9 years ago
Rob Winch 868589366e Ensure that Spring Security Filter's order is configured
This commit ensures that even when a user specifies a
WebSecurityConfiguration that the order of Spring Security's Filter
is still configured.

Closes gh-3824
See gh-3703
9 years ago
Dave Syer 538afc4ab1 Make some methods in BasicErrorController protected
Spring MVC requires all handlers for the same path to be on the same handler
so if anyone wants to add new handlers for different content types they
have to copy a lot of code from BasicErrorController. This change increases
the visibility of the basic utility methods in BasicErrorController so that
custom handlers can be added easily.

Fixes gh-3828
9 years ago
Stephane Nicoll d74d657372 Polish 9 years ago
Stephane Nicoll 63d157bb7c Favor JSR-107 provider if present
Previously, native cache libraries were favored over a standard JSR-107
implementation. If a user has a working setup using JCache with one
provider and switch to another provider, his setup may be broken if we
happen to provide a native support for the new provider.

We now consistently favor JSR-107 if it is present. Native support can
still be enabled via the `spring.cache.type` property.

Closes gh-3822
9 years ago
Dave Syer ff8a4d0f9d Merge branch '1.0.x'
Conflicts: MessageSourceAutoConfiguration.java
9 years ago
Dave Syer 68b55adac0 Add search=CURRENT to MessageSourceAutoConfiguration
Fixes gh-3803
9 years ago
Dave Syer 2583f8050a Enable Tomcat RemoteIpValve by default
Fixes gh-3782
9 years ago
Stephane Nicoll 8543a3ca91 Improve use of SSL config in RabbitConnectionFactory
Previously we had to create a fake Properties object as the factory did
not provide individual setters for the SSL configuration. This has been
added as part of Spring AMQP 1.5.0.RC1 so we're using those instead.

Closes gh-3754
9 years ago
Stephane Nicoll 48f16c4386 Avoid Tomcat specific dependency in ServerProperties
Closes gh-3781
9 years ago
Stephane Nicoll 4235df180e Polish
See gh-3792
9 years ago
Stephane Nicoll 1466169dc0 Register ResourceUrlEncodingFilter only if necessary
Previously, `ResourceUrlEncodingFilter` was registered even if the
resource chain handling was disabled (which is the default).

We now take care of registering it only if the resource chain handling is
enabled.

Closes gh-3353
9 years ago
Martin Lippert 678f36cfef configure JRE that is different from compiler target level 9 years ago
Stephane Nicoll 7c0c953f81 Add value alias for SpringApplicationConfiguration
Given that Spring Boot uses java config accross the board, a new `value`
attribute is now aliased to the existing `classes` attribute such that
one could write the following:

@SpringApplicationConfiguration(MyConfig.class)
public class MyTest {}

Closes gh-3635
9 years ago
Stephane Nicoll 58d0776abe Polish 9 years ago
Stephane Nicoll d1a4d6958a Document spring.datasource.name
The `spring.datasource.name` property was hidden behind the 'name'
attribute of the Tomcat connection pool (since we are mapping all
datasource implementations on the `spring.datasource` namespace.

This commit replace the injected value by hand with the use of the
regular `DataSourceProperties`. That way, we generate proper meta-data
for it as well.

Closes gh-3755
9 years ago
Stephane Nicoll 2d62e1fc89 Add a property to configure the connection pool
A new `spring.datasource.type` property can now be used to configure the
connection pool implementation to use (rather than only relying on Boot's
preferences).

Closes gh-3705
9 years ago
Stephane Nicoll 4e0f99ed8b Polish
Closes gh-3750
9 years ago
Eddú Meléndez 74e1a1c940 Add fallbackToSystemLocale configuration key
Allow to configure the `fallbackToSystemLocale` attribute of
`MessageSource` via configuration.

Closes gh-3749
9 years ago
Andy Wilkinson c15a670c6d Workaround bizarre compiler problem 9 years ago
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