Commit Graph

1580 Commits

Author SHA1 Message Date
Phillip Webb 2b18e99ac7 Polish 2016-02-08 11:01:52 -08:00
Stephane Nicoll a27176807f Polish contribution
Closes gh-4188
2016-02-08 15:44:09 +01:00
Eddú Meléndez 5776d6a8d7 Add support of Jackson in Jersey
If Jackson is configured for the project, the `ObjectMapper` is now
reused and added in the Jersey's context.

Closes gh-4131
2016-02-08 15:34:44 +01:00
Phillip Webb a5ae81c1c1 Use AssertJ in spring-boot-autoconfigure
See gh-5083
2016-02-06 15:15:25 -08:00
Phillip Webb 516afcd2ca Polish 2016-02-06 15:02:12 -08:00
Phillip Webb ed01ae9ebf Use deterministic DataSource config import order
Update DataSourceAutoConfiguration so that pooled datasource
configurations are only loaded via an @Import. If left as nested
classes, the load order is JVM specific and can result in the wrong
configuration being loaded.

Closes gh-2183
2016-02-05 11:38:05 -08:00
Phillip Webb 3d0355434c Drop unneeded version tag from POM.xml 2016-02-05 11:37:08 -08:00
Phillip Webb a80ada64c3 Formatting 2016-02-03 12:16:53 -08:00
Vedran Pavic 1bc3eb8f0a Fix MariaDB driver class name
Closes gh-5075
2016-02-03 13:16:04 +01:00
Stephane Nicoll 34d87df425 Clarify use of the `spring.datasource` prefix
Previously, Spring Boot mapped both `DataSourceProperties` and the actual
`DataSource` implementation to the same prefix. This results in a huge
amount of keys in the `spring.datasource` namespace  with no way to
identify those that are valid for the pooled data source in use.

This commit maps the four pooled data sources we support in four isolated
namespace, keeping `spring.datasource` only for the common settings.

These are `spring.datasource.tomcat`, `spring.datasource.hikari`,
`spring.datasource.dbcp` and `spring.datasource.dbcp2` for the Tomcat,
Hikari, Commons DBCP and Commons DBCP2 implementations respectively.

Closes gh-2183
2016-02-03 11:05:23 +01:00
Phillip Webb 26dfbeb8f4 Share MetadataReaderFactory
Add SharedMetadataReaderFactoryContextInitializer to ensure that a
shared caching MetadataReaderFactory is used between configuration
classes and auto-configure sorting.

Fixes gh-4993
2016-01-29 21:42:18 -08:00
Phillip Webb f276ff4bd0 Polish 2016-01-27 16:02:36 -08:00
Stephane Nicoll b02073b455 Polish 2016-01-27 17:12:09 +01:00
Stephane Nicoll 217f825d3d Clarify DataSourceAutoConfiguration
The `DataSource` auto-configuration in Spring Boot supports two modes:
regular pooled DataSource and embedded database (via the
`EmbeddedDatabase` infrastructure provided by `spring-jdbc`. These were
previously named `NonEmbedded` and `Embedded` respectively.

This commit clarifies those mode and in particular that a pooled
`DataSource` can also handle an embedded database.

Closes gh-4634
2016-01-27 17:11:48 +01:00
Stephane Nicoll 762097ef29 Refactor logic from DataSourceProperties
Introduce dedicate method to determine the actual value to use based on
the configuration and the environment.

Closes gh-1436
2016-01-26 16:24:24 +01:00
Stephane Nicoll 3562026e9a Polish contribution
Closes gh-4574
2016-01-26 15:18:32 +01:00
Patrick Bray 3bf6c2fe1f Support for SendGrid ApiKey
See gh-4574
2016-01-26 15:01:19 +01:00
Stephane Nicoll 58751a43c1 Polish contribution
Closes gh-4590
2016-01-26 14:59:38 +01:00
Eddú Meléndez c68ffa5ba0 Add Thymeleaf's Java8TimeDialect
Closes gh-4576
2016-01-26 14:43:10 +01:00
Stephane Nicoll 854a67588e Remove reference to spring.view.*
Closes gh-3278
2016-01-26 08:19:22 +01:00
Stephane Nicoll 8e3d63ab6a Polish contribution
Closes gh-4632
2016-01-25 16:24:20 +01:00
Huang YunKun d796845664 Remove deprecated use of spring.mvc.*
Closes gh-4086
2016-01-25 16:01:05 +01:00
Stephane Nicoll cafe1dc4c6 Polish contribution
Fix additional use of \n

Closes gh-4707
2016-01-25 15:43:04 +01:00
mnhock e0ec607735 Use a platform-specific line separator
See gh-4707
2016-01-25 14:37:38 +01:00
Stephane Nicoll 4ff5afc636 Polish contribution
Removing all deprecated code

Closes gh-4905
Closes gh-4917
2016-01-25 14:06:20 +01:00
Eddú Meléndez 7b9cd20e98 Remove deprecated code
See gh-4905
2016-01-25 14:05:53 +01:00
Phillip Webb fbaf209240 Move master to 1.4.0.BUILD-SNAPSHOT 2016-01-24 10:45:24 -08:00
Johnny Lim 9a31e02806 Polish
Closes gh-5013
2016-01-24 19:13:01 +01:00
Spring Buildmaster 504d3e97ba Next development version 2016-01-21 18:41:30 -08:00
Phillip Webb e520c47c4f Refine `messages.properties` detection
Update `ResourceBundleCondition` to only enable the messages source
if `messages.properties` (and not `messages*.properties`) exists. This
operation is much faster that performing a pattern match since a full
jar entry scan is not required.

Since adding `messages.properties` is good practice and this change
allows us to delete the custom `PathMatchingResourcePatternResolver`
it seems like a fine compromise to make.

Fixes gh-4930
See gh-4811
2016-01-21 15:13:33 -08:00
Phillip Webb cf93f84e87 Polish 2016-01-21 14:15:49 -08:00
Phillip Webb 93c3b22bb4 Merge branch '1.2.x' 2016-01-21 11:14:20 -08:00
Phillip Webb c71aa32fbb Polish 2016-01-21 10:53:25 -08:00
Phillip Webb af36bf6864 Remove TODO in FlywayAutoConfiguration
Now tracked by gh-4995
2016-01-21 10:42:33 -08:00
Stephane Nicoll 44f508208a Merge branch '1.2.x' 2016-01-21 14:16:24 +01:00
Stephane Nicoll 58ebfdcbd3 Polish contribution
Closes gh-4973
2016-01-21 14:10:35 +01:00
Jacques-Etienne Beaudet a749855cb5 Allow indexed access of `flyway.locations`
This commit allows to use the `flyway.locations` in an indexed fashion
(i.e. typically in YAML configuration).

See gh-4973
2016-01-21 14:08:39 +01:00
Andy Wilkinson e33221aae1 Configure existing Jersey servlet registration created by the SCI
When a Jersey app is deployed to a standalone container, Jersey’s
ServletContainerInitializer will run and register a servlet for a class
annotated with @ApplicationPath. If Jersey’s ServletContainerInitializer
runs before Spring’s, this servlet will take precedence over the
servlet registered by JerseyAutoConfiguration and will therefore not be
configured with any init parameters specified using spring.jersey.init

For the case where Jersey’s SCI runs first, this commit updates
JerseyAutoConfiguration to examine the servlet context for an existing
registration of Jersey’s servlet (Jersey names the registration using
the fully-qualified name of the ResourceConfig subclass). If a
registration is found its init parameters are configured using the
configuration provided by spring.jersey.init.

For the case where Spring’s SCI runs first, this commit updates
JerseyAutoConfiguration so that it names its registration using the
fully-qualified name of the ResourceConfig sub-class. This allows
Jersey’s SCI to find the existing registration rather than attempting
to configure its own.

Closes gh-2471
2016-01-21 11:48:31 +00:00
Stephane Nicoll 9f728b3d59 Fix wrong import 2016-01-21 10:37:40 +01:00
Stephane Nicoll ea8e0cfc48 Support for simple numeric Flyway version
While Flyway's `MigrationVersion` is a String value, a simple "0" is
also a valid number. When such value is not wrapped in YAML, an integer
is injected rather than a String which leads to a failure as we can't
convert it.

This commit updates the `StringToMigrationVersionConverter` to also
supports conversion from a Number. This is a convenience for users
using YAML for configuration

Closes gh-4981
2016-01-21 10:26:12 +01:00
Andy Wilkinson 6f8d4c77e6 Handle multiple ContextRefreshedEvents in BackgroundPreinitializer
The same initializer will receive multiple ContextRefreshedEvents
when their is an application context hierarchy. This commit updates
the initializer to correctly handle multiple ContextRefreshedEvents
and only act upon the first that it receives.

See gh-4871
2016-01-20 22:23:57 +00:00
Andy Wilkinson 992e90f43d Ensure that background preinit has completed before refresh returns
This commit is a continuation of the changes made in b85b608. It
addresses an additional problem when testing applications where two
contexts are refreshed in quick succession. In this scenario, it
was possible, theoretically at least, for the first context’s background preinitialization to still be in progress and creating loggers when the
second is refreshed and resets the logger context.

This commit updates BackgroundPreinitializer so that, upon receipt of
a ContextRefreshedEvent, it waits for preinitialization to have
completed. In the scenario described above, this ensures that
preinitialization has completed before the call to refresh() for the
first context returns, thereby preventing it from running in parallel
with the refresh of the second context.

Closes gh-4871
2016-01-20 21:56:54 +00:00
Stephane Nicoll 179467bdd9 Make HazelcastJpaDependencyAutoConfiguration public
If Both Hazelcast and Hibernate are available, Spring Boot takes the
opinion that Hazelcast can be used for 2nd level caching and therefore
need to start before Hibernate.

Unfortunately, some users require Hibernate in some of their hazelcast
use case so the link is actually reversed. One way for such user is to
disable the auto-configuration that deals with this link. This class is
now public so that users can locate them and exclude them if necessary.

Closes gh-4960
2016-01-20 18:40:45 +01:00
Andy Wilkinson b85b60828c Perform background preinitialization after logging system setup
Previously, BackgroundPreinitializer would kick off preinitialization
on a separate thread in response to an ApplicationStartedEvent. This
work would then race with the logging system being set up in response
to an ApplicationEnvironmentPreparedEvent. When Logback’s being used
this race is problematic. As part of Logback’s setup,
LoggerContext.stop() is called. This calls LoggerContext.reset() which
can fail with a ConcurrentModificationException if another thread tries
to create a Logger at the same time. This is a known bug in Logback [1].

This commit updates BackgroundPreinitializer to respond to
an ApplicationEnvironmentPreparedEvent and to order itself so that it’s
called after LoggingApplicationListener has responded to the same event
by initializing the logging system.

Closes gh-4871

[1] http://jira.qos.ch/browse/LOGBACK-397
2016-01-20 11:49:57 +00:00
Andy Wilkinson 112b707b67 Ensure that MongoClient is not created with a null credentials list
Mongo’s 2.x driver allowed the credentials list to be null, however
the 3.x driver requires an empty list instead. The behaviour of the 2.x
driver is the same whether the client is created with a null credential
list or an empty credential list.

This commit aligns with the requirements of the 3.x driver by ensuring
that we never pass in a null credential list when creating the client.

Closes gh-4076
2016-01-18 16:06:38 +00:00
Stephane Nicoll 7d975ecd2e Polish 2016-01-18 10:53:04 +01:00
Stephane Nicoll af5d765a08 Enable resource chain if webjars locator is present
Webjars locator is a good hint that the resource chain should be
enabled. The sole presence of the library now enables the resource chain
unless the configuration states otherwise.

Closes gh-4403
2016-01-18 10:35:26 +01:00
mnhock 8f1f8dd680 Use entrySet() rather than using keySet() and then calling get(key)
Closes gh-4813
2016-01-15 17:01:58 +00:00
Andy Wilkinson 1107079683 Merge branch '1.2.x' 2016-01-15 11:20:01 +00:00
Andy Wilkinson b56eef236e Close Reader used by MustacheViewResolver when compiling a Template
Previously, MustacheViewResolver would create an InputStreamReader
that wraps the template Resource's InputStream but would fail to close
the Reader. When the InputStream was a FileInputStream, this caused
the resolver to leak file handles.

This commit updates the resolver to close the Reader once the Template
has been compiled, thereby allowing any underlying resources to be
cleaned up immediately, rather than having to wait for the JVM to exit.

Closes gh-4921
2016-01-15 11:19:24 +00:00