Commit Graph

1615 Commits (0ffc7dc13f6de82c199a6d503354a88c7aaec2d9)

Author SHA1 Message Date
Andy Wilkinson 3e79647b35 Fix import ordering 9 years ago
Andy Wilkinson 25e719f549 Fix handling of security.headers.* to allow headers to be disabled
Spring Security 4’s default configuration will, irrespective of any
other header writers that are added, enable writers for the following
headers:

 - X-Content-Type
 - X-XSS-Protection
 - Cache-Control
 - X-Frame-Options

Previously, SecurityProperties.headers used false as the default for the
properties that enable or disable these headers but the configuration is
only applied when the properties are true. This left us with the right
default behaviour (the headers are enabled) but meant that the
properties could not be used to switch off the headers.

This commit changes the defaults for the four properties to true and
updates SpringBootWebSecurityConfiguration to only apply the
configuration when the properties are false. This leaves us with the
desired defaults while allowing users to disable one or more of the
properties by setting the relevant property to false.

Closes gh-3517
9 years ago
Stephane Nicoll 8e0a94f1d7 Make sure Caching is initialized before JPA support
The second level cache of Hibernate can be configured with dedicated
factories that look up for the presence of a cache infrastructure. As
Hibernate shouldn't have to know about Spring, that lookup is done
against the respective proprietary APIs.

We now make sure that caching (and the general purpose Hazelcast
auto-configuration) is fully processed before JPA kicks in. In particular
an explicit `dependsOn` attribute on those beans is added when they are
processed.

Closes gh-4158
9 years ago
Stephane Nicoll 00af1f5c10 Flag main MbeanExporter `@Primary`
When the actuator is enabled, Spring Boot provides two `MBeanExporter`
bean definitions: a general purpose one and a dedicated one for Actuator
endpoints.

This commit flag the general purpose one `@Primary` so that component
can safely inject it by type if necessary. In particular, this fix the
doc of the `JmxMetricWriter`.

Closes gh-4007
9 years ago
Stephane Nicoll fb4cc718c2 Reuse existing ElasticSearch client
Instead of always creating a new ElasticSearch client, we now check for
the presence of a custom bean configuration and use that if it's
available.

Closes gh-4143
Closes gh-4146
9 years ago
Phillip Webb 877e6e034c Polish 9 years ago
Phillip Webb b6667e8495 Reformat code using Spring code formatter plugin 9 years ago
Phillip Webb 6333426cbf Reformat package-info.java files with Eclipse Mars 9 years ago
Phillip Webb 04074fece1 Merge branch '1.2.x' 9 years ago
Phillip Webb 94736719f1 Reformat package-info.java files with Eclipse Mars 9 years ago
Marten Deinum bad8c1bee8 Added support for the DB2 AS400 Driver
Closes gh-4115
9 years ago
Stephane Nicoll 7971ef24ce Polish
Closes gh-4119
9 years ago
Marten Deinum 96830a550a Add support for the DB2 Universal JDBC driver
Closes gh-4114
9 years ago
Stephane Nicoll 422444c3f2 Add throwExceptionIfNoHandlerFound property
Add a property to customize if an exception should be thrown when no
handler was found to process a given request.

Closes gh-4000
9 years ago
Andy Wilkinson 4968900b1d Gracefully disable Solr auto-configuration when Solr 5 is on classpath
Previously, if Solr 5 was on the classpath, SolrAutoConfiguration
would fail with a rather cryptic error message due to a change in the
inheritance hierarchy of CloudSolrServer between Solr 4 and Solr 5.

This commit updates SolrAutoConfiguration to be conditional on a
class that exists in Solr 4 but was removed in Solr 5. This has the
effect of switching off the auto-configuration when Solr 5 is on
the classpath, allowing the auto-configuration report to be used to
identify why the configuration was disabled. The documentation has
also been updated to state that Spring Boot does not currently support
Solr 5.0.

Closes gh-2795
9 years ago
Andy Wilkinson 031a8d5afa Polishing
Add missing javadoc to AuthoritiesExtractor and
FixedAuthoritiesExtractor
9 years ago
Dave Syer 4768faaba7 Add an AuthoritiesExtractor strategy for UserInfoTokenServices
Default will extract an "authorities" key from the map coming from the
server. No existing servers I am aware of actually send that data, but
it might be helpful as a default nevertheless. User can override the
default by adding a bean of that type.

Fixes gh-3711
9 years ago
Phillip Webb aae38db9af Fix compiler warnings only shown in Eclipse Mars 9 years ago
Phillip Webb c9fb9916b8 Reformat code using Eclipse Mars 9 years ago
Phillip Webb e473364e4e Merge branch '1.2.x' 9 years ago
Phillip Webb 6ab376e2e8 Reformat code use Eclipse Mars 9 years ago
Andy Wilkinson 291955613f Fix compile error in tests that doesn’t affect the compiler in Eclipse 9 years ago
Andy Wilkinson 0cdf19a4cb Update test to align with more precise information about target class
The latest Spring Framework 4.2.2 snapshots have reworked
EventListenerMethodProcessor so that it no longer queries a proxies
target class. Previously, when this was happening, it happened early
in the context's lifecycle when the bean's concrete type was unknown.
The led to the target class being set as the proxied interface.

With the latest 4.2.2 snapshots, the first call to
AopUtils.getTargetClass() happens in the test, by which time the
actual concrete type of the bean is known. This commit updates the
test so that its expectations match the more precise result.
9 years ago
Andy Wilkinson 953ef7091b Remove use of Ordered from auto-configuration classes
Closes gh-4056
9 years ago
Andy Wilkinson bc590a8bf4 Polishing, primarily to keep Checkstyle happy 9 years ago
Andy Wilkinson 2c2c7cee8d Polish contribution
See gh-4082
9 years ago
Benedikt Ritter 6978694cb8 Improve error reporting when driver class version is unsupported
ClassUtils.isPresent(String, ClassLoader) swallows all Throwables when
trying to load a class by name. For this reason
UnsupportedClassVersionError will also be swallowed when user code is
trying to use a driver library which has been compiled with a later
JDK than the one the application is running with. All the user would

see was "Cannot load driver class". This change simply propagates the
UnsupportedClassVersionNumberError so that it is easier for users to
find the root cause of the problem.

Closes gh-4082
Closes gh-4091
9 years ago
Dave Syer e17eab6430 Add placeholder resolution to OnResourceCondition
Users can write @ConditionalOnResource("${path.to.file}") and
placeholders are resolved from the environment.
9 years ago
Andy Wilkinson cff1eea4c4 Make new configuration inner class static
See gh-4079
9 years ago
Alexander Tokarev 91a40dd66c Disable unnecessary database initialization
If a DataSource class is found in the classpath then
EmbeddedDataSourceConfiguration will not be used, so the in-memory
database will not be shutdown on application context closing.
As a result, unnecessary database initialization may cause subsequent
tests to fail, for example see [1].

[1] https://github.com/spring-projects/spring-boot/issues/1712
9 years ago
Andy Wilkinson a4eec42813 Ensure that new JPA-based test doesn’t accidentally enable Bitronix 9 years ago
Andy Wilkinson d01236db30 Fix compile failure that doesn’t occur in Eclipse but does on Travis 9 years ago
Andy Wilkinson fd53cbf2f3 Stop JPA and a custom Flyway bean from causing a startup failure
Previously, if an application used JPA and declared its own Flyway bean,
startup would fail. The custom Flyway bean would switch off
auto-configuration of the FlywayMigrationInitializer bean but the
context’s entity manager factory beans would still be configured to
depend on the migration initialiser.

This commit splits the post-processor that configures the dependencies
into two. One that configures the dependency on the Flyway bean and
one that configures the dependency on the FlywayMigrationInitializer
bean. When to auto-configuration of the FlywayMigrationInitializer is
switched off, the auto-configuration of the latter dependency is also
switched off.

Closes gh-4079
9 years ago
Andy Wilkinson 917077c3dd Merge branch '1.2.x' 9 years ago
Andy Wilkinson a94f3a0cbf Only try to auto-configure Jetty when jetty-webapp is on the classpath
Closes gh-4089
9 years ago
Andy Wilkinson 5c35d89fd1 Revert "Update tests to shut down in-memory databases proactively"
For reasons I don't (yet?) understand, shutting down the databases
proactively triggers a StackOverflowError in Jersey. Reverting the
change while I try to figure out what's going in.
9 years ago
Andy Wilkinson 72122ec965 Update tests to shut down in-memory databases proactively 9 years ago
Phillip Webb d1b936ef2c Merge branch '1.2.x' 9 years ago
Phillip Webb 87a515f6a0 Fix TemplateAvailabilityProvider binding issues
Update all TemplateAvailabilityProvider implementations to use the
relaxed property binder. Also fix FreeMarkerTemplateAvailabilityProvider
to use `template-loader-path` rather than `path`.

Fixes gh-4085
9 years ago
Phillip Webb 5e58645202 Log warning for template folder not found problems
Update template auto-configurations to log a warning message rather
than throw an exception if the template folder cannot be found.

Fixes gh-4075
9 years ago
Phillip Webb 5ccd9afc78 Merge branch '1.2.x' 9 years ago
Phillip Webb 891faa9d35 Fix test cleanup to reset commons logging 9 years ago
Andy Wilkinson fac42adb61 Use the right version of ClassUtils 9 years ago
Phillip Webb 2f694fa406 Add per-line match indicators to a/c report
Update the logged auto-configuration report so that each line includes
"matched", "did not match" text. This helps when looking to see if a
specific auto-configuration class was applied or not.

Fixes gh-4084
9 years ago
Andy Wilkinson eae7b0364b Replace use of deprecated JdkVersion API by looking for presence of classes
This commit updates ConditionalOnJava to remove a dependency on the
deprecated JdkVersion API from Spring Framework. In its place it now
looks for the presence of certain classes to determine the version of
Java on which its running.

Closes gh-4005
9 years ago
Phillip Webb c3b7764b72 Polish 9 years ago
Stephane Nicoll 19b5e59234 Use spring.velocity.charset for template encoding
Previously `spring.velocity.charset` only controlled the output encoding
with the templates being loaded with the default encoding. We now
consistently set the same value for both the input and output encodings.

It is still possible to override it to a different value using
`spring.velocity.properties.input.encoding`

Closes gh-3994
9 years ago
Stephane Nicoll 8978f54cc3 Use spring.velocity.charset for template encoding
Previously `spring.velocity.charset` only controlled the output encoding
with the templates being loaded with the default encoding. We now
consistently set the same value for both the input and output encodings.

It is still possible to override it to a different value using
`spring.velocity.properties.input.encoding`

Closes gh-3994
9 years ago
Stephane Nicoll c6040e42a8 Fix typo 9 years ago
Stephane Nicoll b2c3e7e2ed Rename error.* properties to server.error.*
Closes gh-4050
9 years ago
Andy Wilkinson f86eed8646 Polish contribution 9 years ago
mackeprm 942da8bdd3 Support configuration of defaultValue and emptyStringIsFalse
This commit adds support for configuring defaultValue and
emptyStringIsFalse to MustacheCompilerFactoryBean.

Closes gh-4057
9 years ago
Phillip Webb 33ce160251 Automatically X-Forwarded-For in the cloud
Update `ServerProperties` to automatically enable `use-forward-headers`
when running on a cloud platform.

A new `CloudPlatform` enum has been introduced that detects Heroku and
Cloud Foundry.

See gh-4018
9 years ago
Phillip Webb 20b29db512 Unify ServerProperties X-Forwarded-For support
Add a new `server.use-forward-headers` property which can be used to
switch on X-Forwarded-For header support in all supported embedded
servlet containers.

This commit reverts the decision to enable `RemoteIpValve` with Tomcat
by default (gh-3782) and requires that either `user-forward-headers` is
set to true or that `server.tomcat.protocol-header` or
`server.tomcat.remote-ip-header` are set.

See gh-4018
See gh-3782
9 years ago
Phillip Webb 6be072ae07 Polish 9 years ago
Phillip Webb 0b36ba97b3 Polish order 9 years ago
Stephane Nicoll 93d12494e5 Migrate Spring Data Rest settings
In order to have more control on the structure of the configuration, we
do not bind to `RepositoryRestConfiguration` directly anymore. This
commit introduces `RepositoryProperties` instead.

See gh-3854
Closes gh-4073
9 years ago
izeye 5b211706c0 Polish
Closes gh-4069
9 years ago
Phillip Webb acde5407e8 Polish 9 years ago
Stephane Nicoll eeaa1df1dd Allow Mongo support without Spring Data MongoDB
Closes gh-4049
9 years ago
Andy Wilkinson 1e50d988ab Tighten up the conditions on WebSocketMessagingAutoConfiguration
See gh-2445
9 years ago
Andy Wilkinson 204cb6f195 Auto-configure WebSocket JSON converter to use context’s ObjectMapper
This commit adds auto-configuration support for WebSocket-based
messaging. When the user enables WebSocket messaging (typically via
@EnableWebSocket and @EnableWebSocketMessageBroker) and an ObjectMapper
bean exists, a MappingJackson2MessageConverter that uses the
ObjectMapper will be configured. This causes any spring.jackson.*
configuration to affect WebSocket message conversion in the same way
as it affects HTTP message conversion.

Closes gh-2445
9 years ago
Michael Stummvoll a1e0f01103 Support `error.include-stacktrace` configuration
Add `error.include-stacktrace` configuration option to determine when
stack trace attributes should be added. Options are `never`, `always`
or `on-trace-param`.

Prior to this commit stacktrace attributes were never includes in HTML
responses, and only included in JSON responses when a `trace` request
parameter was set to `true`. This has now been changed so that,
by default, stacktrace attributes are never included.

The BasicErrorController includes a protected method that can be
overridden if includes should be different depending on the `produces`
mapping.

Closes gh-2371
9 years ago
Stephane Nicoll f918bf9c11 Fix broken build 9 years ago
Dave Syer 2e3658fd91 Enable RemoteIpValve by default
Fixes gh-3782
9 years ago
Phillip Webb 57a698f388 Fix broken Cassandra tests
See gh-2064
9 years ago
Julien Dubois c401330901 Add Cassandra support
Add auto-configuration support and health checks for Cassandra and
Spring Data Cassandra.

Fixes gh-2064
Closes gh-2214
9 years ago
Andy Wilkinson c55900b433 Simplify Jackson-related auto-configuration for HATEOAS and Data REST
This commit simplifies the Jackson-related auto-configuration that’s
applied when Spring HATEOAS and Spring Data REST are on the classpath.

Previously, Boot used Jackson2HalModule to apply the HAL-related
ObjectMapper configuration to the context’s primary ObjectMapper. This
was to allow HAL-formatted responses to be sent for requests accepted
application/json (see gh-2147). This had the unwanted side-effect of
polluting the primary ObjectMapper with HAL-specific functionality.
Furthermore, Jackson2HalModule is an internal of Spring HATEOAS that
@olivergierke has asked us to avoid using.

This commit replaces the use of Jackson2HalModule with a new approach.
Now, the message converters of any RequestMappingHandlerAdapter beans
are examined and any TypeConstrainedMappingJackson2HttpMessageConverter
instances are modified to support application/json in addition to their
default support for application/hal+json. This behaviour can be disabled
by setting spring.hateoas.use-hal-as-default-json-media-type to false.
This property is named after Spring Data REST’s configuration option
which has the same effect when using Spring Data REST. The new property
replaces the old spring.hateoas.apply-to-primary-object-mapper property.

Previously, when Spring Data REST was on the classpath,
JacksonAutoConfiguration would be switched off resulting in the context
containing multiple ObjectMappers, none of which was primary.

This commit configures RepositoryRestMvcAutoConfiguration to run after
JacksonAutoConfiguration. This gives the latter a chance to create its
primary ObjectMapper before the former adds its ObjectMapper beans to
the context.

Previously, the actuator’s hypermedia support assumed that the
HttpMessageConverters bean would contain every HttpMessageConverter
being used by Spring MVC. When Spring HATEOAS is on the classpath this
isn’t the case as it post-processes RequestMappingHandlerAdapter beans
and adds a TypeConstrainedMappingJackson2HttpMessageConverter to them.
This wasn’t a problem in the past as the primary ObjectMapper, used by a
vanilla MappingJackson2HttpMessageConverter, was configured with Spring
HATEOAS’sJackson2HalModule. Now that this pollution has been tidied up
the assumption described above no longer holds true. MvcEndpointAdvice,
which adds links to the actuator’s json responses, has been updated
to look at the HttpMessageConverters of every
RequestMappingHandlerAdapter when it’s trying to find a converter to
use to write a response with additional hypermedia links.

Integration tests have been added to spring-boot-actuator to ensure
that the changes described above have not regressed the ability to
configure its json output using spring.jackson.* properties (see
gh-1729).

Closes gh-3891
9 years ago
Phillip Webb 028fc04777 Fix checkstyle errors 9 years ago
Phillip Webb b95bb54e8c Make BasicErrorController easier to subclass
Extract a new AbstractErrorController base class for users to extend
if they don't like the default BasicErrorController.

Fixes gh-3998
9 years ago
Phillip Webb 764c0a8bf9 Make FlywayMigrationInitializer ordered and public
Update `FlywayAutoConfiguration` to allow explicit ordering of the
`FlywayMigrationInitializer`.

Fixes gh-4011
9 years ago
Phillip Webb 06f3202c68 Improve DataSourceProperties exception messages
Update DataSourceProperties exceptions to include a less misleading
message. Errors message now note that you may need to add an embedded
database to the classpath or active a profile to pickup specific
settings.

Fixes gh-4012
9 years ago
Fabricio Colombo 605eb8a14d Add Liquibase labels and parameters properties
Update `LiquibaseAutoConfiguration` and `LiquibaseProperties` to add
support for labels and parameters.

Closes gh-3915
9 years ago
izeye efb699de60 Remove duplicate `@ConditionalOnMissingBean` checks. 9 years ago
Phillip Webb c629813165 Rationalize Spring Data auto-configurations
Relocate several auto-configuration classes to `...autoconfigure.data`
to make it clearer that they are Spring Data specific.

Also moved `EntityManagerFactoryBuilder` to `spring-boot` since it is
generally useful and doesn't need to be directly tied to the
auto-configuration module.

Fixes gh-4002
9 years ago
Andy Wilkinson a38f01f9e5 Fix compile errors in Eclipse (STS 3.6.4) in UserInfoTokenServicesTests 9 years ago
Phillip Webb 21de97da50 Make jackson-module-parameter-names optional
Update the spring-boot-autoconfigure POM so that
jackson-module-parameter-names is optional.

See gh-3804
9 years ago
Phillip Webb f2ce59c403 Polish 9 years ago
Phillip Webb 86daf44435 Add @Since tag 9 years ago
Andy Wilkinson 7f2be6ce27 Add auto-configuration for Jackson's parameter names module
The parameter names module allows users of Java 8 that have compiled
their code with the -parameters option to avoid the name for
annotations to map the json onto constructor and method parameters
with the names of the parameters being used instead.

This commit adds auto-configuration for the module that will only
be enabled when running on Java 8.

Closes gh-3804
9 years ago
Andy Wilkinson c3e447c84c Order char encoding filter so it sets encoding before request is read
For the character encoding filter to work, it's vital that it sets
the request's encoding before any other filters attempt to read the
request. This commit updates the order of
OrderedCharacterEncodingFilter to be HIGHEST_PRECEDENCE and improves
the existing test to check that the ordering is as required.

Closes gh-3912
9 years ago
Spring Buildmaster 9409c49c10 Next development version 9 years ago
Andy Wilkinson c274162e6f Correct since version in javadoc of Any and AllNestedCondition 9 years ago
Andy Wilkinson a9d67213be Override Eclipse’s formatting to keep Checkstyle happy
See gh-3964
9 years ago
Andy Wilkinson 2fd8a58197 Polish contribution
- Rename local variable to avoid shadowing field with the same name
 - Add a test to verify that local.mongo.port is set on the parent
   context

Closes gh-3955
9 years ago
Paweł Doleciński 8f5a753eff Fix propagation of local.mongo.port up the context hierarchy
Previously, a StackOverflowError would occur when using a random port
for embedded mongo as the logic for propagating the property up the
context hierarchy would repeatedly use the leaf context's parent.

This commit updates the logic to look to see if the current context
has a parent, only calling the method again if it does.

Closes gh-3956
9 years ago
Andy Wilkinson b79ca614a1 Replace usage of deprecated API in EmbeddedMongoAutoConfiguration 9 years ago
Phillip Webb 6746a0af7b Merge branch '1.2.x' 9 years ago
Pei-Tang Huang a5430d8a0c Catch more general Hibernate 4.2 LinkageError
Update HibernateJpaAutoConfiguration to catch LinkageError rather than
NoClassDefFoundError. Required due to the fact that JBoss EAP 6 wraps
NoClassDefFoundErrors.

Fixes gh-3605
9 years ago
Phillip Webb b7e9f805c9 Set ignoreUnknownFields=true on ServerProperties
Update ServerProperties so that unknown SERVER_* environment properties
do not cause startup failures.

Fixes gh-3903
9 years ago
Phillip Webb e674d751de Polish Javadoc 9 years ago
Phillip Webb e07df7e4c6 Remove redundant modifiers 9 years ago
Phillip Webb 460ca75fce Polish newline at end of file 9 years ago
Phillip Webb d09805fd75 Polish license headers 9 years ago
Phillip Webb 6e29ee4557 Polish 9 years ago
Phillip Webb 67402405db Reformat code 9 years ago
Phillip Webb 2615990ffb Organize imports 9 years ago
Phillip Webb 0335053139 Merge branch '1.2.x' 9 years ago
Phillip Webb 15686ed4fd Reformat code 9 years ago
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
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
9 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
Spring Buildmaster 7ce391db4f Next development version 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