Commit Graph

1322 Commits (d09805fd750163d1d03f1c5b1e85d8a2162e048c)

Author SHA1 Message Date
Stephane Nicoll c5566e2755 Fix broken build
Update EnableAutoConfigurationImportSelectorTests to match the new
`excludeName` property.

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

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

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

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

Add Spring Security OAuth2 support to Spring Boot CLI

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

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

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

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

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

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

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

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

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

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

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

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

Closes gh-2525
10 years ago
Stephane Nicoll e0f59d8a74 polish batch table prefix customization
See gh-2132
10 years ago
Eddú Meléndez d6818e96f5 Customize table prefix of batch meta-data tables
Add 'spring.batch.table-prefix' to customize the prefix of the
batch meta-data tables.

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

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

Added dependencies management for the JCache support with tests

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

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

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

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

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

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

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

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

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

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

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

Fixes gh-2840
10 years ago
Phillip Webb a8d099f6b8 Revert "Add start/stop goals to maven plugin"
This reverts commit 54e12a07e6.
10 years ago
Stephane Nicoll 54e12a07e6 Add start/stop goals to maven plugin
SpringApplicationLifecycle provides lifecycle operations on the current
Spring Boot application. It can be registered as an MBean of the platform
MBean server if a specific property is set. Besides, the JMX name can
also be customized via a property in case more than one Spring Boot
application is started in the same process.

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

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

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

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

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

See gh-2811
10 years ago
Stephane Nicoll 578bd5dc37 Add TransactionTemplate auto-configuration
Provide a TransactionTemplate if one PlatformTransactionManager is
present.

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

Closes gh-2464
Closes gh-2809
10 years ago
Andy Wilkinson fdd3f12ee0 Merge branch '1.2.x' 10 years ago
Andy Wilkinson 4f988d2aec Polish log message in AutoConfigurationReportLoggingInitializer 10 years ago
Stephane Nicoll f480c0de2f Merge branch '1.2.x' 10 years ago
Stephane Nicoll 0f14210937 Polish documentation 10 years ago
Stephane Nicoll 452ce0ffad Polish
Add setter for cache names so that it can be bound both via indexed
access and comma-separated list.
10 years ago
Phillip Webb ebccedcfdd Add FlywayMigrationStrategy support
Update FlywayAutoConfiguration to support pluggable migration
strategies. Rather than always calling flyway.migrate(), users can now
provide a FlywayMigrationStrategy @Bean to call whatever methods they
wish.

Fixes gh-1814
10 years ago
Andy Wilkinson ba3d4e9e3c Upgrade to Spring Security 4
This commit updates Spring Boot to use Spring Security 4. As a result
of this, the coordinates of Thmyeleaf's Spring Security extra, for
which dependency management and auto-configuration is provided, have
been updated to the Spring Security 4 variant.

Closes gh-2727
10 years ago
Andy Wilkinson d13878e193 Upgrade to Spring Data Fowler RELEASE
The versions in the dependency management for the various datastore
dependencies have been aligned with those used by Spring Data Fowler.

The Data REST tests and sample application has been updated to configure
the base path in favour of the deprecated base uri property

Closes gh-2673
10 years ago
Andy Wilkinson 1dcf18b16e Allow Jackson's serialization inclusion to be configured via the env
This commit adds support for configuring an ObjectMapper's
serialization inclusion using the environment via the
spring.jackson.serialization-inclusion property. The property's value
should be one of the values on the JsonInclude.Include enumeration.
Relaxed binding of the property value to the enum is supported. For
example:

spring.jackson.serialization-inclusion: non_null

Closes gh-2532
10 years ago
Andy Wilkinson 2a5eecaf4a Merge branch '1.2.x' 10 years ago
izeye b45bb6d082 Make all of GsonHttpMessageConvertersConfiguration conditional on Gson
Previously GsonHttpMessageConvertersConfiguration was unconditional
with its nested configuration class being
@ConditionalOnClass(Gson.class). This led to the unnecessary
registration of the GsonHttpMessageConvertersConfiguration bean when
Gson isn't on the classpath.

This commit moves the condition up onto the outer class so that no
Gson-related beans are created when Gson is not on the classpath.

Closes gh-2778
10 years ago
Andy Wilkinson 507520aab9 Merge branch '1.2.x' 10 years ago
Andy Wilkinson 5547f91bfb Correct name of check-template-location property in error message
Closes gh-2788
10 years ago
Phillip Webb c4ddce6b73 Polish 10 years ago
Andy Wilkinson 8b1022effa Upgrade to Spring Batch 3.0.4 snapshots
Closes gh-2712
10 years ago
Stephane Nicoll 0fc54b7c5b Add ConditionalOnSingleCandidate
Add a new ConditionalOnSingleCandidate condition that determines if the
condition should match only if autowiring by type is guaranteed to
succeed. Used by auto-configuration that relies on a single candidate of
a given type (for instance, the JdbcTemplate auto-configuration relies on
the presence of a DataSource).

Such wiring by type will succeed if only one bean of that type is present
or if one matching instance is flagged "primary" amongst the candidates.

ConditionalOnSingleCandidate is a basic version of ConditionalOnBean that
only accepts a single type and does not determine a defaut based on its
presence on a bean definition.

Closes gh-1702
10 years ago
Andy Wilkinson a69cd36dbc Merge branch '1.2.x' 10 years ago
Andy Wilkinson d4ffab2f02 Provide additional config metadata for spring.http.gzip.enabled
See gh-2776
10 years ago
Andy Wilkinson 3df6cb1325 Merge branch '1.2.x' 10 years ago
Andy Wilkinson 212520fa15 Add a property to disable auto-configuration of GzipFilter
Closes gh-2776
10 years ago
Phillip Webb 59692cd938 Polish formatting 10 years ago
Stephane Nicoll fbe9774890 Use spring.cache.config with JCache
According to the spec, specifying a custom URI when retrieving a
`javax.cache.CacheManager` might be used as a way to transmit the
location of a custom configuration file to initialize the underlying
cache manager.

If `spring.cache.config` is set, we use that information to retrieve a
CacheManager with that configuration file. Unfortunately, hazelcast does
not support this feature so we are setting the property key it expects
instead.

See https://github.com/hazelcast/hazelcast/issues/4943

Closes gh-2743
10 years ago
Eddú Meléndez fcae5a7df8 Add missing type check on EhCacheCacheConfiguration
Previously, EhCacheCacheConfiguration could be triggered even if the
ehcache library is not present. This commit adds the missing
`ConditionalOnType` that now guards the configuration properly.

See gh-2633
10 years ago
Stephane Nicoll 3b99ba9d61 Add missing classpath checks
Certain cache manager implementations are located in the
spring-context-support module that isn't pulled automatically.

As a result, the related cache auto-configurations should make sure that
the relevant CacheManager implementation is available.

See gh-2633
10 years ago
Stephane Nicoll 9f1475d708 Fix wrong import in Guava auto-config
Remove the need for `commons-collections`

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

See gh-2633
10 years ago
Stephane Nicoll ff7c66c0d2 Fix annotation() javadoc 10 years ago
Spring Buildmaster e03c11dda8 Next development version 10 years ago
Phillip Webb 5d9efe40d0 Merge branch '1.2.x' 10 years ago
Dave Syer 18afe8bd0c Fixup incorrect property name
The property in XADataSourceAutoConfigurationTests should be
`data-source-class-name`. Previously the `-name` was missing.
10 years ago
Phillip Webb fbf34e261e Polish 10 years ago
Phillip Webb d07e18143d Merge branch '1.2.x' 10 years ago
Phillip Webb e3f203a8a5 Polish 10 years ago
Andy Wilkinson 8850286937 List excluded auto-config classes in the auto-config report and endpoint
Prior to this commit, the auto-configuration report (both in its logged
form and the actuator endpoint) listed the positive and negative matches
but did not list the classes, if any, that the user had excluded.

This commit updates the logged report and the actuator endpoint to
expose a list of the excluded class names configured via the exclude
attribute on @EnableAutoConfiguration.

Closes gh-2085
10 years ago
Andy Wilkinson ed5853e60e Merge branch '1.2.x' 10 years ago
Andy Wilkinson c3571d416a Improve YAML-based configuration of Tomcat compression
Tomcat uses the strings “on” and “off” to enable and disable
compression. YAML interprets on as true and off as false, leaving
ServerProperties.Tomcat.compression configured with “true” and “false”
respectively. One solution is to use “on” rather than on and “off”
rather than off in the YAML file but users may not realise that they
need to do so.

This commit updates the connector customiser that configures compression
to map “true” to “on” and “false” to “off”.

Closes gh-2737
10 years ago
Stephane Nicoll 72561f8969 Fix typo 10 years ago
Phillip Webb 85319c0793 Fix Java 8 Javadoc errors 10 years ago
Eddú Meléndez 48959f2553 Add support for EhCache
Include auto-configuration support for EhCache with auto-detection of
the default `ehcache.xml` at the root of the classpath. EhCache
configuration can also be set via `spring.cache.config`.

See gh-2633
10 years ago
Stephane Nicoll 151220f41d Add cache manager auto-configuration
Add support for cache manager auto-configuration that is triggered when
the `EnableCaching` annotation is added to a Spring Boot application.

A new "spring.cache" set of configuration keys is also provided. The
"spring.cache.mode" allows the user to specify the cache provider that
should be auto-configured. If no explicit configuration is provided,
the environment is checked for the best suited cache implementation,
that is:

- Generic if at least one `Cache` bean is defined in the context.
- Hazelcast if either a default configuration file is present or the
  `spring.cache.config` property is set.
- JCache if one JSR-107 provider is present
- Redis if a `RedisTemplate` is defined in the context
- Guava
- Simple as a fallback option, using concurrent maps
- NoOp (that is, no cache) if the mode is set to "none"

If the provider supports it, it is possible to specify the caches
to create on startup via `spring.cache.cache-names`. If the provider
relies on a configuration file and a custom one needs to be used
`spring.cache.config` can be set to such custom resource.

If more than one JSR-107 provider is present, it is possible to force
the provider to use by setting the mode to `jcache` and specifying the
fully qualified class name of the CachingProvider to use via
`spring.cache.jcache.provider`.

See gh-2633
10 years ago
Phillip Webb 10da3d390e Polish 10 years ago
Stephane Nicoll e21d8042ad Upgrade event listener to GenericApplicationListener
SmartApplicationListener has been superseded by GenericEventListener as
of Spring Framework 4.2. It will be eventually deprecated and removed.

Migrate our event listeners to use the new contract.

Closes gh-2576
10 years ago
Andy Wilkinson d7818b441e Merge branch '1.2.x' 10 years ago
Andy Wilkinson 0da24f82e3 Polishing: move tests for mustache.web into the correct package 10 years ago
Andy Wilkinson dd748eda19 Use the configured charset, if any, in MustacheViewResolver
Closes gh-2670
10 years ago
Andy Wilkinson 95a0be3cb2 Merge branch '1.2.x' 10 years ago
Andy Wilkinson 219317e8c7 Make web security config require spring-security-web on classpath
Previously, SpringBootWebSecurityConfiguration required a web
application and @EnableWebSecurity to be on the classpath.
@EnableWebSecurity is in spring-security-config so this could lead
to the configuration being active when spring-security-web isn't
on the classpath but the rest of Spring Security is.

This commit updates SpringBootWebSecurityConfiguration to also make it
conditional on a class in spring-security-web.

Fixes gh-2717
10 years ago
Andy Wilkinson bc99ad2120 Ignore Batch tests that use JDBC as they don’t work with Spring 4.2
Spring Framework’s ParamterizedRowMapper has been deprecated since
3.1 and has been removed in 4.2. Spring Batch currently relies on
ParameterizedRowMapper, making it incompatible with 4.2. To allow us to
build successfully against 4.2, this commit ignores Spring Boot’s tests
that use Spring Batch’s JDBC support.

See gh-2575
10 years ago
Andy Wilkinson 7a73c5883f Avoid using @Order on @Configuration classes as Spring now honours it
In Spring Framework 4.1, @Order on a @Configuration class had no effect.
This allowed us to use it on auto-configuration classes to control
the ordering of auto-configuration classes without it having any
broader implications for configuration class ordering.

Spring Framework 4.2 now honours @Order on @Configuration classes. This
breaks a number of tests where we were relying on the order that the
classes were passed to register when evaluating various bean conditions.

This commit replaces the use of @Order on auto-configuration classes
with a new annotation, @AutoConfigureOrder. The new annotation is
handled by AutoConfigurationSorter where it’s used to order
auto-configuration classes. This allows us to order auto-configuration
classes without the unwanted side-effect of this also affecting the
general ordering of configuration classes.

See gh-2575
10 years ago
Stephane Nicoll b963a82f36 Merge branch '1.2.x' 10 years ago
Raphael Ackermann 1235a35f2a fix typo in javadoc
{@code tomat-embedded.jar} --> {@code tomcat-embedded.jar}
10 years ago
Andy Wilkinson 9444a25de3 Merge branch '1.2.x' 10 years ago
Andy Wilkinson 0a38b9b3ab Enable the configuration of arbitrary Elasticsearch client properties
Previously, only a handful of properties could be set when
auto-configuring an Elasticsearch client. This commit introduces support
for configuring arbitrary properties using the
spring.data.elasticsearch.properties prefix. For example,
client.transport.sniff can be configured using
spring.data.elasticsearch.properties.client.transport.sniff.

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

Closes gh-1838
10 years ago
Phillip Webb 182754a582 Polish HealthIndicatorAutoConfiguration
Update HealthIndicatorAutoConfiguration to reduce the amount of
duplication in inner configuration classes.
10 years ago
Phillip Webb 4af70f1840 Polish 10 years ago
Phillip Webb c349b402e8 Merge branch '1.2.x' 10 years ago
Phillip Webb 16495d223a Polish 10 years ago
Phillip Webb bdd61b8ec2 Merge branch '1.1.x' into 1.2.x 10 years ago
Phillip Webb 8b979fa2e6 Polish 10 years ago
Andy Wilkinson 3eec5426ad Merge branch '1.2.x' 10 years ago
Andy Wilkinson 1f40c8a9ba Tolerate breaking API changes in ActiveMQ 5.11.0
In ActiveMQ 5.11 the signature of
PooledConnectionFactory.setConnectionFactory has changed. It now takes
an Object rather than a ConnectionFactory. This change is not binary
backwards compatible so it causes a NoSuchMethodError as we compile
against 5.10.

This commit updates ActiveMQConnectionFactoryConfiguration to call
the setConnectionFactory method reflectively, looking for both the
ConnectionFactory and Object variants.

Closes gh-2640
10 years ago
Dave Syer 5aab484e11 Merge 1.2.x to pick up DataSourceInitializer changes 10 years ago
Dave Syer f1ecf53495 Delay instantiation of DataSource as late as possible
Unfortunately it still has to happen in a @PostConstruct (otherwise
JPA never sees the schema in time), but we can delay a bit by not
using @Autowired. Appears to fix the Spring Cloud problem
(https://github.com/spring-cloud/spring-cloud-config/issues/105).

Fixes gh-2658
10 years ago
Johannes Stelzer cd8c3d7327 Add mail health check
Define an additional health indicator for each JavaMailSenderImpl
instance in the context.

Closes gh-2017 and gh-2617
10 years ago
Maciej Walkowiak f05769dcc5 Add auto-configuration for SendGrid's client
Closes gh-2160
Closes gh-2280
10 years ago
Andy Wilkinson 20efbdd71f Merge branch '1.2.x' 10 years ago
Andy Wilkinson 71dde3ec89 Tolerate removal of JacksonJodaFormat in Jackson 2.5
We currently officially support Jackson 2.4, but some users wish to
use Jackson 2.5. This causes a failure as JacksonAutoConfiguration
depends on JacksonJodaFormat which exists in 2.4 but not in 2.5. This
commit updates JodaDataTimeJacksonConfiguration to make it conditional
on JacksonJodaFormat being on the classpath. This means that Jackson
2.5 users will not have configurable DateTime formatting
(added in 201fb5e5) but things will generally work once again.

Closes gh-2573
10 years ago
Rob Winch 7ecbbc11f2 Merge branch '1.2.x' 10 years ago
Rob Winch 493d7a364d Merge branch '1.1.x' into 1.2.x 10 years ago
Rob Winch 760d6eceee Fix Unnecessarily Adding Default Security User
Fixes gh-2567
10 years ago
Phillip Webb a57a88f5cf Move master to 1.3.0.BUILD-SNAPSHOT 10 years ago
Spring Buildmaster 8f0ad02237 Next development version 10 years ago
Spring Buildmaster aea68f0c32 Next development version 10 years ago
Andy Wilkinson 80111c801a Consider custom authentication database when creating MongoClient
Previously, MongoProperties did not consider the configuration of a
custom authentication database when creating a MongoClient. This
commit updates MongoProperties to use the authentication database
when it is configured, falling back to the normal database when it is
not configured.

Closes gh-2562
10 years ago
Stephane Nicoll 1e3a057786 polish meta-data description 10 years ago
izeye 0073ab078d Remove unnecessary if statement 10 years ago
izeye 2e7ad2252f Fix Javadoc 10 years ago
Phillip Webb 1231da1c2f Add security.basic.authorize-mode property
Add a `security.basic.authorize-mode` property that can be used to
affect how basic security authorization is applied.

Fixes gh-2462
10 years ago
Phillip Webb f7221be7c9 Rename spring.favicon.enabled property
Rename `spring.favicon.enabled` to `spring.mvc.favicon.enabled`.

See gh-2377
10 years ago
Phillip Webb c1dcd85f60 Simplify MustacheEnvironmentCollector
Simplify the MustacheEnvironmentCollector so that it no longer binds
the Spring Environment to a Map.

See gh-2242
10 years ago
Phillip Webb cdf785a8d1 Fix index.html root path forwarding
Fix automatic '/' -> 'index.html' forwarding to also work when a
`server.servlet-path` property is set.

Fixes gh-2351
10 years ago
Phillip Webb a1cbd93d6b Ensure local Elasticsearch nodes are closed
Update ElasticsearchAutoConfiguration to ensure that local nodes are
closed when the context is closed. Prior to this commit the close()
method of the Client would be called which had no effect for local
Nodes.

Fixes gh-2480
10 years ago
Phillip Webb 5c4b698f86 Support string names @AutoConfigureBefore/After
Update @AutoConfigureBefore and @AutoConfigureAfter annotations to
support String classnames in addition direct Class references.

Fixes gh-2529
10 years ago
Phillip Webb 24fd4a1c7f Relax MultipartConfigElement condition
Allow MultipartConfigElement bean to be created even if a
MultipartResolver bean has been defined by the user.

Fixes gh-2538
10 years ago
Phillip Webb 7943195d51 Rename RepositoryRestMvcBootConfiguration
Rename RepositoryRestMvcBootConfiguration to
SpringBootRepositoryRestMvcConfiguration so that it follows the same
naming pattern as other custom Spring Boot configurations.

See gh-2392
10 years ago
Phillip Webb 56e31a8c6b Polish 10 years ago
Phillip Webb 10257d96f2 Merge branch '1.1.x' 10 years ago
Phillip Webb 8a8b5d3aa7 Polish 10 years ago
Andy Wilkinson 6253cc5dc7 Merge branch '1.1.x' 10 years ago
Andy Wilkinson df81b3145f Backport to 1.1.x the fix for gh-2474 (originally made in e42fa79f7) 10 years ago
Andy Wilkinson 67ec89e74d Merge branch '1.1.x' 10 years ago
Andy Wilkinson 8622e5db20 Apply f9816ea and 64e94f3 to 1.1.x
Fixes gh-2473
10 years ago
Andy Wilkinson 64e94f3b1b Correct javadoc syntax and apply code formatting 10 years ago
Andy Wilkinson 9af30450c4 Upgrade to Liquibase 3.3.2
Closes gh-2512
10 years ago
Rob Winch f9816ead93 Fix configureGlobal on SpringBootApplication
Fixes gh-2473
10 years ago
Rob Winch e42fa79f7b Fix fragile AuthenticationManagerConfiguration
Fixes gh-2474
10 years ago
Andy Wilkinson 201fb5e534 Make Joda DateTime serialization format configurable
We allow the serialization format of dates to be configured using
spring.jackson.date-format. However, this property only applies to
java.util.Date instances and has no effect on a Joda DateTime.

This commit updates our auto-configuration for Jackson to allow
the format string that is used to  serialize a Joda DateTime to be
configured. A new property, spring.jackson.joda-date-time-format has
been introduced. When configured, it is used to configure the
serialization format for a Joda DateTime. When it is not configured,
we fall back to using spring.jackson.date-format. If this fails,
either because the format string is incompatible (unlikely) or because
the user's configured the fully-qualified name of a DateFormat class,
a warning is logged encouraging the use of
spring.jackson.joda-date-time-format.

Fixes gh-2225
10 years ago
Andy Wilkinson f11bcb9495 Register Module beans with Jackson2ObjectMapperBuilder
Prior to this commit, Module beans were registered with all
ObjectMapper beans, but were not registered with the auto-configured
Jackson2ObjectMapperBuilder. This meant that any ObjectMapper created
with the builder but not exposed as a bean would not have the Module
beans registered with it. One such ObjectMapper is the one used by the
auto-configured MappingJackson2XmlHttpMessageConverter. This caused
XML (de)serialization to be different to JSON (de)serialization.

This commit updates JacksonAutoConfiguration to register all of the
application context's Module beans with the auto-configured
Jackson2ObjectMapperBuilder. This ensures consistent configuration
of any ObjectMapper that's created using the builder, irrespective of
whether or not that ObjectMapper is also exposed as a bean, and
also ensures that (de)serialization of JSON and XML is consistent.

See gh-2327
10 years ago
Dave Syer 0899ffdadf Add realm name to 401 responses from basic auth
Since the BasicAuthenticationEntryPoint does its own
challenge when authentication fails, we need to add that
entry point in the SpringBootWebSecurityConfiguration
explicitly.

Fixes gh-2483
10 years ago
Stephane Nicoll 1035e5b029 Expose RepositoryRestMvcBootConfiguration
If an application defines a custom RepositoryRestMvcConfiguration, all
Spring Boot defaults are lots. While this sounds sensible, it can be
confusing as Spring Boot exposes properties (`spring.data.rest.*`) that
are no longer honored.

RepositoryRestMvcBootConfiguration is now public and can be used as an
extension point for those who need to customize the Spring Data REST
configuration and keep boot's specific defaults.

Fixes gh-2392
10 years ago
Andy Wilkinson 11b7fd832d Report non-matching outer class conditions
Update ConditionEvaluationReport so that, whenever a negative outcome
is added for a source, any existing outcomes for inner classes of that
source are updated with a non-matching outcome that indicates that the
outer configuration did not match.

Conditions are evaluated in two phases; PARSE_CONFIGURATION first and
REGISTER_BEAN second. If a parent class’s conditions match in
PARSE_CONFIGURATION then its inner classes will have their
PARSE_CONFIGURATION conditions evaluated. If they all match, the inner
class will be reported as a positive match in the auto-configuration
report even if the outer class does not match as a result of the
subsequent evaluation of a REGISTER_BEAN condition.

Fixes gh-2122
10 years ago
Phillip Webb 636898f9ad Polish 10 years ago
Andy Wilkinson 5922cfa41f Avoid use of SimpleNamingContextBuilder as it pollutes JVM’s JNDI config
Closes gh-2397
10 years ago
Andy Wilkinson 82d1e61ab1 Prevent attempt to export MBean for DataSource retreived from JNDI
Tomcat 8's default DataSource implemention is an MBean. Previously,
when such a DataSource was consumed from JNDI and an MBeanExporter had
been auto-configured an attempt would be made to export this MBean to
the MBean server. This would fail due to Tomcat having already
registered the MBean.

This commit updates JndiDataSourceAutoConfiguration to instruct the
MBeanExporter (if there is one) not to export a DataSource MBean
that's been retrieved from JNDI. The assumption is that any MBean in
JNDI will have already been registered with the MBean server by the
same infrastructure that registered it with JNDI.

Fixes gh-2397
10 years ago
Andy Wilkinson b4cb7a35c9 Document spring.http.converters.preferred-json-mapper
See gh-2247
10 years ago
Andy Wilkinson b39ecdf006 Rename preferred-mapper property so its clear it only applies to JSON
preferred-mapper has been renamed to preferred-json-mapper to make it
clear that it only affects the JSON mapper and that the XML mapper
that will be used (if any) is unaffected

See gh-2247
10 years ago
Andy Wilkinson 230048ae8b Prefer Jackson unless user explicity states preference for Gson
This commit rewords the changes made in d718a80 so that simply adding
Gson to the classpath isn't sufficient to stop Jackson being used
for HTTP JSON mapping. To use Gson, the user must now either remove
Jackson from the classpath (not an option if they also wish to use
the Actuator) or configure the spring.http.converters.preferred-mapper
property with a value gson.

Closes gh-2247
10 years ago
Andy Wilkinson aca47ab67e Allow FaviconConfiguration to be disabled
Setting spring.favicon.enabled to false will now disable the
/**/favicon.ico handler mapping.

Closes gh-2377
10 years ago
Andy Wilkinson d718a80316 Make it easier to use Gson and the Actuator at the same time
Previously the recommendation when a user wanted to use Gson was to
exclude Jackson from the classpath and add Gson. This worked fine until
the user also want to use the Actuator which requires Jackson. To get
over this hurdle the user could leave Jackson on the classpath and
perform their own HttpMessageConverter configuration and register a
GsonHttpMessageConverter instead of or before any Jackson-based
converter. A little complicated, but it worked.

This commit makes things easier by updating the auto-configuration for
HTTP message converters to prefer Gson when both Gson and Jackson are
on the classpath, i.e. in the presence of both, a
GsonHttpMessageConverter will be auto-configured and a
MappingJackson2HttpMessageConverter won’t be. This allows an
application to easily use Gson while allowing the Actuator to continue
to use Jackson.

Closes gh-2247
10 years ago
Phillip Webb 8e398dc6a7 Polish Javadoc
Update Javadoc to add missing @return and @param elements.
10 years ago
Phillip Webb 3d9cf06c31 Log OnBeanCondition.addDeducedBeanType errors
Update addDeducedBeanType.addDeducedBeanType to log any exceptions at
debug level.

Fixes gh-2436
10 years ago
Phillip Webb 0696695e16 Add package javadoc 10 years ago
Phillip Webb ccdbfd274f Fix Java 8 Javadoc compatibility
Update Javadocs to fix errors caused by Java 8 aggressive linting.

Fixes gh-2233
10 years ago
Phillip Webb 072f873f34 Polish 10 years ago
Phillip Webb 3328c1369f Merge branch '1.1.x'
Conflicts:
	spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java
10 years ago
Phillip Webb 555827cad7 Polish 10 years ago
Stephane Nicoll 763a735bd5 Merge branch '1.1.x'
Conflicts:
	spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointMBeanExportProperties.java
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java
10 years ago
Stephane Nicoll d64cc082db Harmonize property name
The property default format is lower case using hyphen. The JMX default
domain property has been harmonized to that format.

Fixes gh-2427
10 years ago
Andy Wilkinson 528a632fd1 Allow XA DataSource and ConnFactory pools to be configured via the env
This commit adds support for configuring the XA DataSource and
ConnectionFactory pools created by Atomikos and Bitronix via the
environment. The property prefixes vary depending on the transaction
manager that’s in use. They are:

Bitronix:
 - spring.jta.bitronix.datasource
 - spring.jta.bitronix.connectionfactory

Atomikos:
 - spring.jta.atomikos.datasource
 - spring.jta.atomikos.connectionfactory

The configuration processor has been updated to ignore
javax.jms.XAConnectionFactory and javax.sql.XADataSource as neither of
these types can be created via property binding.

Closes gh-2027
10 years ago
Andy Wilkinson b542aa3de6 Configure Hibernate with a WAS-specific JtaPlatform when running on WAS
At the time of writing WAS only supports JPA 2.0 which means that
Hibernate 4.2 is the latest version that can be used. SpringJtaPlatform
is Hibernate 4.3-specific as JtaPlatform’s package changed between
Hibernate 4.2 and 4.3. This means that SpringJtaPlatform can’t be used
on current versions of WAS. Futhermore, SpringJtaPlatform won’t work on
WAS even if we could use Hibernate 4.3 as WAS doesn’t make its
TransactionManager available to application code (it’s considered too
dangerous for general consumption) and SpringJtaPlatform
requires a TransactionManager.

This commit updates HibernateJpaAutoConfiguration to always treat WAS as
a special case and configure Hibernate with one of its WAS-specific
JtaPlatform implementations. 

Closes gh-2326
10 years ago
Andy Wilkinson 42e1a0b069 Add a test to verify customization of Hibernate's JtaPlatform
Closes gh-2348
10 years ago
Manuel Doninger c45604b825 Ensure that Hibernate's JtaPlatform can be customized
Previously, when JpaProperties was applying additional properties it
discarded any existing properties. This meant that custom
configuration of Hibernate's JtaPlatform was not detected and that
Boot's SpringJtaPlatform would always be configured instead.

This commit updates JpaProperties to include all of the existing
properties when it's asked to apply any additional properties.

See gh-2348
Closes gh-2359
10 years ago
Andy Wilkinson 966e8e557d Make use of Collections.addAll instead of a for-loop where appropriate
Closes gh-2309
10 years ago
Brian Clozel 6d60c23460 Disable Accept-Charset Header in String converter
This commit prevents the `Accept-Charset` from being written by the
StringHttpMessageConverter. This feature is enabled by default in the
framework and writes a *quite long* response header with all charsets
supported by the server.

Closes gh-2370, see gh-1800
10 years ago
Andy Wilkinson 69ea4beb8a Add auto-configuration for Jetty’s GzipFilter
Jetty’s GzipFilter is a container-agnostic Filter that can be used to
provide gzip and deflate encoding of HTTP responses. This commit adds
auto-configuration for GzipFilter that is enabled when
org.eclipse.jetty:jetty-servlets is on the classpath. The filter can
be configured using spring.http.gzip.*

See gh-2031
10 years ago
Andy Wilkinson ec17c00126 Add support for configuring Tomcat’s gzip support using the environment
Tomcat provide built-it support for gzip compression of HTTP responses.
This commit adds support for enabling and configuring this compression
via the environment using server.tomcat.compression and
server.tomcat.compressableMimeTypes.

See gh-2031
10 years ago
Phillip Webb 735b6277c2 Relax WebSocket auto-configuration conditions
Update WebSocketAutoConfiguration so that spring-websocket is no longer
required for WebSocket support.

See gh-2341
10 years ago
Andy Wilkinson 01444a03ab Merge branch '1.1.x' 10 years ago
Andy Wilkinson b875a00ebd Tighten up conditions: a web application may not be using Spring MVC
Previously, some classes that were annotatated with
@ConditionalOnWebApplication assumed that, if the application was a
web application, Spring MVC (spring-webmvc) would be on the classpath.
If it was not, the application would fail to start, typically with an
error relating to WebMvcConfigurerAdapter being unavailable.

This commit updates the affected configuration classes and annotates
them with @ConditionalOnClass(WebMvcConfigurerAdapter.class) to
ensure that their auto-configuration only takes effect if its a web
application and Spring MVC is on the classpath.

Fixes gh-2345
10 years ago
Dave Syer 5e0cc71862 Add convenient logging.properties for testing 10 years ago
Phillip Webb 3fc1e44302 Polish Mustache code 10 years ago
Dave Syer 2729c747ca Add jmustache support
The package names changed a bit from the prototype project, but wuth vanilla
autconfiguration usage that shouldn't matter. Follows closely the Groovy
templates support. Templates live in classpath:/templates/*.html by default.

Fixes gh-2242
10 years ago
Spring Buildmaster 60725cd8bd Next development version 10 years ago
Phillip Webb 4c6907d5d8 Remove superfluous `\n` when logging password
The last trailing `\n` is not required as the logging system will add
it.

See gh-2146
10 years ago
Phillip Webb 1f775793ee Use Collections.addAll(...) instead of for loops
Replace various for loops which add items to collections with calls
to Collections.addAll(...).

Fixes gh-2277
10 years ago
Phillip Webb 6333d4c617 Merge branch '1.1.x'
Conflicts:
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.java
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/ParentAwareNamingStrategy.java
	spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java
10 years ago
Phillip Webb 7e771bb655 Fix ParentAwareNamingStrategy and JMX auto-config
Fix ParentAwareNamingStrategy to set ObjectName properties for the
'identity' and 'context' attributes. Also update JmxAutoConfiguration
to ensure that the ParentAwareNamingStrategy is created in each context
and that the `mbeanExporter` bean is created. Prior to this commit the
nested @EnableMBeanExport class always meant that the mbeanExporter
condition never matched.

Fixes gh-2243
10 years ago
Phillip Webb 4616be9e91 Merge branch '1.1.x'
Conflicts:
	spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfigurationTests.java
10 years ago
Phillip Webb c46478f97d Guard for multiple ContentNegotiatingViewResolvers
Update WebMvcAutoConfiguration to ensure than the viewResolver bean
is not created if a user defined ContentNegotiatingViewResolver bean
is defined.

Fixes gh-2269
10 years ago
Dave Syer f4e12e96c6 Additional condition to protect Reactor 2.0 users
(cherry picked from 80d55c47)
Closes gh-2255
10 years ago
Phillip Webb 0735d6e259 Fix TemplateLocation.anyExists logic
Fix broken logic in TemplateLocation.anyExists caused by not using the
local `searchPath` variable.

See gh-2184
Closes gh-2248
10 years ago
Phillip Webb d7a12a8791 Remove superfluous semi-colons 10 years ago
Phillip Webb 0702b4e7e3 Merge branch '1.1.x'
Conflicts:
	spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
10 years ago
Phillip Webb 96d479c3d9 Make RequestMappingHandlerMapping @Primary
Update WebMvcAutoConfiguration so that the RequestMappingHandlerMapping
bean is @Primary. Prior to this commit a NoUniqueBeanDefinitionException
would be thrown then using the MvcUriComponentsBuilder.

Fixes gh-2237
10 years ago
Phillip Webb b42c7fca64 Polish 10 years ago
Phillip Webb 291a8d422b Fix incorrect BitronixJtaConfiguration bean name
Fixes gh-2231
10 years ago
Phillip Webb 8628adcb74 Order EmbeddedServletContainerCustomizers
Add Ordered interface to all EmbeddedServletContainerCustomizers with
a value of 0. Prior to this commit it was difficult for a user to
define a customizer that would be applied before ours, even if they
implemented Ordered or added @Order annotations.

Fixes gh-2123
10 years ago
Phillip Webb ef621c9271 Protect against NoClassDefFoundError on WAS
Update HibernateJpaAutoConfiguration to catch NoClassDefFoundError when
setting the JTA_PLATFORM. The exception can occur when running on WAS
since it ships with Hibernate 4.2 and SpringJtaPlatform extends from
AbstractJtaPlatform which is not present.

The exception is now ignored if a JDNI environment is available,
otherwise it is re-thrown.

Fixes gh-2218
10 years ago
Phillip Webb fd97c7553c Apply HATEOAS module to primary ObjectMapper
Update HypermediaAutoConfiguration to apply the Jackson2HalModule to
the primary ObjectMapper. This restores the behavior of Spring Boot
1.1 where HATEOAS types could be serialized for both `application/json`
and `application/json+hal` content types.

A `spring.hateoas.apply-to-primary-object-mapper` property has also been
provided to opt-out if necessary.

Fixes gh-2147
10 years ago
Andy Wilkinson e57b0e00f2 Use ServletContainerInitializers to start servers
The Servlet spec prohibits ServletContextListeners from being registered
programatically other than from with a call to
`ServletContainerInitializer.onStartup`. This restriction is not
consistently enforced by the various embedded servlet containers that
Boot supports:

- Jetty 8 does not enforce the restriction.
- Jetty 9 enforces the restriction. We were working around it be calling
  setExendedListenerTypes(true) on the context.
- Tomcat somewhat enforces the restriction: it doesn't allow a
  ServletContextListener to be added once the first
  ServletContextListener has been called. We were using a
  LifecycleListener to drive the ServletContextListeners.
- Undertow enforces the restriction and we were not working around it.
  This resulted in gh-2192 being raised.

ServletListenerRegistrationBean is a ServletContextListener and is used
to register listeners, including ServletContextListeners, with the
servlet context. To adhere to the letter of the servlet spec this means
that ServletListenerRegistrationBeans need to be called from with
ServletContainerInitializer.onStartup. This commit updates all of the
embedded servlet container implementations to use a
ServletContainerInitializer to drive any ServletContextInitializers.

This makes the lifecycle more consistent across the supported containers
and allows ServletListenerRegistrationBeans to be able to register
ServletContextListeners on all supported embedded containers.

Fixes gh-2192
10 years ago
Phillip Webb 82bf60400a Fix OnPropertyCondition no havingValue message
See gh-2193
10 years ago
Phillip Webb 1da918f388 Fix TypeNotPresentExceptionProxy error with Mongo
Update MongoAutoConfiguration so that a TypeNotPresentExceptionProxy
error is not thrown when Spring Data Mongo is not used.

Fixes gh-2196
10 years ago
Phillip Webb bfa984ccd5 Fix PersistenceExceptionTranslation INFO message
Update PersistenceExceptionTranslationAutoConfiguration so that the
PersistenceExceptionTranslation @Bean method is static.

Fixes gh-2210
10 years ago
Phillip Webb 8d12130a2b Add `exclude` attribute to @SpringBootApplication
Fixes gh-2207
10 years ago
Stephane Nicoll 9a55cc49b5 Fix typo 10 years ago
Phillip Webb 0f3b959686 Scan full classpath with /templates checks
Update template auto configurations to search for template folders in
the entire classpath rather than just the root jar.

Fixes gh-2184
10 years ago
Phillip Webb 7e7acea548 Don't check for /templates when using groovy-all
Update GroovyTemplateAutoConfiguration so that the `/template`
folder check only occurs when the groovy-all jar is not being
used.

Fixes gh-2190
See gh-1915
10 years ago
Michael Cramer 3b858edfa9 Auto-configure for Thymeleaf conditionalcomments
Add auto-configuration for thymeleaf-extras-conditionalcomments which
allows parsing of conditional comments for IE.

Example:

	<!--[if lt IE 8]>
		<link rel="stylesheet" th:href="@{/styleIE.css}"
		type="text/css"/>
	<![endif]-->

Without this dialect all Thymeleaf attributes are ignored inside the
comment.

Fixes gh-2113
10 years ago
izeye 3784959b6f Rename SecurityPrequisite -> SecurityPrerequisite
Closes gh-2179
10 years ago
Dave Syer 80d55c4720 Additional condition to protect Reactor 2.0 users 10 years ago
Phillip Webb 917723a883 Automatically alias MultipartResolver beans
Update DispatcherServletAutoConfiguration to alias a MultipartResolver
that is not named correctly. This allows the DispatcherServlet to pick
up any MultipartResolver bean, regardless of its name.

See gh-2162
10 years ago
Phillip Webb 4293b7b797 Ensure CharacterEncodingFilter is ordered highest
Update HttpEncodingAutoConfiguration to ensure that the
CharacterEncodingFilter is ordered above any HiddenHttpMethodFilter.

Fixes gh-2148
10 years ago
Spring Buildmaster 63e6a25097 Next development version 10 years ago
Spring Buildmaster 1a788c1741 Next development version 10 years ago
Phillip Webb c678c1f788 Polish 10 years ago
Oliver Gierke 034ce0ad89 Setup MongoMappingContext setInitialEntitySet
Update MongoDataAutoConfiguration to set the MongoMappingContext
initialEntitySet by scanning for @Document or @Persistent classes
from AutoConfigurationPackages.

Fixes gh-2107
10 years ago
Dave Syer 8a5f151e47 Add spring.*.enabled for MVC view resolvers
Since we use a composite ViewResolver glbally by default it can be
awkward to switch off the view technology that you have on the classpath
but aren't actually using.
10 years ago
Phillip Webb 9c66624deb Polish 10 years ago
Phillip Webb 2f03351cf6 Fix auto-configuration order for Spring Data Rest
Update Rest, Hypermedia and HttpMessageConverter auto-configuration to
ensure beans are created in the correct order.

Prior to this commit the MappingJackson2HttpMessageConverter bean would
not be created because Spring Data Rest's TypeConstrained versions had
already been registered.

Fixes gh-1729
10 years ago
Sebastien Deleuze 27d9d7fd55 Add support for autowired Jackson handlers
Inject the ApplicationContext into Jackson2ObjectMapperBuilder to allow
Jackson handlers to be autowired. See SPR-10768.

Fixes gh-2081
10 years ago
Phillip Webb 7ae75c2707 Merge branch '1.1.x' 10 years ago
Phillip Webb fcad7c4fde Guard for null BeanFactory in @ConditionalOnBean
See gh-2080
10 years ago
Phillip Webb 1f66277fd6 Fix JmsProperties bean not found exception
Update JndiConnectionFactoryAutoConfiguration to ensure that the
JmsProperties bean is created. Prior to this commit deployment to
a WildFly would fail with a NoSuchBeanDefinitionException.

Fixes gh-2072
10 years ago
Phillip Webb 778aa39016 Add Undertow WebSocket auto-configuration
Fixes gh-2028
10 years ago
Phillip Webb 211f20b9c6 Add setIgnoreDefaultModelOnRedirect support
Add a `spring.mvc.set-ignore-default-model-on-redirect` property to
allow RequestMappingHandlerAdapter.setIgnoreDefaultModelOnRedirect to
be easily customized and change the default value to 'true'.

Fixes gh-2018
10 years ago
Phillip Webb 447c9ff204 Polish 10 years ago
Maciej Walkowiak c74e56d185 Apply pubSubDomain property to ContainerFactory
Previously, tuning the pubSubDomain flag only impacted the created
JmsTemplate leaving any default listeners with the default settings.

If no default JmsListenerContainerFactory is defined, the created
one is using that property as well now.
10 years ago
Andy Wilkinson f9b5c6b1ae Merge branch '1.1.x' 10 years ago
Andy Wilkinson 3b78aa9493 Make Security auto-config conditional on spring-security-config
SecurityAutoConfiguration, via its import of
AuthenticationManagerConfiguration, requires spring-security-config
to be on the classpath as AuthenticationManagerConfiguration extends
GlobalAuthenticationConfigurerAdapter from spring-security-config.

This commit makes SecurityAutoConfiguration conditional on the
presence of GlobalAuthenticationConfigurerAdapter so that the
auto-configuration will be disabled in its absence rather than causing
an app to fail to start.

Closes gh-2046
10 years ago
Andy Wilkinson 064f88a9fb Use a free port, rather than 8080, in WebSocketAutoConfigurationTests
Closes gh-2043
10 years ago
Phillip Webb 09dac5ff00 Apply formatting and cleanup rules 10 years ago
Phillip Webb 48db5457f1 Polish 10 years ago
Dave Syer 911d39f937 Ensure authentication events get published
When the user provides their own AuthenticationManager we do a lazy
initialization and didn't (till now) inject the AuthenticationEventPublisher

Fixes gh-2033
10 years ago
Stephane Nicoll 1a5916665c Remove unused RabbitMQ dynamic property flag
Fixes gh-1999
10 years ago
Stephane Nicoll 65e9d6a6e0 Add property description
Set the field javadoc of many properties that are managed via
configuration so that the "description" field is available in the
meta-data.

Closes gh-1808
10 years ago
Andy Wilkinson 40a7445fec Merge branch '1.1.x' 10 years ago
Andy Wilkinson 64599261a5 Allow mongo port, host, and credentials to be configured individually
Previously, the host had to have a custom value for the configuration
of the port or credentials (username and password) to take effect. This
meant, for example, that you couldn’t just set the port or just set the
username and password while using the default host.

This commit allows the port or username and password to be configured
without also configuring the host. The default host (localhost) and
port (27017) are retained.

Fixes gh-2008
10 years ago
Oliver Gierke 123b90fa64 Register all packages where @EnableAutoConfiguration is used
Previously, when @EnableAutoConfiguration was used in multiple packages,
the last @EnableAutoConfiguration that was processed would
win and only its package would be stored as an auto-configuration
package.

This commit updates AutoConfigurationPackages to allow multiple package
name registrations. AutoConfigurationPackages.set(…) has been altered to
augment the constructor arguments of the BeanDefinition registered for
the initial call to the method so that the packages handed to the method
call will be added to the bean definition and not replace the previous
ones. The method has been renamed register(…) to reflect the changed
behavior.

Closes gh-1994
10 years ago
Andy Wilkinson d5b7f49f83 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 9270303a9a Remove double “and” from DataSourceInitializer’s javadoc 10 years ago
Andy Wilkinson d5ad502d31 Disable Undertow auto-config if required XNIO classes are unavailable
Fixes gh-1986
10 years ago
Dave Syer 9f7bd0cddc Inject ResourceConfig instance (not class) into Jersey
If you inject the class (via a servlet parameter) it seems that
Jersey tries to create all the beans for you (and fails). I thought
it was supposed to work (according to the docs), so I'm a bit confused
but the sample now has Spring DI and the tests pass.

Fixes gh-1981
10 years ago
Phillip Webb 2a9a749329 Polish 10 years ago
Dave Syer 5b044356dc Clarify the deprecation status of HttpMapperProperties 10 years ago
Phillip Webb 70a1438c6f Don't replace MappingJackson2HttpMessageConverter
Guard against Spring Data REST TypeConstrained Jackson converters
replacing the default MappingJackson2HttpMessageConverter.

Fixes gh-1968
10 years ago
Phillip Webb bf0629522c Only use Gson if Jackson is missing
Update HttpMessageConvertersAutoConfiguration to only register Gson
support when Jackson is not on the classpath.

Fixes gh-1967
10 years ago
Phillip Webb 2b57c5a4dd Rename spring.data.mongo.repositories.enabled
Rename mongo to mongodb.

Fixes gh-1966
10 years ago
Phillip Webb 670ba33bec Improve MongoDataAutoConfiguration
Update MongoDataAutoConfiguration to provide easier configuration of
CustomConversions, the MappingMongoConverter, MongoMappingContext
and an authentication database.

Fixes gh-1619
Fixes gh-1730
10 years ago
Phillip Webb 2a8579026f Polish 10 years ago
Stephane Nicoll 11894a5412 Fix manual metadata format inconsistency
Fixes gh-1961
10 years ago
Dave Syer 12a7df6c40 Be defensive about classloader in MessageSourceAutoConfiguration
Fixes gh-1960
10 years ago
juzer 428d2caac1 Fixed potential ClassCastException getting error
Update DefaultErrorAttributes to expect a `Throwable` ERROR_ATTRIBUTE
rather than an `Exception`.

Fixes gh-1931
10 years ago
Phillip Webb c34cfb27a3 Polish 10 years ago
Phillip Webb 3a4d62fb3a Gracefully ignore placeholder exceptions
Update BeanTypeRegistry to gracefully ignore LoadBeanClassException and
BeanDefinitionStoreException exceptions in the same way as
DefaultListableBeanFactory.doGetBeanNamesForType() does.

Fixes gh-1955
10 years ago
Dave Syer 7fa0ea7c3b Add support for spring.jersey.type=filter
Fixes gh-1756
10 years ago
Dave Syer 3a4f1f6f39 Attempt to get Jersey working as filter 10 years ago
Andy Wilkinson 90af8bf54a Add auto-configuration for Jetty 9's WebSocket support
Closes gh-1269
10 years ago
Phillip Webb b583262211 Use SmartInitializingSingleton when possible
Switch implementations of ApplicationListener<ContextRefreshEvent> for
SmartInitializingSingleton when possible.

Fixes gh-1939
10 years ago
Andy Wilkinson 7a783f5a18 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 863c099161 Add missing copyright headers 10 years ago
Andy Wilkinson 1864d79077 Polish Undertow contribution
Closes gh-1779
10 years ago
sopov.ivan c501b889af Add support for using Undertow as an embedded container
See gh-1779
10 years ago
Andy Wilkinson f43d6925c5 Apply spring.jackson.* config to HypermediaAutoConfiguration’s ObjectMapper
Previously, HypermediaAutoConfiguration would trigger the creation of
an ObjectMapper bean named _halObjectMapper. This bean did not have the
spring.jackson.* configuration applied to it, however its presence
would revent JacksonAutoConfiguration from creating its
ObjectMapper. This left the user with an ObjectMapper that did not
honour the spring.jackson.* configuration.

This commit updates HypermediaAutoConfiguration to use the
Jackson2ObjectMapperBuilder that may have been created by
JacksonAutoConfiguration. If the builder exists it is used to configure
the _halObjectMapper bean.

Fixes gh-1949
10 years ago
Andy Wilkinson 35b7ba5cda Deprecate http.mappers.* properties
The http.mappers.* configuration properties assumed that the mapping
was JSON (on of the property names was jsonPrettyPrint) and also only
exposed a small subset of the configuration options supported by
Jackson (and GSON). The property names implied that it would configure
all HTTP mapping, however it was ignored by GsonAutoConfiguration.

This commit deprecates the support for http.mappers.* in favour of
configuring Jackson or Gson instead. Jackson can be configured
declaratively using the spring.jackson.* properties or programtically.
Gson can be configured programatically by using a GsonBuilder to
create a Gson instance with the desired configuration.
gh-1946 has been opened to add support for declarative configuration
of Gson.

Closes gh-1945
10 years ago
Andy Wilkinson 6cfd6cad64 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 9eae29938c Test that http.mappers props are applied by JacksonAutoConfiguration
Closes gh-1919
10 years ago
Nicolás J. García f51b304c2a Update JackonAutoConfiguration to apply all http.mappers properties
Previously, only the http.mappers.json-sort-keys property was applied
by JacksonAutoConfiguration. This commit updates it to also apply the
http.mappers.json-pretty-print property as well.

See #1919
10 years ago
Andy Wilkinson b8d6b34038 Test that HttpMapper properties are only used when they’re defined
Closes gh-1923
10 years ago
Sebastien Deleuze c053540b03 Use HttpMapper properties only if defined
See gh-1923
10 years ago
Andy Wilkinson 05cf686713 Allow servlet context parmeters to be configured via declaratively
Previously, configuration of a ServletContext init parameter required
the use of a ServletContextInitializer bean. This commmit adds
support for declarative configuration via the environment using
server.context_parameters.<name>=<value>.

Closes gh-1791
10 years ago
Stephane Nicoll 16e2130896 Add missing properties metadata
Fixes gh-1829
10 years ago
Stephane Nicoll fba69821cc Fix typo 10 years ago
Spring Buildmaster 46b7738334 Next development version 10 years ago
Stephane Nicoll 630c145645 Fix order of JMS auto configuration
Add additional @AutoConfigureAfter elements to ActiveMQAutoConfiguration
and HornetQAutoConfiguration to ensure that they are configured after
JndiConnectionFactoryAutoConfiguration.

The possible sources for a JMS ConnectionFactory are:

1. JNDI
2. HornetQ (embedded broker or an external broker)
3. ActiveMQ (embedded broker or an external broker)

The last two auto configurations must run after JTA auto-configuration
has completed as it may register additional beans that are necessary to
enable XA.

Previously, the HornetQ embedded broker would start regardless of the
presence of a ConnectionFactory as a ConditionalOnMissingBean was
missing. Furthermore, there was no order condition for the JNDI
auto-configuration so it may just run after one of the broker has been
found.

JNDI takes now precedence to be consistent with the regular DataSource
auto configuration.

Fixes gh-1821
10 years ago
Phillip Webb 8cac63e239 Drop hibernate-jpa-2.0-api managed dependency
Fixes gh-1898
10 years ago
Phillip Webb b947d6001d Polish 10 years ago
Andy Wilkinson f9221e24ef Polish method name in HibernateJpaAutoConfiguration 10 years ago
Stephane Nicoll 109c3a3439 Auto configure CharacterEncodingFilter
Provide a default UTF-8 encoding for HTTP requests and responses unless
specified otherwise.

Fixes gh-1182
10 years ago
Phillip Webb 143a62b6bf Polish 10 years ago
Phillip Webb 3e1841a53b Remove JpaBaseConfiguration.configure() method
Remove the JpaBaseConfiguration.configure() method since it is no
longer called.

Fixes gh-1865
10 years ago
Phillip Webb 5811f6e3f5 Merge branch '1.1.x' 10 years ago
Phillip Webb 4f67a20214 Ensure JpaUserDetailsTests closes embedded DB
Fixes gh-1712
10 years ago
Phillip Webb b79934a7a4 Detect existing MultipartResolver beans
Update MultipartAutoConfiguration to detect any MultipartResolver beans
rather than just StandardServletMultipartResolvers.

Fixes gh-1857
10 years ago
Phillip Webb 8023ddd0c2 Rename AbstractBasicTemplateViewResolverProperties
Rename AbstractBasicTemplateViewResolverProperties to
AbstractViewResolverProperties.

See gh-1835
10 years ago
Stephane Nicoll 6d9abdc8ca Harmonize view resolver properties
Move shared properties to avoid duplication in GroovyProperties

Fixes gh-1835
10 years ago
Phillip Webb e76a571dd3 Add @SpringBootApplication annotation
Add a new @SpringBootApplication which is equivalent to @Configuration,
@EnableAutoConfiguration and @ComponentScan.

See gh-1842
10 years ago
Phillip Webb 96a031cf20 Default spring.datasource.jmx-enabled to false
Change the default value of spring.datasource.jmx-enabled to false
to prevent InstanceAlreadyExistsException problems when using the
Spring Test Framework.

Fixes gh-1590
10 years ago
Phillip Webb 58d660d10d Allow DAO ExceptionTranslator to proxy classes
Update the auto-configured PersistenceExceptionTranslationPostProcessor
to proxy target classes as well as interfaces. Also provide a config
property to disable registration all together.

Fixes gh-1844
10 years ago
Michael Cramer f966b3b1b7 Provide Liquibase -> Commons Logging adapter
Add `CommonsLoggingLiquibaseLogger` implementation to adapt Liquibase's
`Logger` to Apache Commons Logging.

The `LiquibaseAutoConfiguration` class has also been updated to
automatically use the adapter

Fixes gh-1840
10 years ago
Phillip Webb ba0dd60de9 Rename charSet to charset
Rename AbstractTemplateViewResolverProperties.setCharSet/getCharSet to
setCharset/getCharset, deprecating the old method.

Fixes gh-1835
10 years ago
Phillip Webb b6bacd5e8a Upgrade to Servlet 3.1, Tomcat 8 and Jetty 9
Upgrade to latest versions of Tomcat and Jetty and to the latest Servlet
API whilst will remaining compatible with Tomcat 7 and Jetty 8.

Fixes gh-1832, gh-369
10 years ago
Phillip Webb edaed415fb Polish 10 years ago
Stephane Nicoll 9dec27e7bf Permit to disable JTA using a single property
Disable JTA auto-configuration altogether with a simple property. This
can be useful if the environment is JTA capable but the application does
not require it.

Fixes gh-1457
10 years ago
Stephane Nicoll 814803046a polishing 10 years ago
Stephane Nicoll 47cd9e0765 Fix ConditionalOnJndi evaluation
Enable ConditionalOnJndi evaluation and add tests that validate it works
as expected

Fixes gh-1820
10 years ago
Stephane Nicoll cbd3c39640 Override StringHttpMessageConverter with UTF-8
Override the default StringHttpMessageConverter provided by the standard
Spring MVC configuration so that is uses UTF-8 instead of the aging
default of the servlet spec (that is ISO-8859-1)

Fixes gh-1800
10 years ago
Phillip Webb 43c07e8b44 Protect against duplicate datasource MBeans
See gh-1590
10 years ago
Phillip Webb a973fd41f4 Polish 10 years ago
Dave Syer f304d46955 Add JMX MBean for Tomcat DataSource
If the DataSource is a Tomcat one we force it to register an MBean
if spring.jmx.enabled=true

Fixes gh-1590
10 years ago
Dave Syer 3e97cdbc3b Trim some fat from groovy templates
The old resolver class is deprecated already, and there's no reason
to continue to support the View and View resolver implementations
from Boot 1.1, so I removed those. Also there is no need to support
older versions of Groovy, so I removed a config class that was
conditional on a groovy version (by looking for the markup support).

Fixes gh-1578
10 years ago
Brian Clozel 18b8929335 Migrate to groovy templates from Spring 4.1
Update `GroovyTemplateAutoConfiguration` to use Spring 4.1 Groovy
Markup Template infrastructure instead of Boot's.

Fixes gh-1552
10 years ago
Stephane Nicoll a46396f691 Add @NestedConfigurationProperty meta-data support
Add a @NestedConfigurationProperty annotation which can be used to
customize how configuration mete-data is generated.

Prior to this commit only inner-classes where considered nested
(see Tomcat in ServerProperties). Using this new annotation, the Ssl
property in ServerProperties can be detected as well.

See gh-1001
10 years ago
Stephane Nicoll fbf8f56a97 Generate standard configuration meta-data
Update the `spring-boot`, `spring-boot-autoconfigure` and
`spring-boot-actuator` project to generate configuration meta-data
files during compilation.

See gh-1001
10 years ago