Commit Graph

2075 Commits (60505a4fae9da5fc59bb2774dd8f9e1d13b3b387)

Author SHA1 Message Date
Stéphane Lagraulet 1aa8f49001 Add a secured connection factory for Hornetq.
See gh-6071
9 years ago
Stephane Nicoll d54474b81c Allow locale to be overridden by "Accept-Language"
Previously, when `spring.mvc.locale` was specified, that locale was used
regardless of the client's preferences. This commit adds an extra
`spring.mvc.locale-resolver` property that can control how the locale is
resolved. The default is `ACCEPT_HEADER` but can be set to `FIXED` to
restore the previous behaviour.

Closes gh-6083
9 years ago
Dave Syer a3b29b0e42 Add /webjars/** to default list of unsecured resources
Fixes gh-2460
9 years ago
Dave Syer 6b6f4e2263 Fix JSON syntax
(according to Eclipse it was broken)
9 years ago
Stephane Nicoll 7afe1d16a6 Add Jest support
This commit adds auto-configuration support for Jest, an HTTP client for
Elasticsearch. If Jest is present, a `JestClient` targeting a local
elasticsearch instance is auto-configured. Several properties from the
`spring.jest.*` namespace allows to tune the client.

Closes gh-6032
9 years ago
Phillip Webb e27bc9ddea Merge branch '1.3.x' 9 years ago
Phillip Webb ed6f11d60d Polish 9 years ago
Brian Clozel 6dc0ecb182 Add WebMvcRegistrations for custom MVC components
Add `WebMvcRegistrations` which can be used to provide custom
instances of `RequestMappingHandlerMapping`,
`RequestMappingHandlerAdapter` and `ExceptionHandlerExceptionResolver`.
Those instances are then used and processed by the Boot MVC
configuration.

Prior to this commit, developers could provide their custom instances
of MVC infrstructure components such as `RequestMappingHandlerMapping`
and `RequestMappingHandlerAdapter` only by using advanced configuration
strategies. Those advanced configurations involved subclassing
`WebMvcConfigurationSupport` which effectively turns off MVC
auto-configuration in Boot.

Fixes gh-5004
Closes gh-6100
9 years ago
Phillip Webb 99c6194e17 Don't use MockitoJUnitRunner
Replace `@RunWith(MockitoJUnitRunner.class)` with direct Mockito
initialization since the running doesn't support parallel test
execution.
9 years ago
Stephane Nicoll 8ea5524d6a Polish 9 years ago
Stephane Nicoll 72e4064230 Merge branch '1.3.x' 9 years ago
Vedran Pavic 6dde498b87 Update DataSourceBuilder aliases
This commit adds a `user` alias for the `username` property which permits
the use of `OracleDataSource`.

Closes gh-6124, gh-6027, gh-6125
9 years ago
Brian Clozel 091664078f Split up DispatcherServletConfiguration condition
Prior to this commit, defining a custom `DispatcherServlet` and/or a
`ServletRegistrationBean` with the default name would turn off
completely the `DispatcherServletAutoConfiguration`.

This commit splits this auto-configuration in two parts:

- First, a `DispatcherServlet` is automatically registered if no
instance is already defined with the default name.
- Then, a `ServletRegistrationBean` is registered is registered if a
`DispatcherServlet` instance exists with the default name *and* no
`ServletRegistrationBean` exists with the default name

This allows developers to register manually a `ServletRegistrationBean`
or a `DispatcherServlet` without having to redefine the whole
auto-configuration.

Fixes gh-4893
Closes gh-6108
9 years ago
Phillip Webb 0fa4d2e260 Make SocialAutoConfigurerAdapter/Properties public
Fixes gh-6078
9 years ago
Johnny Lim 5de9516255 Fix typos
Closes gh-6114
9 years ago
Phillip Webb b38231021d Provide web client Auto-configuration
Add auto-configuration for use with typical web clients. Currently
client auto-configuration consists of a RestTemplateBuilder
pre-configured with HttpMessageConverters.

Closes gh-5507
9 years ago
Phillip Webb bc6f1cfdf3 Polish 9 years ago
Andy Wilkinson 73b01cff4f Use spring.factories to declare each test slice's auto-config imports
Closes gh-6001
9 years ago
Andy Wilkinson 8c9c649805 Fix MongoPropertiesTests following upgrade to Mongo 3.2 (6f5bd2e)
See gh-3011
9 years ago
Johnny Lim 70adefc87b Polish
Closes gh-6046
9 years ago
Andy Wilkinson 6f5bd2e13a Upgrade to MongoDB 3
This commit upgrades to MongoDB 3. Dependency management has been added
for the new and preferred mongodb-driver artifact. The starter has
been updated to use this new artifact rather than monogo-java-driver.
Dependency management for mongo-java-driver has been retained to avoid
causing problems for people who have declared the dependency explicitly.
The auto-configuration for Embedded Mongo has also been updated to
use 3.2.2 by default.

Closes gh-3011
9 years ago
Phillip Webb ccdcad757a Allow template lookup caching to be disabled
Extract TemplateAvailabilityProvider caching logic to a new
TemplateAvailabilityProviders class and provide property support to
disable it. Also update DevToolsPropertyDefaultsPostProcessor to
automatically set the property.

Fixes gh-5989
9 years ago
Stephane Nicoll c3201a1e91 Revert "Cache resolved error template view names"
See gh-5989
9 years ago
Stephane Nicoll dcf3a56bd5 Polish 9 years ago
Stephane Nicoll 3805fc7455 Polish 9 years ago
Phillip Webb f3e630933a Add OAuth PrincipalExtractor strategy interface
Update `UserInfoTokenServices` to use a PrincipalExtractor interface
to extract the principal.

Fixes gh-5186
9 years ago
Phillip Webb 7f45485e61 Provide explicit force request/response properties
Update HttpEncodingProperties to offer explicit `force-request` and
`force-reponse` properties in additional to the existing `force`
property.

Closes gh-5459
9 years ago
Phillip Webb bcfa2e6676 Make TestRestTemplate not extend RestTemplate
Update TestRestTemplate so that it no longer directly extends
RestTemplate. Prior to this commit it was possible that TestRestTemplate
could interfere with user defined RestTemplate beans.

TestRestTemplate offers the same methods as RestTemplate so should be
a drop-in replacement. If access is needed to the actual underlying
template the `getRestTemplate()` method should be used.

Fixes gh-5915
9 years ago
Phillip Webb 00fbb5c3d9 Polish 9 years ago
Dave Syer 46134b58b8 Fix stupid checkstyle violations 9 years ago
Dave Syer 684c8c81a3 Extract user info rest template into a factory
Instead of using a @Bean, it is better to use an opaque factory
for an internal dependency that users are not going to want in
the context. OAuth2RestTemplate is a common enough bean type that
creating on in autoconfig makes it hard for users to add their own
for business use.

See gh-5967
9 years ago
Phillip Webb c15c146021 Cache resolved error template view names
Fixes gh-5933
9 years ago
Phillip Webb 6cdbdf9ad3 Polish 9 years ago
Stephane Nicoll 00f9adafd7 Stop creating a primary `Oauth2RestTemplate`
This commit removes the creation of a `@Primary` `OAuth2RestTemplate`
and updates the documentation accordingly.

Once #5507 is implemented we could revisit this area to provide a way for
users to easily create such a bean.

Closes gh-5202
9 years ago
Andy Wilkinson c11b28c3c7 Align default for OPTIONS request dispatching with Spring Framework 4.3
Closes gh-5965
9 years ago
Stephane Nicoll 2b006aacb3 Validate Spring Session has been configured
This commit validates that a `SessionRepository` has been configured if
Spring Boot is meant to auto-configure one.

Closes gh-5943
9 years ago
Stephane Nicoll 5deca28a9d Improve upgrade path for Spring Session
Commit b7e7bcf made `spring.session.store-type` explicit which means that
users of Spring Session in 1.3 have to set that property to restore the
auto-configuration support in 1.4.

This commit implicitly set the store type to redis if redis is present
and log a warning inviting the user to actually specify that in
configuration.

The entry in the auto-configuration report also mentions that such
arrangement is deprecated.

Closes gh-5838
9 years ago
Johnny Lim 7a62b7d066 Polish
Closes gh-5936
9 years ago
Kazuki Shimizu a4d9ba165f Set default paths for fixed static version
Closes gh-5878
9 years ago
Andy Wilkinson 500edeacc4 Ensure that static error pages have a Content-Type header
The getContentType() accessor method on View appears to only be used
for content negotiation. For the Content-Type header to be included in
the response the view needs to set it explicitly when render is called.

Closes gh-5918
9 years ago
Andy Wilkinson 5c0d400c23 Align Hibernate 5 join table names with those from SpringNamingStrategy
Previously, the name of a join table when using Hibernate 5 would
differ from those when using Hibernate 4 with the default
SpringNamingStrategy.

This commit introduces SpringImplicitNamingStrategy which customises the
name of join tables to match those produced by SpringNamingStrategy.

Closes gh-5880
9 years ago
Phillip Webb cf6212b955 Polish 9 years ago
Phillip Webb 6575ca6ff8 Merge branch 1.3.x 9 years ago
Phillip Webb 7fb545d26c Polish 9 years ago
Andy Wilkinson 0c2ecb7ba0 Apply standard Jackson2ObjectMapperBuilder config via a customizer
This commit builds on the new abstraction introduced in 2a0b8a7 by
applying the standard JacksonProperties-based
Jackson2ObjectMapperBuilder configuration via a customizer.

It also applies some polishing to the original contribution:

 - Code has been formatted
 - Logic that applies the customizers has moved to be alongside the code
   that creates the builder
 - Logic that explicitly sorted the customisers has been removed as
   they will be sorted automatically prior to injection
9 years ago
dziesio deb7529a36 Make it easier to customize auto-configured Jackson2ObjectMapperBuilder
Previously, it was difficult to customize the auto-configured
Jackson2ObjectMapperBuilder. Typically, use of a bean post processor
was required.

This commit introduces Jackson2ObjectMapperBuilderCustomizer. Beans
that implement this interfaces are called during creation of the
auto-configured Jackson2ObjectMapperBuilder, providing an opportunity
to customize its configuration.

Closes gh-5803
9 years ago
Andy Wilkinson 64e668d584 Use AssertJ in JooqExceptionTranslatorTests 9 years ago
Andy Wilkinson 12215533a5 Merge branch '1.3.x' 9 years ago
Andy Wilkinson 1ab835a0f7 Add tests for JooqExceptionTranslator
See gh-5884
9 years ago
tfeiner 61cb18a69c Use JOOQ's Spring DB name during exception translation
The name of a JOOQ SQLDialect does not always match the name defined
in sql-error-codes.xml. For example, the Postgres translator was not
initialized correctly because in JOOQ the dialect is named
SQLDialect.POSTGRES, but in sql-error-codes.xml the bean is named
"PostgreSQL".

This commit updates the translator to use the dialects third-party
springDbName which ensures that it maps correctly to the entries in
sql-error-codes.xml.

Closes gh-5884
9 years ago
Andy Wilkinson 0a765e36f1 Protect against stack overflow when searching meta annotations
It is legal for an annotation to be annotated with itself. Previously,
when searching for meta annotations this could lead to a stack overflow.
This was likely to occur when using Kotlin as, like Java, its Target
annotation is annotated with itself. A stack overflow doesn’t occur
with Java’s Target annotation due to some short-circuiting logic for
annotations in java.lang.

This commit updates the logic for finding meta-annotations to
short-circuit when an annotation that has already been seen is
encountered.

Closes gh-5902
9 years ago
Stephane Nicoll 699d083cec Add load-on-startup property to DispatcherServlet
Closes gh-2481
9 years ago
Spring Buildmaster 819a9574a6 Next Development Version 9 years ago
Andy Wilkinson 3348ed5bb3 Make use of new GetMapping and PostMapping annotations
Closes gh-5277
9 years ago
Stephane Nicoll 2cacc19c91 Polish
See gh-5901
9 years ago
Stephane Nicoll a4ba8f61c9 Backport 6dd8415
While working on gh-5309, a regression was introduced and fixed right the
way on master. Unfortunately, the fix wasn't applied to `1.3.x` as it
should have been.

This commit applies 6dd8415 to `1.3.x`

Closes gh-5901
9 years ago
Stephane Nicoll b7e7bcf717 Make `spring.session.store-type` mandatory
Previously, Spring Session would be auto-configured by the mere presence
of Spring Session in the classpath. This was fragile as determining a
store type according to the environment could easily change when the
classpath of the project changes.

This commit makes the store-type property mandatory. If it is not set,
Spring Session is no longer auto-configured.

Closes gh-5838
9 years ago
Spring Buildmaster 376bbe68d8 Next Development Version 9 years ago
Stephane Nicoll 21536f64e1 Polish info contributor feature
This commit improves the `InfoContributor` infrastructure as follows:

* `InfoEndpoint` no longer breaks its public API and returns a Map as
before
* `Info` is now immutable
* All properties of the build are now displayed. Since we control the
generation of that file, there is no longer a mode to restrict what's
shown
* Build info is now generated in `META-INF/build-info.properties` by
default

Closes gh-5734
9 years ago
Andy Wilkinson a245845521 Correct assertion that were inverted when converting to AssertJ
See gh-5819
9 years ago
Andy Wilkinson c76621b34d Merge branch '1.3.x' 9 years ago
Andy Wilkinson 34420a8768 Allow @ConditionalOnProperty to be used as a meta-annotation
Closes gh-5819
9 years ago
Andy Wilkinson 5b544c918d Merge branch '1.3.x' 9 years ago
Andy Wilkinson 147956a7b2 Avoid creating multiple BeanNameViewResolver beans
ErrorMvcAutoConfiguration creates a BeanNameViewResolver bean in case
the user has used @EnabledWebMvc and disabled WebMvcAutoConfiguration.
If the user hasn’t used @EnabledWebMvc, WebMvcAutoConfiguration will
creates its BeanNameViewResolver and override the one that’s already
been defined by ErrorMvcAutoConfiguration.

This commit makes WebMvcAutoConfiguration’s BeanNameViewResolver
definition conditional on there being no existing BeanNameViewResolver
bean definition.

Closes gh-5354
9 years ago
Dave Syer de6c582c9e Merge remote-tracking branch 'origin/1.3.x' 9 years ago
Dave Syer 905451f92e That BaseConfiguration thing didn't work out after all
It seems like a base class that defines `@Beans` just doesn't
define any beans. Oh well, time to copy-paste.
9 years ago
Dave Syer e58bef5f2b Merge remote-tracking branch 'origin/1.3.x' 9 years ago
Dave Syer 1babdd5c2e Remove log config for non boot things 9 years ago
Dave Syer a86796f126 Merge remote-tracking branch 'origin/1.3.x'
Conflicts:
	spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/OAuth2AutoConfigurationTests.java
9 years ago
Dave Syer e98264debf Move base configuration class to a separate file
to stop it from being included in the enclosing @Configuration.

That way, if the app is not a web app, then there really is a
client_credentials OAuth2 resource (as claimed in the user guide).

Fixes gh-5735
9 years ago
Stephane Nicoll e71cea55ba Remove useless import 9 years ago
Stephane Nicoll 428a10a7d7 Only force request encoding
A recent Spring Framework change in `CharacterEncodingFilter` allows to
configure the force flag separately for requests and responses. This
commit enables the flag only for requests which should provide a better
default with binary content.

Closes gh-5459
9 years ago
Stephane Nicoll 6f4ec4e741 Inject ApplicationEventPublisher
Previously, the auto-configured
`OAuth2ClientAuthenticationProcessingFilter` instance had no
`ApplicationEventPublisher`. As a result, no event was fired. This commit
makes sure to associate the event publisher instance.

Closes gh-5853
9 years ago
Johnny Lim 7763c2ae4c Polish
Closes gh-5843
9 years ago
Phillip Webb 2d243f0668 Don't apply multiple session configurations
Add additional @ConditionalOnMissingBean guards to session
configurations to ensure that the first wins. Also reorder imports
to prefer Redis over JDBC.

See gh-5158
9 years ago
Phillip Webb 6466c0afa5 Polish 9 years ago
Stephane Nicoll bf89c8ee46 Polish spring session auto-configuration
This commit improves the initial submission by adding more tests and
more configuration options.

Closes gh-5158
9 years ago
Eddú Meléndez 0be00e2a6d Polish session auto-configuration
See gh-5158
9 years ago
Tommy Ludwig de007840a8 Spring Session auto-configuration expansion
This implementation was inspired in large part by the cache
auto-configuration. In addition to the originally supported Redis, now
Hazelcast, an in-memory map, as well as a no-op option are supported. It
should be easy to extend this to include additional data stores in the
future.

Closes gh-3811
9 years ago
Stephane Nicoll 9059184a6a Clarify commons-pool2 requirement for redis
`JedisConnectionFactory` needs `commons-pool2` for quite some time now
and our auto-configuration had a special case to handle redis if
`commons-pool2` isn't available.

This commit removes that code as using it would lead to a failure anyway.

Closes gh-5718
9 years ago
Johnny Lim 0efa0038c3 Polish
Closes gh-5815
9 years ago
Phillip Webb 0bf025af7b Add out-of-the-box support for status error pages
Allow convention based status error pages. Static HTML or templates
can be used by placing the appropriately named file under a `/error`
folder. For example:

	/src/main/resource/templates/error/404.ftl
or	/src/main/resource/public/error/404.html

Pages can also be named after the status series (5xx or 4xx).

Fixes gh-2691
9 years ago
Phillip Webb 590bd5c084 Fixup warnings 9 years ago
Phillip Webb 08ef5f4b1f Make ErrorPageRegistry first class concern
Create ErrorPageRegistry and ErrorPageRegistrar interfaces that allow
error page registration to be a first class concern.

Prior to this commit ErrorPageFilter needed to implement
ConfigurableEmbeddedServletContainer in order to receive ErrorPage
registrations.

Closes gh-5789
9 years ago
Phillip Webb 609cb52cd4 Move to relocated web classes
Refactor code to move from recently deprecated classes.

Closes gh-5822
9 years ago
Phillip Webb aea18671c1 Restructure web related classes
Reorganize web related classes for better separation of concerns.
Mainly this involves moving classes from `o.s.b.context.embedded`
that aren't directly tied to embedded servlet containers to
`o.s.b.web` and relocating everything from `o.s.b.context.web`.

See gh-5822
9 years ago
Phillip Webb a7cb689f95 Move @LocalServerPort annotation
Move the @LocalServerPort to org.springframework.boot.context.embedded
since it's only really useful when working with embedded servlet
containers.

See gh-5822
9 years ago
Phillip Webb f468aff47f Merge remote-tracking branch '1.3.x' 9 years ago
Phillip Webb ef7b511b0e Polish 9 years ago
Dave Syer ebb0ff8638 Merge remote-tracking branch 'origin/1.3.x' 9 years ago
Dave Syer 9c0679b1f4 Add support for spring.rabbitmq.ssl.algorithm
Rabbit client 3.6.* uses TLSv1.1 as the default algorithm which
many brokers are deisabling these days. Spring AMQP supports
changing the algorithm by name, so this is just a pass thru for
that.
9 years ago
Phillip Webb 2679a6f0c6 Polish 9 years ago
Stephane Nicoll ad5674cbb0 Merge branch '1.3.x' 9 years ago
Stephane Nicoll ac8e87d79f Polish contribution
Closes gh-5782
9 years ago
Venil Noronha d5554e0aa1 Use static-locations properties to locate favicon
Closes gh-5751
9 years ago
Stephane Nicoll 1ef3327441 Move multipart.* properties to spring.http.multipart.*
Closes gh-3044
9 years ago
Stephane Nicoll 5f41e82a89 Merge branch '1.3.x' 9 years ago
Stephane Nicoll 247685e992 Add missing `@Documented`
Closes gh-5786
9 years ago
Johnny Lim db2092e27d Polish
Closes gh-5798
9 years ago
Stephane Nicoll 23f669f8f5 Polish
See gh-5791
9 years ago
Fabrizio Cucci 7859438538 Fix typo in Servlet auto-configuration Javadoc
Removed misplaced "for" in javadoc for Tomcat nested configuration.

Closes gh-5779
9 years ago
Eddú Meléndez 99b830ebe7 Support different schema/data DB script users
Allow data and/or schema scripts to be run by different database users.

Fixes gh-5402
Closes gh-5788
9 years ago
Gary Russell 12b9f0262b Add RabbitMQ Connection Timeout Property
Fixes gh-685
Closes gh-5791
9 years ago
Dave Syer 568d716c99 Move OAuth2ClientContextFilter back before the main security filter
It sometimes has to catch an exception from the security filter so
it needs to be before, and somehow this hasn't been a problem up to
now, but probably only by some fluke.

Fixes gh-5792
9 years ago
Phillip Webb 93382648ab Formatting 9 years ago
Phillip Webb 79922360e1 Polish 9 years ago
Andy Wilkinson a6bcc6f573 Update Liquibase and Flyway docs and test other changelog formats
Closes gh-5741
9 years ago
Andy Wilkinson addb69508d Perform analysis of failures caused by DataSourceBeanCreationException
Closes gh-5351
9 years ago
Johnny Lim b914b4aa52 Remove the second parameter of substring() if possible
Closes gh-5720
9 years ago
Jakub Narloch 64989ae192 Replacing StringBuffer with lock-free StringBuilder
Closes gh-5727
9 years ago
Andy Wilkinson 6d4083a718 Merge branch '1.3.x' 9 years ago
Andy Wilkinson a4d7a77547 Apply spring.thymeleaf.cache to auto-configured ThymeleafViewResolver
Previously, spring.thymeleaf.cache was only applied to auto-configured
TemplateResolver. This commit also applies the propery to the
auto-configured ThymeleafViewResolver.

Closes gh-5395
9 years ago
Johnny Lim 6d48ee9593 Polish
Closes gh-5714
9 years ago
Phillip Webb 5881c9c74f Polish 9 years ago
Stephane Nicoll f561d9d9d8 Polish auto-configuration for Spring Web Services
Closes gh-5645
9 years ago
Vedran Pavic a7b3a913c2 Add auto-configuration for Spring Web Services
Closes gh-1045
9 years ago
oEmbedler Inc af39d558ff Fix potential NPE in RedisAutoConfiguration
Closes gh-5667
9 years ago
Phillip Webb 6eeda76af7 Merge branch '1.3.x' 9 years ago
Sergey Pauk 8542f4f481 Make UserInfoTokenServices.getPrincipal protected
Update UserInfoTokenServices.getPrincipal() so that it can be overridden
by subclasses to allow a custom authenticated principal to be returned
from the authorized request parameters.

Fixes gh-5053
9 years ago
Phillip Webb c79ecc29c6 Polish 9 years ago
Phillip Webb 7956e68224 Fix warnings 9 years ago
Venil Noronha 1def64e49e Add Jetty `acceptors` and `selectors` support
Add support for Jetty `acceptors` and `selectors` configuration, either
directly on the `JettyEmbeddedServletContainerFactory` or via
`server.jetty.acceptors`/`server.jetty.selectors` server properties.

Fixes gh-5380
Closes gh-5649
9 years ago
Phillip Webb 2d992c1324 Polish 9 years ago
Stephane Nicoll 99ae6dac53 Customize Couchbase's socket connect timeout
Our Windows build is failing currently because the couchbase server does
not handle a socket connection within a second (the default). This commit
adds a property to customize this option and set it to 10 sec in the
sample.

While investigating this issue, it turns out that while
`CouchbaseConfiguration` is public, it is not really possible to extend
it in user's configuration. This commit fixes this problem and add a test
that demonstrates how it can be used.

Closes gh-5657
9 years ago
Stephane Nicoll c38bb9657d Polish 9 years ago
Anand Shah 4d667970c4 Remove SolrAutoConfiguration @PreDestroy
Remove @PreDestroy from SolrAutoConfiguration since the container will
call the close method anyway.

Fixes gh-5333
Closes gh-5339
9 years ago
Phillip Webb 58417ebca5 Delete accidentally committed file
Remove accidentally committed SizeThreshold class.
9 years ago
Phillip Webb ea44ae6a35 Polish contribution 9 years ago
Venil Noronha 6d2f88ed9b Support max-http-header-size & max-http-post-size
Add `server.max-http-header-size` and `server.max-http-post-size`
properties and deprecate `server.tomcat.max-http-header-size`.

Fixes gh-5637
Closes gh-5641
9 years ago
Stephane Nicoll 3d9ac6ea57 Polish 9 years ago
Phillip Webb 2861c7651d Polish 9 years ago
Phillip Webb 0c0be1e626 Polish contribution 9 years ago
Venil Noronha d0ccea1b26 Support ActiveMQ trusted packages
Ass support for white-listing specific packages or trusting all packages
when using ActiveMQ.

Fixes gh-5631
Closes gh-5644
9 years ago
Phillip Webb ae249f7568 Merge branch '1.3.x' 9 years ago
Phillip Webb d7e56abdf3 Don't apply `null` ServerProperties from customize
Update ServerProperties so that `null` values are not applied when
customizing the EmbeddedServletContainerFactory. Primarily changed to
stop `server.undertow.accesslog.enabled` from being blindly applied.

Fixes gh-5515
9 years ago
Phillip Webb 2364bcc117 Polish 9 years ago
Stephane Nicoll fbe53be6c1 Polish Hibernate 5 support
Closes gh-2763
9 years ago
Stephane Nicoll 4e4ea4b51f Polish 9 years ago
Phillip Webb 6550bb4cf1 Polish 9 years ago
Andy Wilkinson 436da1d5fd Polish contribution 9 years ago
Yogesh Lonkar dc8685a927 Allow embedded Mongo's storage to be configured via the environment
Closes gh-5617
9 years ago
Johnny Lim 3b5ecbd066 Polish
Closes gh-5627
9 years ago
Andy Wilkinson e5a253e689 Improve diagnostics when OnBeanCondition type deduction fails
When @ConditionalOnBean or @ConditionalOnMissingBean are used on a
@Bean method, they will, in the absence of any other configuration,
attempt to deduce the bean's type by examining the method's return
type. This deduction can fail. See gh-4841, gh-4934, and gh-5624
for some examples of possible failure causes. Previously, this
failure was only logged as a debug message leaving the user with a
misleading message suggesting that the @ConditionalOnBean or
@ConditionalOnMissingBean annotation was not configured correctly.

This commit improves the diagnostics by mention the possibility of
type deduction in the exception message and including the exception
that caused deduction to fail as the cause.

Closes gh-4934
9 years ago
Dave Syer 9b121dcbaa Make MustacheViewResolver extend AbstractTemplateViewResolver
The Mustache support should still be usable outside a web application
because the properties only use web stuff in that context and don't
have any field or method signatures that depend on web.

Fixes gh-5626
9 years ago
Phillip Webb 9f1466c9a3 Refine Narayana log directory logic
Refine the log directory logic used by Narayana so that it is consistent
with Atomikos and Bitronix.

See gh-5552
9 years ago
Phillip Webb 48800f1818 Polish contribution 9 years ago
Gytis Trikleris a2adc5a130 Add Narayana JTA support
Add support for JBoss Narayana.

Fixes gh-5552
9 years ago
Phillip Webb 01c9d72644 Polish 9 years ago
Johnny Lim a55315b5b5 Polish
Closes gh-5614
9 years ago
Mohamed Gazal 3623eeda0c Add Liquibase rollback file support
Add a `liquibase.rollback-file` property which can be used to write
a rollback file when migrations occur.

Fixes gh-1826
Closes gh-5535
9 years ago
Phillip Webb 0db1194007 Upgrade to Hibernate 5.1
Upgrade to Hibernate 5.1, whilst still retaining compatibility with
Hibernate 4.3. This commit introduces the following changes:

* Add SpringPhysicalNamingStrategy to provides lowercase/underscore
  table names support. This should be equivalent to the previous
  SpringNamingStrategy that was used with Hibernate 4. No
  ImplicitNamingStrategy is provided since the Hibernate 5 defaults
  appear to be roughly equivalent to the conventions used in Spring
  Boot 1.3
  spring.jpa.hibernate.naming.

* Migrate  `spring.jpa.hibernate.naming-strategy` to
  `spring.jpa.hibernate.naming.strategy` and provide additional
  properties for physical and implicit.

* Add `spring.jpa.hibernate.use-new-id-generator-mappings` property and
  default to `false` when on Hibernate 5 to retain back compatibility.

See gh-2763
9 years ago
Andy Wilkinson d27e280759 Merge branch '1.3.x' 9 years ago
Stephane Nicoll 520448cd9c Add support for publisher confirms/returns
Closes gh-3945
9 years ago
Andy Wilkinson ffe21175ca Upgrade to Logback 1.1.7
Closes gh-5568
9 years ago
Stephane Nicoll 05ef0818f8 Polish contribution
Closes gh-5511
9 years ago
Huang YunKun 6a2ff3f02a Upgrade elasticsearch to 2.2.0
Closes gh-5443
9 years ago
Andy Wilkinson 487f7310fd Polish contribution 9 years ago
Quinten De Swaef 34eb3695e4 Allow Tomcat's minimum threads to be configured via the environment
Closes gh-5572
9 years ago
Phillip Webb b398b3319c Rename @SpringApplicationTest -> @SpringBootTest
Rename @SpringApplicationTest to SpringBootTest and
@SpringApplicationContextLoader to @SpringBootContextLoader.

Fixes gh-5562
9 years ago
Phillip Webb 4d404b214c Migrate away from @SpringApplicationConfiguration
Refactor internal tests to no longer use @SpringApplicationConfiguration

See gh-5562
9 years ago
Phillip Webb adb42ed966 Polish 9 years ago
Andy Wilkinson 15cbef3df0 Update JpaBaseConfiguration to use constructor injection
This change was missed as part of the work done in 19d8c5e6.

See gh-5306
Closes gh-5543
9 years ago
Andy Wilkinson 611d441763 Polishing 9 years ago
Dave Syer 416ce1a6f4 Make FixedAuthoritiesExtractor more liberal in what it accepts
In particular it now accepts a list of maps containing
"authority" keys (which is what you get from a standard JSON
decoding of a Spring Security Authentication).

Fixes gh-5482
9 years ago
Andy Wilkinson f55066464d Merge branch '1.3.x' 9 years ago
Andy Wilkinson 33f0ea3480 Rework SpringApplicationTest to support web modes
Rework the new testing support so that @SpringApplicationTest can be
used for standard integration tests, web integration tests with a
mock Servlet environment and web integration tests with an embedded
servlet container. This means that it a replacement for 1.3's
@IntegrationTest and @WebIntegrationTest and allows all
SpringApplication testing to be configured using a common annotation.

The old @IntegrationTest and @WebIntegrationTest along with their
supporting classes have been reinstated to their previous form (while
remaining deprecated). This should ensure that they continue to work
in 1.4 exactly as they did in 1.3 giving users a smooth path to
@SpringApplicationTest.

See gh-5477
9 years ago
Phillip Webb 893a6c32f3 Upgrade to checkstyle 6.17
Fixes gh-5547
9 years ago
Johnny Lim a28dd9d9e6 Polish
Closes gh-5532
9 years ago
Phillip Webb 39140945b5 Polish 9 years ago
Stephane Nicoll 6dd84159f5 Restore JMX property to IntegrationJmxConfiguration
Closes gh-5309
9 years ago
Stephane Nicoll 54bea72554 Polish Jersey integration tests 9 years ago
Stephane Nicoll c752fac5c0 Expose load-on-startup for Jersey
This commit adds a `spring.jersey.filter.load-on-startup` property used to
customize the startup priority of the Jersey servlet.

Closes gh-5100
9 years ago
Stephane Nicoll 33967927db Polish contribution
Closes gh-5512
9 years ago
Rob Baily 971a7194d8 Add check for non empty list of factories
It was seeen that if a different plugin was used to package Spring Boot
that the project would load but no autoconfiguration actually took
place and many features were mysteriously not working.  Adding a check
to ensure that some factories are always loaded as this is expected.

Closes gh-5465
9 years ago
Stephane Nicoll 1e0873c86e Polish contribution
Closes gh-5498
9 years ago
Eddú Meléndez 4912b989a5 Add useAlwaysMessageFormat configuration key
Allow to configure the `useAlwaysMessageFormat` attribute of
`MessageSource` via configuration.

Closes gh-5483
9 years ago
Stephane Nicoll abd86e50e0 Merge branch '1.3.x' 9 years ago
Stephane Nicoll ae095b2c1b Disable JMX Integration support if necessary
This commit fixes `IntegrationAutoConfiguration` to actually rely on the
auto-configured `MBeanServer` rather than attempting to create it again.

If JMX support is disabled, no attempt to register integration-related
MBeans is made.

Closes gh-5309
9 years ago
Johnny Lim 51bbe5e37a Polish
Closes gh-5508
9 years ago
Phillip Webb a3bfc29e6e Fix warnings 9 years ago
Phillip Webb 609704a3bf Polish 9 years ago
Phillip Webb c68e5f12ff Formatting 9 years ago
Stephane Nicoll fd437797b6 Polish contribution
This commit polihes the original Neo4j contribution in several areas.

Rather than providing the packages to scan, this commit rearranges the
`EntityScan` and `EntityScanRegistrar` so that the logic can be shared
for other components. If no package is provided, scanning now defaults to
the "auto-configured" package(s) and a `@NodeEntityScan` annotation
allows to override that.

The configuration has also been updated to detect the driver based on the
`uri` property. If the embedded driver is available we use that by
default. If it is not available, we're trying to connect to a Neo4j
server running on localhost. It is possible to disable the embedded mode
or set the `uri` parameter explicitly to deviate from these defaults.

The sample no longer relies on the embedded driver for licensing reason:
rather it expects an instance running on localhost (like other
data-related samples) and gracefully ignore any connection error. A
README has been added in the sample to further explain the available
options;

Closes gh-5458
9 years ago
Michael Hunger 0658cc8aee Add Neo4j support
See gh-5458
9 years ago
Phillip Webb 4167469781 Attempt to work around couchbase CI failures 9 years ago
Phillip Webb e5f224118b Print AutoConfigureReport on test failures
Add a TestExecutionListener to print the auto-configuration report
when a test cannot load.

See gh-4901
9 years ago
Phillip Webb fb70a56c79 Support override enable auto-configuration
Provide a way for full auto-configuration to be disabled
programmatically. Primarily added to allow special test annotations to
take over partial auto-configuration but still load
@SpringBootApplication classes.

See gh-4901
9 years ago
Phillip Webb 47f801d535 Make @ImportAutoConfiguration a meta-annotation
Update `@ImportAutoConfiguration` so that it can be used as a
meta-annotation. Also relocate it from the `test` package.

Fixes gh-5473
9 years ago
Phillip Webb 0829a1bde8 Drop superfluous annotations
Update internal tests to drop annotations that can now
be inferred.

Fixes gh-5470
9 years ago
Phillip Webb 513dec718f Add TestExcludeFilter for component scanning
Add a new TypeFilter specifically for excluding candidate components.
The filter is applied to `@SpringBootApplication` and allows tests to
dynamically contribute exclude filters so that specific classes of
component can be excluded.

See gh-5295
See gh-4901
9 years ago
Phillip Webb 965dd33ec8 Introduce @SpringBootConfiguration annotation
Add a new @SpringBootConfiguration annotation that can be used to
indicate the primary application configuration. The new annotation is
primarily indented to allow test automatically code to find the main
configuration class.

See gh-5295
9 years ago
Phillip Webb c28f552883 Migrate SpringJUnit4ClassRunner to SpringRunner
Replace all existing SpringJUnit4ClassRunner references with the new
SpringRunner alias.

Fixes gh-5292
9 years ago
Phillip Webb 2f815a907a Migrate existing tests from deprecated package
Update the existing tests to use the relocated `spring-boot-test`
classes. Restructuring was achieved using the following command:

find . -type f -name '*.java' -exec sed -i '' \
-e s/org.springframework.boot.test.ConfigFileApplicationContextInitializer/\
org.springframework.boot.test.context.ConfigFileApplicationContextInitializer/g \
-e s/org.springframework.boot.test.EnvironmentTestUtils/\
org.springframework.boot.test.util.EnvironmentTestUtils/g \
-e s/org.springframework.boot.test.IntegrationTest/\
org.springframework.boot.test.context.IntegrationTest/g \
-e s/org.springframework.boot.test.IntegrationTestPropertiesListener/\
org.springframework.boot.test.context.IntegrationTestPropertiesListener/g \
-e s/org.springframework.boot.test.OutputCapture/\
org.springframework.boot.test.rule.OutputCapture/g \
-e s/org.springframework.boot.test.SpringApplicationConfiguration/\
org.springframework.boot.test.context.SpringApplicationConfiguration/g \
-e s/org.springframework.boot.test.SpringApplicationContextLoader/\
org.springframework.boot.test.context.SpringApplicationContextLoader/g \
-e s/org.springframework.boot.test.SpringBootMockServletContext/\
org.springframework.boot.test.mock.web.SpringBootMockServletContext/g \
-e s/org.springframework.boot.test.TestRestTemplate/\
org.springframework.boot.test.web.client.TestRestTemplate/g \
-e s/org.springframework.boot.test.WebIntegrationTest/\
org.springframework.boot.test.context.web.WebIntegrationTest/g {} \;

See gh-5293
9 years ago
Phillip Webb aef7f4bcb1 Restructure spring-boot-test packages
Create a new package structure for `spring-boot-test` and deprecate
existing classes.

Fixes gh-5293
9 years ago
Phillip Webb 47fb614bde Set "proxy target class" for transaction managers
Update `@EnableTransactionManagement` so that `proxyTargetClass` is
set to true. This ensures that @Transactional beans that aren't
interface based can still be proxied.

Fixes gh-5423
9 years ago
Andy Wilkinson 19d8c5e6f6 Complete the move to constructor injection in configuration classes
This is a follow-on from the work done in 5009933. Now that SPR-14015
has been fixed, constructor injection can also be used for parameterised
dependencies, including optional dependencies that are injected via
an ObjectProvider.

Closes gh-5306
9 years ago
Stephane Nicoll cb2ad7fb87 Prevent Thymeleaf to be configured with Thymeleaf 3
Spring Boot does not support Thymeleaf 3 yet. This commit prevents the
auto-configuration to activate if Thymeleaf 3 is available on the
classpath.

Closes gh-5371
9 years ago
Stephane Nicoll 93f392134a Polish 9 years ago
Phillip Webb 7942d9f787 Polish 9 years ago
Stephane Nicoll d8c972c27e Merge branch '1.3.x' 9 years ago
Stephane Nicoll b1b84a358d Fix Artemis embedded mode condition
This commit prevents the Artemis embedded mode to kick-in if the
`EmbeddedJMS` class it not in the classpath. The previous condition would
match if only `artemis-server` was on the classpath while
`artemis-jms-server` is actually required.

Closes gh-5452
9 years ago
Stephane Nicoll 96b7419916 Polish contribution
Closes gh-5455
9 years ago
Eddú Meléndez 2fc2ec457b Auto-configure Redis repositories
Closes gh-5448
9 years ago
Stephane Nicoll bca83bde5b Polish contribution
Closes gh-5417
9 years ago
Marten Deinum ec8b94f13c Support setting webAllowOthers for the H2 Web Console
This commit adds a configuration option for the webAllowOthers option
for the H2 WebServlet. It will only be added it the
spring.h2.console.webAllowOthers is set to true, else it will be
ignored.

Closes gh-5416
9 years ago
Stephane Nicoll 3d4a9d9c84 Polish contribution
The properties exposed by the ActiveMQ pooled connection factory are
quite specific and I felt it was arbitrary to expose some and not others.

However, the number of connections and the timeouts seem the most useful
so they have been kept and a `configuration` nested namespace can be
used to configure any additional settings.

The core properties have been renamed to be less "raw" and more compliant
with the structure of other properties. The documentation on fields has
also been aligned.

Closes gh-5372
9 years ago
n27 e41d42171b Improve ActiveMQ connection pool configuration
Closes gh-1598
9 years ago
Stephane Nicoll fa84b179a8 Allow to customize the Couchbase environment
Closes gh-5403
9 years ago
Stephane Nicoll caf11e4445 Add Couchbase cache support
This commit updates the cache auto-configuration to provide a
`CouchbaseCacheManager` if a `Bucket` has been configured.

The global customizer infrastructure allows to further tune the cache
manager if necessary.

Closes gh-5176
9 years ago
Stephane Nicoll 9c733128ac Use ConditionalOnSingleCandidate when appropriate
This commit updates various auto-configuration to use
`@ConditionalOnSingleCandidate` rather than assuming that at most one
bean of a given type will be available.

Closes gh-2784
9 years ago
Stephane Nicoll 25f00b9bb8 Polish contribution
Closes gh-5341
9 years ago
Gary Russell 08732fe4c8 Add Retry Config: Template and Listener
Also add requeue rejected to listener config and
timeouts to RabbitTemplate config.

Closes gh-5340
9 years ago
Stephane Nicoll 2526a54e31 Polish contribution
Closes gh-5337
9 years ago
Anand Shah f6a32a1d5a Add `@LocalServerPort`
Closes gh-5262
9 years ago
Stephane Nicoll e67f2e2983 Separate Couchbase setup from Spring Data
This commit separates the basic setup of Couchbase from Spring Data so
that a `Bucket` and `Cluster` bucket beans are exposed even if Spring
Data is not available.

A basic setup happens if `spring.couchbase.bootstrap-hosts` is specified,
configuring the `default` bucket with no authentication unless specified
otherwise.

If Spring Data is available, those beans are re-used by default to
configure the `CouchbaseTemplate` and other repository-related beans.

Closes gh-5347
9 years ago
Stephane Nicoll dddea70985 Collect and display build information
This commit updates the Maven plugin to generate a
`META-INF/boot/build.properties` file with various build-specific
settings (group, artifact, name, version and build time). Additionally,
the plugin can be configured to write an arbitrary number of additional
properties.

A new `BuildProperties` bean is automatically exposed when such a file is
present. If that bean is present, an `InfoContributor` is automatically
created to expose that information under the `build` key.

As for the git contributor, it is possible to only display the core
settings or everything using the `management.info.build.mode` property.

See gh-2559
9 years ago
Stephane Nicoll 3e6b584953 Add Date as a support property type
Rather than exposing a raw String with the epoch time, GitProperties
now exposes the actual `java.util.Date`. `InfoProperties` has been
improved to return such data type when the raw value is an epoch time.
9 years ago
Stephane Nicoll b906b18655 Initiate GitProperties
This commit polish the new info contributor infrastructure by migrating
`GitInfo` to `GitProperties`. `InfoProperties` provides an abstraction
that exposes unstructured data in an immutable way.

The `GitInfoContributor` now accepts a "mode" that determines if all data
should be exposed or only a sub-set of known keys.

Closes gh-2644
9 years ago
Phillip Webb b260c20df0 Support JsonSerializer/JsonDeserializer Beans
Add a `@JsonComponent` annotation that can be used to indicate that a
Bean is a JsonSerializer and/or JsonDeserializer that should be
registered with Jackson.

Support is provide via a new `JsonComponentModule` which is
auto-configured in `JacksonAutoConfiguration`.

Also add `JsonObjectSerializer` and `JsonObjectDeserializer` classes
which provided as a convenient base for serializers that work with
Objects.

Fixes gh-3898
9 years ago
Phillip Webb a3f3de223f Polish 9 years ago
Stephane Nicoll 9bbde5b340 Properly guard validation support
Prevent the validation support to kick in if the Validation API is not
available.

Closes gh-5353
9 years ago
Andy Wilkinson 86d87f6b8a Deprecate support for Velocity
Support for Velocity has been deprecated in Spring Framework 4.3 with
the plan being to remove it in 5.0. This commit deprecates Spring
Boot's support in 1.4, with the plan being to remove it in 2.0.

Closes gh-5276
9 years ago
Stephane Nicoll ad53f09ed4 Improve Couchbase repository support
Previously, if Couchbase was available on the classpath but not
configured, Spring Boot would attempt to scan the project for
repositories anyway.

This commit makes sure that it only happens if an infrastructure
bean required is present. The tests have also been rewritten to better
reflect what would happen in practice.

Closes gh-5349
9 years ago
Stephane Nicoll d6bc3f0bc6 Fix build
Assert using epoch time
9 years ago
Stephane Nicoll 76edaa7e1e Fix build
Add TimeZone in date assertion
9 years ago
Stephane Nicoll f11fa0c309 Use `java.util.Date` rather than a raw String
This commit updates `GitInfo` to use a proper `java.util.Date` rather
than a raw String. Because the Maven and Gradle plugin do not agree on a
format, `ProjectInfoAutoConfiguration` now registers a `Converter` that
is taking care of translating the raw `String` to a `Date`.

See gh-2484
9 years ago
Andy Wilkinson 5009933788 Move to constructor injection in simple configuration classes
This commit updates "simple" configuration classes to use constructor
injection. Simple means that there are no optional dependencies
(@Autowired(required=false) is not used), and none of the dependencies
use generics.

Configuration classes that are not simple will be updated in a second
pass once https://jira.spring.io/browse/SPR-14015 has been fixed.

See gh-5306
9 years ago
Stephane Nicoll 398aed7fdb Missing entry for ProjectInfoAutoConfiguration 9 years ago
Phillip Webb 73cbb2f40a Polish 9 years ago
Stephane Nicoll d04155fcae Polish contribution
Closes gh-5303
9 years ago
Gary Russell c0cb813a01 Add Cache Properties for RabbitMQ
Closes gh-3502
9 years ago
Stephane Nicoll 0f820afa86 Auto-configure GitInfo
This commit moves `GitInfo` to a general "project info" area that will be
further improved with others project related information.

Deprecate `spring.git.properties` in favour of `spring.info.git.location`

Closes gh-2484
9 years ago
Johnny Lim a6c83787ef Polish
Closes gh-5318
9 years ago
Andy Wilkinson ef5087c5ee Upgrade to Jackson 2.7.2
Closes gh-5081
9 years ago
Andy Wilkinson 355860fd09 Remove @Autowired from constructors where class has single constructor
Closes gh-5226
9 years ago
Stephane Nicoll 813d86e5e0 Auto-configure Rabbit MessageConverter
If a `MessageConverter` bean is available, we now associate it to the
created `RabbitTemplate` and `RabbitListenerContainerFactory`. That way,
registering a custom `MessageConverter` is all that's needed.

The Rabbit auto-configuration is now using the new `ObjectProvider` that
offers a nicer API to detect if a primary candidate is available for
optional collaborators.

Closes gh-5088
9 years ago
Stephane Nicoll 360caf3d97 Polish 9 years ago
Stephane Nicoll bfa9ae13e7 Polish 9 years ago
Stephane Nicoll d13b9a98c5 Auto-configure JMS MessageConverter
If a `MessageConverter` bean is available, we now associate it to the
created `JmsTemplate` and `JmsListenerContainerFactory`. That way,
registering a custom `MessageConverter` is all that's needed.

The JMS auto-configuration is now using the new `ObjectProvider` that
offers a nicer API to detect if a primary candidate is available for
optional collaborators.

Closes gh-4282
9 years ago
Stephane Nicoll d9f4d6ce91 Allow custom CacheResolver
Previously, if a bean of type `CacheResolver` was present in the context
the whole cache auto-configuration would back off. If said
`CacheResolver` hasn't been defined via the `CachingConfigurer`
infrastructure, the application context would fail with a rather
unpleasant error message.

It can be quite common to define custom `CacheResolver` beans as the cache
annotations allow to defines custom cache resolvers per operation. This
commit makes sure that the cache auto-configuration will back-off only if
the `CacheResolver` is named `cacheResolver`.

Closes gh-5201
9 years ago
Stephane Nicoll 6741f05af1 Polish contribution
Closes gh-4903
9 years ago
Eddú Meléndez 98cc68364a Add Caffeine cache support
See gh-4899
9 years ago
Spring Buildmaster 225d877ab9 Next Development Version 9 years ago
Stephane Nicoll ebf82e4c20 Fix hazelcast schema location
Closes gh-5237
9 years ago
Phillip Webb 023a09bcf6 Merge branch '1.3.x' 9 years ago
Phillip Webb 936a96746a Fix missing Javadoc @param 9 years ago
Phillip Webb 17c9fc585f Polish 9 years ago
Phillip Webb c93ea54ea3 Merge branch '1.3.x' 9 years ago
Phillip Webb 4fd778fed8 Polish CacheManagerCustomizers 9 years ago
Andy Wilkinson ccf7de904c Upgrade to Infinispan 8.1.2.Final
Closes gh-5245
9 years ago