Commit Graph

622 Commits

Author SHA1 Message Date
Dave Syer 5548b24c4c Add autoconfig support for Flyway migrations
Flyway starts up with its default settings if it is on the classpath.
You can also ask Boot to barf if the migration scripts are missing.

Fixes gh-730
2014-05-02 11:15:33 +01:00
Marcel Overdijk 68e33b25c1 Added liquibase autoconfiguration for database migrations
If Liquibase is on the classpath it will fire up on startup. Various
config options are available (as well as the option to disable it).
Liquibase uses a YAML format for changes (in classpath:db/changelog).
2014-05-02 11:12:12 +01:00
Dave Syer ed64640ea4 Switch from @Bean to protected method 2014-05-02 09:47:42 +01:00
Phillip Webb 4248665fcd Remove freemarkerConfiguration bean
Remove `freemarkerConfiguration` from the FreeMarkerAutoConfiguration
since it should not be needed for most applications.

The previous code also caused problems since it included a
@ConditionalOnBean annotation on a bean that was created in the same
configuration.
2014-05-01 21:36:44 +01:00
Phillip Webb 2fe256a8aa Polish 2014-05-01 21:21:00 +01:00
Dave Syer 0540cecbd4 Fix test in FreeMarker support 2014-05-01 13:40:22 +01:00
Dave Syer cb1b3481be Add support for FreeMarker in non-webapp
The existing freemarker support only works in a webapp. This
change adds a FreeMarker Configuration bean (in both web- and
non webapps) so it can be used to load a Template and render it
(e.g. with Spring's FreeMarkerTemplateUtils).

See gh-679
2014-05-01 11:46:27 +01:00
Artem Bilan ce3aafa7a9 Upgrade to Spring Integration 4.0
Closes #751
2014-05-01 10:07:17 +01:00
Phillip Webb 6025f45aa0 Polish 2014-04-30 21:53:24 +01:00
Phillip Webb fb13bf9016 Move TemplateAvailabilityProvider
Move TemplateAvailabilityProvider from the spring-boot project to
spring-boot-autoconfigure
2014-04-30 21:38:17 +01:00
Phillip Webb decee8d871 Polish templates code 2014-04-30 21:36:09 +01:00
Dave Syer 537b0c3ff3 Use enum for MessageCodesResolver format
Fixes gh-670
2014-04-30 16:00:01 +01:00
Marcel Overdijk 1cbef02236 Add messagecode resolver format based on application property 2014-04-30 16:00:01 +01:00
Stephane Nicoll e26e06d5dd Fix build
Two modules are still relying on the spring-boot test-jar but it was
not generated anymore. Adding the generation of test-jar again as
a workaround until we completely removes the use of it.
2014-04-30 16:39:54 +02:00
Dave Syer 030f00c36d Convert actuator-ui sample to FreeMarker
See gh-679
2014-04-30 13:04:19 +01:00
Dave Syer 50190a4de7 Add support for HikariDataSource
We still prefer Tomcat if it is available (that can change
if the community asks loudly enough). Hikari is supported
via the same spring.datasource.* properties as Tomcat (and
DBCP), with some modifications:

* The validation and timeout settings are not as fine-grained
in Hikari, so many of them will simply be ignored. The most
common options (url, username, password, driverClassName) all
work as expected.

* The Hikari team recommends using a vendor-specific DataSource
via spring.datasource.dataSourceClassName and supplying it with
Properties (spring.datasource.hikari.*).

Hikari prefers the JDBC4 isValid() API (encapsulates vendor-
specific queries) which is probably a good thing, but we
haven't provided any explicit support or testing for that yet.

Fixes gh-418
2014-04-30 11:52:47 +01:00
Dave Syer f46d281b22 Upgrade to Reactor 1.1
Fixes gh-706
2014-04-30 11:27:29 +01:00
Andy Wilkinson 7c91176186 Add FreeMarker support
This commit adds auto-configuration and a starter,
spring-boot-starter-freemarker, for using FreeMarker view templates in
a web application.

A new abstraction, TemplateAvailabilityProvider, has been introduced.
This decouples ErrorMvcAutoConfiguration from the various view
technologies that Spring Boot now supports, allowing it to determine
when a custom error template is provided without knowing the details of
each view technology.

Closes #679
2014-04-29 19:46:09 +01:00
Dave Syer ef4e83a879 Move ErrorController to autoconfig 2014-04-29 15:23:29 +01:00
Andy Wilkinson b6cd2c970c Use Jedis rather than Lettuce as preferred Redis client
Salvatore has indicated that Jedis is his Java Redis client of choice.
This commit updates the auto-configuration support, actuator and
Redis starter accordingly.

Completes #745
2014-04-28 14:06:40 +01:00
Dave Syer b20262c1a7 Backout couchbase changes 2014-04-28 12:21:58 +01:00
Dave Syer e433eb20a6 Align couchbase more with other data-* support 2014-04-28 11:01:24 +01:00
sopov.ivan 174b654faf minor test fixes
Reverting arguments in assertEquals where constant was placed on
the "actual" place. Replacing assertEquals with assertFalse, assertTrue
and assertNull where applicable.

Fixes gh-735
2014-04-26 14:14:05 +01:00
Dave Syer 477b199cd6 Add ApplicationEventPublisher explicitly to security publisher
For some reason the exception mappings are only created with the
publisher is initialized in the constructor of DefaultAuthenticationEventPublisher.
Changed SpringBootWebSecurityConfiguration to do that rather then
relying on the ApplicationEventPublisherAware behaviour to inject it.

Fixes gh-719
2014-04-26 12:15:30 +01:00
Dave Syer 6ac85c1759 Add username/password and MongoClientOptions to Mongo config
The username/password option stil lonly works for a single host (to
connect to a cluster I suspect you need to set the URI). Also added
a MongoClientOptions (if a bean of that type exists it will be
used to populate the options that aren't in the URI).

Fixed gh-536
2014-04-26 12:09:23 +01:00
Phillip Webb 5dabd7fb41 Rename MongoTemplateAutoConfiguration
Rename MongoTemplateAutoConfiguration to MongoDataAutoConfiguration
since it now configures more than just the template.
2014-04-25 15:57:44 +01:00
Phillip Webb a7f5cbf7d0 Polish mongo changes
Restore formatting and fixup doc comments.
2014-04-25 15:57:44 +01:00
Phillip Webb 2adf30950e Polish couchbase support
Polish couchbase support to:
- Extract properties into its own class
- Remove unnecessary inner configuration class
- Add since tags
- Format code and add `this.` references
2014-04-25 15:57:44 +01:00
Phillip Webb fba08e7811 Polish 2014-04-25 15:57:43 +01:00
Phillip Webb 1ae91a135c Polish MultipartConfigElement support
Polish MultipartConfigElement changes introduced in commit e8e59ea6
as follows:

- Fix javadoc formatting
- Fix tab/spaces formatting
- Fix asciidoc formatting
- Move creation of MultipartConfigElement into MultipartProperties
- Add @Since tags
- Restore random port in tests
2014-04-25 15:57:43 +01:00
sopov.ivan 10d82e28ff minor - correcting modifiers order 2014-04-25 18:20:09 +04:00
Dave Syer 94dd510b52 Merge GridFs with MongoTemplate configuration 2014-04-25 13:41:09 +01:00
Josh Long f36f2024e2 Update GridFsTemplateAutoConfiguration.java
improved documentation.
2014-04-25 12:45:54 +01:00
Josh Long 330c95d6ab Update GridFsTemplateAutoConfigurationTests.java
improved documentation
2014-04-25 12:45:54 +01:00
Josh Long 0d53b9d9fa adding initial GridFS integration. 2014-04-25 12:45:53 +01:00
Michael Nitschinger 78ce06ccc7 Add support for spring-data-couchbase
Fixes gh-124
2014-04-25 12:05:15 +01:00
Stephane Nicoll c4ffe721c7 Fix JmsTemplate default pubSubDomain setting
Prior to this commit, a JmsTemplate bean created automatically by Boot
had its "pubSubDomain" flag enabled. It's far more usual to fallback on
queue rather than topic.

This commit flips the default value of the configuration property.
2014-04-25 11:16:27 +01:00
Rob Winch ae7098ae1d Add RepositoryRestMvcAutoConfiguration
Fixes gh-626
2014-04-25 11:13:31 +01:00
Dave Syer 63f2d6ab15 Remove compiler warnings related to Batch upgrade 2014-04-25 10:59:52 +01:00
Dave Syer 3173646635 Fix another test from gh-708 2014-04-25 10:57:12 +01:00
Dave Syer d597cc3387 Fix test broken in gh-708 2014-04-25 10:16:19 +01:00
Roy Clarkson 6ad7257baf Add auto-configuration for @EnableHypermediaSupport
If Spring HATEOAS is on the class path, then @EnableHypermediaSupport
will be auto-configured with HAL support.
2014-04-25 09:52:27 +01:00
Josh Long e8e59ea657 MultipartConfigElement autoconfig support.
Fixes gh-708
2014-04-25 09:33:43 +01:00
Phillip Webb 64a835e91a Move master to 1.1.0.BUILD-SNAPSHOT 2014-04-24 12:45:20 +01:00
Spring Buildmaster d3954a1703 Next development version 2014-04-24 02:24:28 -07:00
Phillip Webb 4119ef5cf4 Use random ports for tests
Update remaining tests to use random ports.

Fixes gh-337
2014-04-23 19:11:54 +01:00
Phillip Webb fad5ce45db Polish 2014-04-23 12:35:33 +01:00
Dave Syer 3304dd1cc9 Add spring.datasource.separator (default ";")
Fixes gh-715
2014-04-22 17:34:54 +01:00
Dave Syer f7c16764e6 Add setter for security.user.role
Fixes gh-700
2014-04-21 14:42:34 +01:00
Marcel Overdijk f78f836fc0 Add fixedlocaleresolver based on application property
If the user sets spring.mvc.locale and doesn't provide a @Bean
of type LocaleResolver then a FixedLocaleResolver will be provided.

Fixes gh-697, fixes gh-669
2014-04-19 19:38:51 -07:00
Dave Syer 0b89402240 Add spring.thymeleaf.contentType (defaults to HTML)
User can specify the content type in external properties now, optionally
ommitting the charset (since that is duplicated). If charset is not
appended by user Spring will do it.

Fixes gh-671
2014-04-15 07:10:08 -07:00
Spring Buildmaster a5864ebcd0 Next development version 2014-04-06 22:43:18 -07:00
Phillip Webb 2bb0f744e0 Polish 2014-04-06 21:49:12 -07:00
Jean Detoeuf 5077b6cc65 Added ActiveMqCredentials (optional)
Fixes gh-618
2014-04-03 14:48:17 +01:00
Dave Syer 5ed49462c4 Add spring.messages.cacheSeconds to global config
Fixes gh-625
2014-04-03 14:07:55 +01:00
Dave Syer 97adb5c1b3 Ensure ddl-auto=none for non-embedded database
A more thorough check is needed to avoid the false assumption
that the DataSource is embedded just because an embedded database
is on the classpath. You really have to try and look in the connection
metadata, so that's what we now do.

Fixes gh-621, fixes gh-373
2014-04-02 17:21:14 +01:00
Spring Buildmaster 15e9dbe98b Next development version 2014-04-01 03:05:51 -07:00
Phillip Webb 1e68b7e0a9 Remove superfluous <packaging> tags from POMs 2014-04-01 02:07:43 -07:00
Phillip Webb 0af7f7e347 Add missing POM info 2014-04-01 02:07:42 -07:00
Phillip Webb 488b03387f Polish POM formatting 2014-04-01 02:07:36 -07:00
Phillip Webb 6f9bb233ad Revert "Next development version"
This reverts commit b67bb70ee3.
2014-04-01 00:38:48 -07:00
Spring Buildmaster b67bb70ee3 Next development version 2014-03-31 22:38:42 -07:00
Phillip Webb ac4cdd33c3 Revert "Next development version"
This reverts commit 1d0eea12eb.
Returning to 1.0.0.BUILD-SNAPSHOT for an updated release.
2014-03-31 17:14:30 -07:00
Spring Buildmaster 1d0eea12eb Next development version 2014-03-28 11:47:09 -07:00
Phillip Webb beaddb2362 Polish 2014-03-26 13:29:26 -07:00
Dave Syer 006d7b6931 Move MongoTemplateAutoConfiguration to mongo package 2014-03-26 09:00:12 +00:00
Phillip Webb 44d708ef7a Polish 2014-03-25 14:33:27 -07:00
Phillip Webb c11d94105a Log AutoConfigurationPackages warnings just once
Update AutoConfigurationPackages to log warnings on the first access,
rather than during setup. This works around the fact that the CLI
currently add multiple @EnableAutoConfiguration annotations.

Fixes gh-579
2014-03-25 14:33:27 -07:00
Dave Syer e059d0cd5f Re-order security auto configuration so the fallback can be applied
The management security autoconfiguration wanted to come last in the chain
but that won't suit the fallback that was already in place for gh-568. This
change re-orders the autoconfig so that @EnableWebSecurity is still added
if the user sets security.basic.enabled=false and includes the actuator
endpoints.

Fixes gh-568
2014-03-25 17:03:10 +00:00
Dave Syer 59124d07c4 Switch on @EnableTransactionManagement by default
Fixes gh-576
2014-03-25 16:32:06 +00:00
Dave Syer 809a5a711f Add a @EnableWebSecurity if it looks like the user needs one
If the user explicitly disables the basic security features and forgets to
@EnableWebSecurity, and yet still wants a bean of type
WebSecurityConfigurerAdapter, he is trying to use a custom
security setup and the app would fail in a confusing way without
this change.

Fixes gh-568
2014-03-25 12:19:56 +00:00
Dave Syer a821092bbd Log a warning if repository autscan is set to default package
Fixes gh-572
2014-03-25 10:25:17 +00:00
Stephane Nicoll 87321edf36 Support Tomcat uri encoding (with UTF-8 default)
Introduce an extra `server.tomcat.uri-encoding` property used to
configure the URI encoding for the embedded tomcat container.

Defaults to `UTF-8` instead of the usual tomcat default of `ISO-8859-1`.

Fixes gh-540
2014-03-24 23:50:13 -07:00
Phillip Webb d42bedf295 Rename @ConfigurationProperties attributes
Rename `name` to `prefix` and `path` to `locations`.
2014-03-24 11:44:52 -07:00
Dave Syer 770c115d88 Allow Batch configuration without DataSource
If the user provides a JobExplorer and a BatchConfigurer that
don't require a DataSource we can back off on configuring ours
(and anything else that needs a DataSource).

Fixes gh-561
2014-03-24 15:23:43 +00:00
Dave Syer 86054a9c53 Use reflection to setup Websocket SCI so it works in Tomcat 8
Annoyingly this is necessary if we want to support Tomcat 7 and 8
since the package name changed.

Fixes gh-554
2014-03-24 09:04:21 +00:00
Dave Syer 3496f3f9dc Add marker interface for non-embedded servlet container
ErrorPageFilter is itself an EmbeddedServletContainerFactory
but it runs in a non-embedded container. Any component that assumes
the presence of an EmbeddedServletContainerFactory implies we are
running embedded is therefore invalid. WebSocketAutoConfiguration
had that problem.

Fixes gh-551
2014-03-23 21:45:54 +00:00
Dave Syer 373e2c5156 Allow user to opt out of ContentNegotiatingViewResolver
The bean ID for the ContentNegotiatingViewResolver is now
"viewResolver" (it is the *one*). The conditions have been changed
so that a user only has to define a bean of the same name to switch
it off.

Fixes gh-546
2014-03-22 14:44:30 +00:00
Dave Syer 4637c2a8f7 Accept viewNames and excludedViewNames for ThymeleafViewResolver
(via spring.thymeleaf.*).

Fixes gh-548
2014-03-22 14:25:51 +00:00
Dave Syer e472e7ccca Use forward:/index.html for home page
Fixes gh-549
2014-03-22 14:20:53 +00:00
Phillip Webb 03667c7ddc Rename a few `setup` methods to `configure`
Fixes gh-537
2014-03-21 11:25:31 -07:00
Phillip Webb 3193913899 Polish 2014-03-20 09:08:09 -07:00
Chris Savory 7be2d97d49 Allow multiple MessageSources that are comma separated.
Fixes gh-532, Fixes gh-506
2014-03-20 08:12:11 +00:00
Phillip Webb 798229f530 Document rabbit.addresses property 2014-03-18 11:15:15 -07:00
Dave Syer 01137b6fd6 Add "addresses" to RabbitProperties
If user sets addresses it supercedes anything that was set in host
or port (same as in the native ConnectionFactory).

Fixes gh-524
2014-03-18 17:57:55 +00:00
Piotr Maj 2e74251d1b Add support for sorting json keys
Add `jsonSortKeys` property to HttpMapperProperties.

Fixes gh-498
2014-03-18 10:38:00 -07:00
Phillip Webb c5ee3c7eba Remove duplicate documentation
Remove README files that have been since been migrated to the reference
documentation. Also updated remaining markdown files to asciidoctor to
save having a mix of different formats.

Fixed gh-503
2014-03-16 23:00:12 -07:00
Phillip Webb fcea565433 Polish javadoc formatting 2014-03-15 13:02:02 -07:00
Phillip Webb 80ac1fb0cd Polish 2014-03-15 13:02:01 -07:00
Phillip Webb 12d2331f4d Fix failing JMS test
Fix test failure caused by URL -> Url rename in
commit 22e397cda2
2014-03-13 13:59:54 -07:00
Phillip Webb 22e397cda2 Polish 2014-03-13 13:11:54 -07:00
Dave Syer 3d43771136 Register an AuthenticationManager in security autoconfig
This is quite a big step, but I think it helps a lot. Since Spring
Boot always creates an AuthenticationManager if it doesn't find one
already registered, it makes sense to also make it into a @Bean.
Spring Security does not register its AuthenticationManager by
default though, so we have to do that for it if the user has created
one with an @Autowired AuthenticationManagerBuilder, but not registered
it as a @Bean.

Having the @Bean (marked @Primary to prevent issues with @Autowired)
makes it easier to reason about what Spring Boot has done for you, and
easier to default in simple use cases to the boot-created
AuthenticationManager. For example, if I want an OAuth2 Authorization
Server with password grant, it makes total sense for the
AuthenticationManager for users to be the same as the @Primary one.
Now it is easy to set that up (just @Autowire it).
2014-03-13 12:02:34 +00:00
Dave Syer 85a56a79e4 Tidy up implementation of DispatcherServletAutoConfiguration
also adds another test.
2014-03-13 11:08:27 +00:00
Dave Syer 659d7b6df1 Extend DefaultDispatcherServletCondition to check for a registration
...bean with no explicit @Bean DispatcherServlet. We still have to check
by bean name (slightly unfortunate, but we need to avoid instantiating
too early) so there's now another magic
bean name for the registration bean ("dispatcherServletRegistration")
that the user has to replace if he wants the registration without
defining a servlet @Bean

Fixes gh-482
2014-03-13 09:33:29 +00:00
Dave Syer 14d52b6c18 Avoid creating a new EmbeddedServletContainerFactory for websockets
User can now also switch off and customize the websockets customizer by adding
a bean named "websocketContainerCustomizer".

Fixes gh-479
2014-03-12 09:21:07 +00:00
Piotr Maj 1b167f630c Support for maxWait, jdbcInterceptors and validationInterval
Fixes gh-470
2014-03-10 17:08:04 +00:00
Piotr Maj cb6739b4a5 Added testWhileIdle etc.
Fixes gh-463
2014-03-09 21:22:14 +00:00
Andy Piper 7b4fa22b40 Fix typo 2014-03-08 15:53:21 +00:00
Dave Syer c68902260e Change explicit bean type to concrete NamedParameterJdbcTemplate
Fixes gh-447
2014-03-07 11:06:58 +00:00
Josh Long 9453a6324a polishing documentation 2014-03-07 11:04:41 +00:00
Dave Syer a0ba8c90a6 Add MultipartConfig to DispatcherServlet by default
RC4 added a ServletRegistrationBaen for teh DispatcherServlet and we
didn't register a MultipartConfigElement if one was present.

Fixes gh-427
2014-03-05 09:30:18 +00:00
Dave Syer ffe91ca6bf Change exception message for missing Thymeleaf templates
Fixes gh-424
2014-03-05 09:07:15 +00:00
Dave Syer 6b83e0ad5d Change bean name of ContentNegotiatingViewResolver
Fixed gh-428
2014-03-05 08:56:53 +00:00
Dave Syer b56bd0a10c Add ViewResolver docs 2014-03-04 22:17:50 +00:00
Dave Syer 3bc37ddde0 Strip out most of websocket autoconfig
... leaving only the embedded Tomcat enabling feature (registering
the WsSci).

Fixes part of gh-65
2014-03-04 16:25:10 +00:00
Spring Buildmaster b0d4e8ae69 Next development version 2014-03-03 22:46:12 -08:00
Spring Buildmaster cb8668a151 Release version 1.0.0.RC4 2014-03-03 22:46:05 -08:00
Phillip Webb 99350a2216 Tidy ConfigurableEmbeddedServletContainerFactory
Rename ConfigurableEmbeddedServletContainerFactory to
ConfigurableEmbeddedServletContainer and extract
AbstractConfigurableEmbeddedServletContainer from
AbstractEmbeddedServletContainerFactory.
2014-03-03 21:10:56 -08:00
Phillip Webb 3f9ca68812 Tweak ConfigurableEmbeddedServletContainerFactory
Update ConfigurableEmbeddedServletContainerFactory to no longer directly
extend EmbeddedServletContainerFactory.
2014-03-03 18:39:18 -08:00
Phillip Webb 9c4dc0c68f Drop getPort from ConfEmbServletContainerFactory
Remove getPort() from ConfigurableEmbeddedServletContainerFactory to
keep the interface primarily setters.
2014-03-03 18:10:08 -08:00
Phillip Webb 468728a2c0 Polish 2014-03-03 17:50:19 -08:00
Dave Syer 07b88630f4 Be defensive with auto-config of Servlet 3.0 features
There's no explicit support for older Servlet specs in Spring Boot,
but we can at least make it easy for others to provide such
support by not adding stuff to the context when in an older container.
2014-03-03 18:08:38 +00:00
Dave Syer b0b7bc0e7f Fix tests
Some assumptions were being made in tests, e.g. about
there being an AuthenticationManager @Bean, which were
false with the new Security 3.2.1 updates from Rob.

Also parent-child contexts with the actuator were
problematic because they didn't exclude the web configuration
for the management security in the parent context.

Fixes gh-244
2014-03-03 12:22:36 +00:00
Rob Winch 6b0eba3759 Update to Spring Security 3.2.1
Also change strategy for defaulting of Authentication. Spring
Boot authentication defaults are now encapsulated and can easily
be overridden by a user defined AuthenticationManager.
2014-03-03 12:21:37 +00:00
Dave Syer 29982f5946 Add @Configuration to WebMvcAutoConfigurationAdapter 2014-02-26 17:02:38 +00:00
Phillip Webb 083cb388c0 Upgrade to Spring Security 3.2.1
Fixes gh-392
2014-02-24 21:54:33 -08:00
Oliver Gierke af458cb253 Upgrade to Spring Data Codd GA release.
Adapt auto-configuration code to use the new constructor introduced
in Spring Data Commons' AnnotationConfigurationSource.

Fixes gh-365
2014-02-24 14:06:37 -08:00
Phillip Webb cf23b519d2 Polish 2014-02-24 13:43:54 -08:00
Dave Syer 8947307702 Add retry and parameter increment logic to job runner
The existing behaviour of JobLauncherCommandLineRunner was really too
basic. It has now been enhanced (at the expense of duplicating a lot
of code in Spring Batch it seems) to automatically increment job
parameters if it can, and to retry a failed or stopped execution
if it can (without incrementing, but with additional job parameters
added from command line if they are non-identifying).

The JobLauncherCommandLineRunner is more extendable and exposes
its DI wiring points now as well, so hopefully users can make
use of it independently of autoconfig (by providing a @Bean of
that type).

Not everything from the wishlist in gh-325 is implememented yet,
but it should be a good platform to work with and to extend.
2014-02-24 18:15:20 +00:00
Dave Syer 09f3ee14a4 Skip unnecessary attempt at executing Job
...that was already executed as part of the "local" set.

Also added some howto docs on executing Batch jobs.

See gh-382
2014-02-24 14:56:17 +00:00
hoserdude 3ad6c96ce5 Adding support for multiple configured job names 2014-02-24 14:33:08 +00:00
Dave Syer f38a36ff70 Fail on startup if Thymeleaf template directory missing
Better even than logging would be to fail fast? Surely it's a
mistake not to have any /templates if Thymeleaf is in use.
User can disable failfast by exlcuding thymeleaf configuration
or by providing their own ITemplateResolver.

Fixes gh-294
2014-02-24 09:53:07 +00:00
Dave Syer 8d9c26b2df Switch default to fail on error in SQL initialization
User can switch the behaviour on and off with
spring.datasource.continueOnError:true|false. I decided
not to add an extra nested level of property resolution
because of the existing spring.datasource.schema
(and other properties relating to initialization) because
concision seemed like a good thing with those more common
settings.

Fixes gh-374
2014-02-24 09:30:21 +00:00
Christian Dupuis b2327cb5f9 Fix comment 2014-02-20 17:44:23 +01:00
Dave Syer b2b487ee5f Add ServletRegistrationBean for DispatcherServlet
Mapping is exposed via server.servletPath.

Fixes gh-379
2014-02-20 09:49:24 +00:00
Dave Syer 44b877cd7d Remove @ConditionalOnBean(DataSource.class) from JPA config
Stacktrace is then obviously about DataSource, not EntityManager.

Fixes gh-375
2014-02-20 09:09:50 +00:00
Dave Syer 6631dd025c Ensure DispatcherServlet is available in a deployed WAR
The DispatcherServletAutoConfiguration had a condition on it that
meant it wasn't used at all if there was no EmbeddedServletContainerFactory.
It's amazing that any WAR ever deployed.

Also added some info logging to servlet and filter registrations.
2014-02-19 13:41:08 +00:00
Jakub Kubrynski 5d591edbf8 Consider FactoryBean classes in OnBeanCondition
Update OnBeanCondition to attempt to consider FactoryBean classes
for bean type matches. To ensure early instantiation does not occur, the
object type from the FactoryBean is deduced by resolving generics on the
declaration.

Fixes gh-355
2014-02-17 13:34:03 +00:00
Dave Syer fc4aabde75 Add some test cases and comments
In response to gh-352
2014-02-14 18:50:36 +00:00
Spring Buildmaster 1367d57e8c Next development version 2014-02-13 13:19:12 -08:00
Spring Buildmaster eaff1677a7 Release version 1.0.0.RC3 2014-02-13 13:18:56 -08:00
Phillip Webb 4a58171b5c A few more package tweaks
Improve package structure and include package-info javadoc.
2014-02-12 13:50:37 -08:00
Oliver Gierke 929bd902be Upgraded to Spring Data Codd
Update AbstractRepositoryConfigurationSourceSupport to use the newly
introduced RepositoryConfigurationDelegate instead of effectively
reimplementing Spring Data Commons functionality which was prone to
changes in the API (code that wasn't considered to be API in the first
place).

Switch from implementing BeanClassLoaderAware to ResourceLoaderAware
to avoid having to set up a DefaultResourceLoader which should also
improve IDE integration.

Fixes gh-236
2014-02-12 01:18:58 -08:00
Phillip Webb ed9735361e Apply source cleanup and formatting 2014-02-05 22:53:28 -08:00
Phillip Webb 80f2336f17 Polish 2014-02-05 22:31:56 -08:00
Phillip Webb 0b7eda89d4 Don't eagerly initialize FactoryBeans
Fix `EmbeddedServletContainerAutoConfiguration` so that it does not
accidentally eagerly initialize factory beans.

Fixes gh-306
2014-02-05 20:24:21 -08:00
Phillip Webb 8763fab0e7 Extract inner configuration property classes
Extract all inner @ConfigurationProperties classes from @Configuration
classes for consistency.
2014-02-05 18:12:41 -08:00
Phillip Webb 5188ee5266 Extract Mongo auto-configuration from Spring Data
Extract Mongo auto-configuration classes from Spring Data specific
auto-configuration, allowing Mongo to be used without Spring Data
if require.
2014-02-05 17:52:25 -08:00
Oliver Gierke cf4df1befb Improve Mongo auto-configuration
Disable Mongo auto-configuation when @EnableMongoRepositories is used
and adapt the test helper classes accordingly.

Change the property prefix and dependency management version property
from `...mongo` to `...mongodb` for consistency with Spring Data.

Fixes gh-315
2014-02-05 17:29:39 -08:00
Phillip Webb 37c2c89bcb Restructure packages
Improve package structure and attempt to co-locate related classes.
2014-02-05 14:39:01 -08:00
Phillip Webb f7d4490b2d Fix package tangle with AutoConfigurationReport
Rename AutoConfigurationReport to ConditionEvaluationReport and
co-locate with conditions.
2014-02-03 17:25:50 -08:00
Phillip Webb 6431fef91e Polish 2014-01-31 22:51:41 -08:00
Phillip Webb 643295cc3c Separate Application Listener and Initializer
Update SpringApplication so that ApplicationListener and
ApplicationInitializer methods must be called separately. This helps
to prevent unexpected side effects when calling the setters and
also encourages separation of concerns.

The few situations where a class was both an ApplicationInitializer
and ApplicationListener are now handled by registering an inner
listener from the `initialize` method.
2014-01-31 14:45:18 -08:00
Phillip Webb 92f01cf9bc Rename SpringApplication Events
Move SpringApplication events to their own package, create a common
base class and rename classes to match Spring conventions.
2014-01-31 11:00:50 -08:00
Christian Dupuis 8a55fbebb2 Allow pretty printed JSON output (nicer for demos and easier to read)
Defaults to false
2014-01-31 12:16:17 +01:00
Dave Syer 2bd6026a2a Exclude null and empty properties from /autoconfig 2014-01-30 10:37:22 +00:00
Dave Syer a21397dbe2 Fix AutoConfigurationReport parent location
BeanFactory.getBean() already looks in the parent context
so we have to be careful and not use the parent when locating
the report singleton

Fixes gh-290
2014-01-30 10:20:39 +00:00
Dave Syer a592215651 Use non-deprecated API to create Mongo client 2014-01-30 09:08:18 +00:00
Dave Syer 63fefbd7e7 Assert that parent autoconfig report is matched to parent BeanFactory
Test for gh-290
2014-01-30 09:01:06 +00:00
Dave Syer 9eb71c157a Remove unnecessary @Conditional 2014-01-30 09:00:40 +00:00
Dave Syer 4d608f20e9 Support for AuthenticationManagerBuilder injection into user code
Spring Boot provides a default AuthenticatiomManager for getting
started quickly with security and never exposing insecure
endpoints. To override that feature as users move to the next
stage in their project, they may have to do something slightly
different depending on whether it is a webapp or not.

In any app (web or not), providing a @Bean of type
AuthenticationManager always works, but you don't get the benefit of
the builder features.

In a webapp the user can also extend WebSecurityConfigurerAdapter
to provides a custom AuthenticationManager, and the preferred
way of doing that is via a void method that is autowired with an
AuthenticationManagerBuilder. The default AuthenticationManager is
built in a configurer with @Order(LOWEST_PRECEDENCE - 3) so
to override it the user's confugrer must have higher precedence
(lower @Order).

@EnableGlobalMethodSecurity can also be used in a non-webapp, and
Spring Boot will still provide a default AuthenticationManager.
To override it the user has to either extend
GlobalMethodSecurityConfiguration or provide a @Bean of type
AuthenticationManager (there's no other way to
capture the AuthenticationManagerBuilder that doesn't happen too late
in the beans lifecyle).

Fixes gh-244
2014-01-29 15:47:46 +00:00
Christian Dupuis efe8494f46 Remove hard coded bean names for couple of @ConfigurationProperties beans 2014-01-28 14:42:00 +01:00
Phillip Webb bcd74bb72d Remove custom JodaModule support
Remove the custom JodaModule support which is not necessary with
Spring 4.0.1.

Fixes gh-186
2014-01-27 15:00:04 -08:00
Phillip Webb b34102c30c Polish 2014-01-27 10:56:02 -08:00
Dave Syer 6528062a49 Use custom condition to detect Hibernate 4.2 and 4.3
...without any deprecation warnings and with some chance that it will
still work with Hibernate 5.

Fixes gh-256
2014-01-27 14:59:24 +00:00
Dave Syer 8d05cd1fb6 Allow hibernate.version as synonym in dependency management 2014-01-27 10:02:27 +00:00
Dave Syer 19ca4d4eae Add destroyMethods to DataSources 2014-01-24 18:19:20 +00:00
Dave Syer 76b15c4446 Add spring.messages.encoding (default utf-8)
Fixes gh-260
2014-01-23 22:04:41 +00:00
Dave Syer dac1b53fda Don't mask original exception in SpringApplication.handleError
If any @Import (or @Enable*, especially @EnableScheduling) has registered
bean *names* as ApplicationListeners, and the application context wasn't
refreshed fully when it failed, then the listener lookup could fail and
mask the original exception

Fixes gh-253
2014-01-23 10:21:32 +00:00
Dave Syer 195eb9f9bc Updates to redis repositories
* Ensure prefix ends with period
* Allow prefix and key index to be set separately
2014-01-23 10:21:31 +00:00
Phillip Webb 43e54d38f7 Make fields private where possible 2014-01-21 16:29:07 -08:00
Phillip Webb 0160760568 Apply latest eclipse cleanup rules 2014-01-21 16:28:26 -08:00
Phillip Webb ac54d7fe3c Final polish before 1.0.0.RC1 2014-01-21 16:28:17 -08:00
Phillip Webb cdda330acd Update copyright header for files changed in 2014 2014-01-21 10:27:10 -08:00
Dave Syer ea3b82091b Tweak javadocs in SprinApplicationBuilder 2014-01-21 14:29:19 +00:00
Dave Syer 8f4059147c Revert "Upgrade to Tomcat 7.0.50"
This reverts commit 3d60696b9b.
2014-01-21 12:18:12 +00:00
Phillip Webb 68293f34af Upgrade version to 1.0.0.BUILD-SNAPSHOT
Fixes fg-243
2014-01-21 00:43:54 -08:00
Phillip Webb 3d60696b9b Upgrade to Tomcat 7.0.50
Upgrade to Tomcat 7.0.50, working around the potential
NullPointerException by also adding dependencies to
tomcat-embedded-jasper (which is now also required for Hibernate
Validator 5.0, see commit 377953babd)

Fixes gh-245
2014-01-20 23:45:27 -08:00
Phillip Webb 56364ecd46 Allow custom PersistenceUnitManager with JPA
Allow JPA auto-configuration to use an optional custom
PersistenceUnitManager defined as a bean.

Fixed gh-238
2014-01-19 21:59:06 -08:00
Dave Syer 8db1d0e044 Fix some TODOs 2014-01-19 16:00:10 +00:00
Dave Syer 07da034571 Allow @EnableTransactionManagement to be supplied by user 2014-01-19 14:11:04 +00:00
Christopher Smith 25cc68cafe Add spring.resources.cachePeriod to MvcAutoConfiguration
Fixes gh-232
2014-01-17 18:48:32 +00:00
Phillip Webb f103a976f8 Don't use @ComponentScan for default packages
Update the 'default' package used for @Entity and Repository scanning
to be the package of the class annotated with @EnableAutoConfiguration
rather than using @ComponentScan.

This allows JPA and Spring Data to be used without requiring component
scanning and also removes the confusion that could arise from reusing
the @ComponentScan annotation, which already has well defined semantics.

Fixes gh-200
2014-01-16 22:57:07 -08:00
Phillip Webb b85f984349 Refine auto-configuration report log levels
Refine the `AutoConfigurationReportLoggingInitializer` log level to
only display the information about enabling debug if the debug level
if not on.

Fixes gh-199
2014-01-16 13:07:48 -08:00
Phillip Webb 53f1488f70 Don't automatically log auto-configuration report
Update the `AutoConfigurationReportLoggingInitializer` to only output
the report at debug level. A crash report now triggers an info output
suggesting the user runs again with '--debug' to display the report.

Fixes gh-199
2014-01-16 12:57:13 -08:00
Phillip Webb 312535bcd5 Add SpringNamingStrategy to improve FK names
Add a new `SpringNamingStrategy` hibernate `NamingStrategy` that
extends `ImprovedNamingStrategy` to improve the name of foreign
key columns.

Fixes gh-213
2014-01-16 10:38:56 -08:00
Andy Wilkinson b45683f103 Only auto-configure Reduce if Lettuce is on the classpath
Fixes #226
2014-01-15 10:48:26 +00:00
Phillip Webb ffe8bf5419 Remove unused .gitignore files 2014-01-13 21:53:24 -08:00
Phillip Webb 47da8a817a Polish 2014-01-10 13:06:54 -08:00
Christian Dupuis 62e02d3d81 Add initialSize configuration property to datasource auto configuration
fixes #206
2014-01-10 11:32:18 +01:00
Christian Dupuis 1a44b3e676 Fix sorting of auto configuration classes on JDK 8 2014-01-09 20:56:06 +01:00
Dave Syer 2377bd9ec9 Don't load BatchAutoConfiguration at all if there is no JobLauncher
Fixes gh-204
2014-01-09 17:50:03 +00:00
Dave Syer b1db714c23 Allow @EnableGlobalMethodSecurity in a non webapp
Fixes gh-202
2014-01-09 17:13:59 +00:00
Dave Syer aebaa580db Add test for user overriding @EnableJpaRepositories 2014-01-09 11:14:18 +00:00
Dave Syer c8152bfc70 SpringBootTestUtils->EnvironmentTestUtils 2014-01-09 10:56:33 +00:00
Dave Syer 478e655758 Change algorithm for determining active profile from external config
Instead of adding active prpfiles for every one we encounter, we need to
build up a complete "default" Environment and then ask it what the active
profiles are. Implemented in ConfigFileApplicationListener.

Fixes gh-198
2014-01-08 18:03:37 +00:00
Dave Syer 561cb3a50f TestUtils -> SpringBootTestUtils 2014-01-08 13:58:21 +00:00
Dave Syer 321ce3aad2 TestUtils -> SpringBootTestUtils 2014-01-08 10:46:42 +00:00
Dave Syer 147968cf83 Set isolation to DEFAULT for JPA transaction manager
Also logs a warning about the fact that locks may not be taken when
starting a Job. JPA and Batch don't really work that well together
in general so it's probably not worth a lot of effort to work aoround
this. If anyone needs to they should create a custom JpaDialect
(and a BatchConfigurer).

Fixes gh-197
2014-01-08 09:58:23 +00:00
Dave Syer 633dea9d80 Add declarative ApplicationListener 2014-01-07 17:53:34 +00:00
Dave Syer 441572c61c Migrate config file initializer to a listener 2014-01-07 17:52:46 +00:00
Dave Syer 3dacf4be17 Migrate Logging and Liquibase initializers to be listeners 2014-01-07 17:52:45 +00:00
Dave Syer 27ae6a5fd6 Add ApplicationListener as first class component in Spring Application 2014-01-07 17:52:45 +00:00
Phillip Webb 751beda2cb Additional fixes for auto-configuration report
Fix the following issues that were introduced in commit 0610378:

- Formatting of code including imports
- Improve hashcode/equals implementations by using ObjectUtils
- Provide hashcode/equals for ConditionOutcome
- Use LinkedHashSet in ConditionAndOutcomes to maintain insert order

Fixed gh-127
2014-01-06 10:52:33 -08:00
Greg Turnquist 0610378d2f Resolves #127: Prevent duplicate report outcomes
The collection of outcomes is a list. Sometimes a race condition causes to instances
of the same outcome to get added to the list shown in the report. By replacing this
with a set and propery equals/hashCode, duplicates are prevented from appearing
in the report.

I added test cases to prove that that POJO is properly managed inside a Set and also
to show that duplicates don't appear in the final report.
2014-01-06 10:42:16 +00:00
Dave Syer c71322a0b2 Add a BatchConfigurer so the transaction manager can adapt to JPA
Autoconfiguration ordering has to be adjusted so that a DataSource is
available before an EntityManagerFactory is ever needed. Previously
the autoconfigs were accidentally loaded in the right order, but after
the change to BatchAutoConfiguration the order has to be explicit.

Fixes gh-189
2014-01-06 10:41:49 +00:00
Phillip Webb 1bcd3de7b5 Polish 2014-01-02 12:10:37 -08:00
Phillip Webb 7623c291a2 Attempt to fix failing CI build 2014-01-02 10:23:58 -08:00
Oliver Gierke d39a8360b7 Added support to allow manually declaring a EntityManagerFactoryBean.
Added the necessary @ConditionalOnMissingBean annotations to allow selectively declaring an EntityManagerFactoryBean, a JpaVendorAdapter or a PlatformTransactionManager. Especially the first one might be necessary to make sure the persistence provider evaluates an orm.xml. This unfortunately rules out using the packages to scan feature of Spring's LCEMFB.

I've filed https://jira.springsource.org/browse/SPR-11260 to potentially remove the need for this workaround in Spring itself.
2013-12-28 13:34:45 +01:00
Dave Syer fe1336edcc Add JobExplorer and JobOperator 2013-12-26 14:23:21 +00:00
Dave Syer c94fb7fc53 Fix bizarre compiler error 2013-12-23 22:12:54 +00:00
Dave Syer 6c4ee0b05d Add PoolConfig to Redis 2013-12-23 12:28:24 +00:00
Dave Syer fa507005cd Use ServletWrappingController for jolokia instead of Servlet
We get more control over the handling and in particular the registration
of the endpoint this way. It was practically impossible to disable the
AgentServlet bean when in a parent context of the management server
because of lifecyce issues - you don't know that the user wants a
separate management server until too late.

This approach also makes it possible to test with spring-test MVC
support.
2013-12-20 19:49:48 +00:00
Dave Syer e2c962ac28 Switch to thymeleaf-spring4 2013-12-19 13:40:24 +00:00
Christian Dupuis b694556483 Set JMX export on by default 2013-12-19 08:47:22 +01:00
Phillip Webb dbec81cabe Disable jmx by default
Change JmxAutoConfiguration so that by default JMX exposure is not
enabled. This matches the Javdoc text.
2013-12-18 22:32:39 -08:00
Phillip Webb 7c57541d50 Filter duplicates from SpringFactories loading
Filter duplicate class names when loading spring.factories files. The
prevents errors if -source jars are included on the classpath.

fixes gh-161
2013-12-18 09:55:06 -08:00
Dave Syer 997b015d10 Split SecurityAutoConfiguration
Spring Security 3.2 has a new annotation @EnableWebMvcSecurity that we
should use if MVC is being used.
2013-12-17 17:17:05 +00:00
Dave Syer 72bfd4ce68 Protect HttpMessageConverters if MVC is not available 2013-12-17 17:17:05 +00:00
Dave Syer 3789424f22 Add JodaModule bean if detected on classpath
Fixes gh-146
2013-12-17 14:22:18 +00:00
Dave Syer bdcb94a139 Remove initialization concerns fom HttpMessageConverters 2013-12-17 09:02:16 +00:00
Phillip Webb 513c6a1de2 Polish 2013-12-16 14:38:52 -08:00
Phillip Webb 85fb1cba0b Rework HttpMessageConverters 2013-12-16 14:38:48 -08:00
Dave Syer b72002142d Split MessageConverters auto config out into separate class 2013-12-16 16:13:39 +00:00
Dave Syer c78973e375 MessageConverters -> HttpMessageConverters 2013-12-15 13:33:50 +00:00
Dave Syer 370501f4a9 Add test and fix bug in MessageConverters 2013-12-15 10:06:27 +00:00
Dave Syer c2b499c775 Support for @Beans of type HttpMessageConverter, and Jackson specific details
You can contribute additional HttpMessageConverters
by simply adding beans of that type in a Spring Boot
context. If a bean you add is of a type that would have been included
by default anyway (like MappingJackson2HttpMessageConverter for JSON
conversions) then it will replace the default value. A convenience
bean is provided of type MessageConverters (always available if you
use the default MVC configuration) which has some useful methods to
access the default and user-enhanced message converters (useful, for
example if you want to manually inject them into a custom
RestTemplate).

There are also some convenient configuration shortcuts for Jackson2.
The smallest change that might work is to just add beans of type
Module to your context. They will be registered with the default
ObjectMapper and then injected into the default message
converter. In addition, if your context contains any beans of type
ObjectMapper then all of the Module beans will be registered with
all of the mappers.
2013-12-14 22:05:30 +00:00
Christian Dupuis 2b16a4af39 Fix failing test due to change in JMX export default setting 2013-12-13 23:32:53 +01:00
Dave Syer c40d0aba0d Document switching off DispatcherServlet 2013-12-12 17:32:58 +00:00
Christian Dupuis 5c6a0fd472 Enabled JMX export auto configuration by default 2013-12-12 17:52:33 +01:00
Dave Syer 9c2b34f188 Allow default DispatcherServlet to be switched off more easily
All a user has to do now is declare a bean with name "dispatcherServlet".
2013-12-12 16:47:09 +00:00
Christian Dupuis b931cce386 Auto configuration support for JMX export 2013-12-11 21:31:10 +01:00
Dave Syer cf05a5d578 Fix @Conditional for Batch command line runner
Previously it was @ConditionalOnMissingBean(CommandLineRunner.class)
which caued obvious problems when user wanted to add an unrelated
CLR.

Extended feature set so that a JobRegistry can also be used (with
spring.batch.job.name) and the whole idea can be switched off with
spring.boot.job.enabled.
2013-12-11 14:00:20 +00:00
Dave Syer cf53b76430 Remove another annotation= attribute
Hopefully really fixes gh-151
2013-12-10 17:14:27 +00:00
Dave Syer ed8d161d33 Remove debug logging on stderr 2013-12-10 09:24:32 +00:00
Dave Syer 2543ef7072 Change @Conditional for existing security configuration
Fixed by using `WebSecurityConfiguration` to detect existing
security configuration (not the annotation).

Fixes gh-151
2013-12-09 09:48:40 +00:00
Dave Syer f57c8f52bf Check for null before trying to use ApplicationContext
Fixes gh-145
2013-12-05 08:54:13 +00:00
Dave Syer 33c38b3a51 Remove inaccurate TODO 2013-12-04 14:57:44 +00:00
Dave Syer 322b03779d Upgrade Thymeleaf and Spring 2013-12-03 12:30:31 +00:00
Dave Syer 2104d9a1e2 Prevent failure of web app with parent context
ServerProperties formerly had an @OnMissingBeanCondition
that didn't restrict the hierarchy. It also asserts that
the current context (not including parents) contains such
a bean. This led to an inevitable failure when there was
an existing instance in the parent context.

Fixed by a) searching only the current context, b) not
adding a ServerProperties bean if the context is not a
web app.
2013-11-29 17:40:16 +00:00
Dave Syer c03a06b52d Add test for customize container factory 2013-11-29 17:26:17 +00:00
Dave Syer 4a60e3ccf6 Unignore condition tests 2013-11-29 17:20:30 +00:00
Dave Syer a4cb09c4eb Unignore some tests 2013-11-29 17:12:54 +00:00
Dave Syer 259e6a6ec1 RedisProperties prefix -> spring.redis 2013-11-28 15:12:55 +00:00
Dave Syer 16222270b8 Improve reporting of SpEL condition matching 2013-11-28 13:08:19 +00:00
Dave Syer 20bede21ad Add support for parent hierarchy in AUtoConfigurationReport 2013-11-28 11:39:27 +00:00
Dave Syer d1dcb015b6 Ensure only supported listeners are instantiated
Previously all EventListeners were eagerly instantiated
but that can cause problems because it happens quite early
in the lifecycle. Better to be explicit about the
supported types.
2013-11-27 15:04:05 +00:00
Dave Syer 7ef9688d99 Javadocs clarification of role of DispatcherServlet 2013-11-27 10:21:38 +00:00
Dave Syer 94e2f90793 Ensure endpoints.jolokia.enabled=false switches off jolokia 2013-11-26 13:27:10 +00:00
Phillip Webb f4f668a52b Polish 2013-11-25 17:12:56 -08:00
Dave Syer a9e4400f82 Add test for PropertyPlaceholderAutoConfiguration 2013-11-25 16:07:07 +00:00
Dave Syer 8efa2fc569 Use server.port=0 for scanning
This leverages existing capabilities of teh JDK and the OS
to grab a port at random and not have it stolen by another
process. It's very hard to avoid that race condition in
pure Java code, so why bother?

User can set port<0 to disable autoStart of connectors (e.g.
to start a web application context but not have it listen on
any port). In that case the actual socket port will be set to
0 (and therefore if it ever starts up the local port will
be random).
2013-11-23 11:26:58 +00:00
Dave Syer 59f07d37ab Scan for port near default 2013-11-22 19:59:19 +00:00
Dave Syer 61dd7d1dbb Add port scan to ServerProperties (server.scan=true)
Also moved ServerProperties to autoconfigure project.
2013-11-22 16:56:43 +00:00
Dave Syer bd26b28aa5 Extract actuator security into separate classes
So spring-security + a web app is secure by default
(you don't need the actuator).
2013-11-21 16:47:29 +00:00
Dave Syer 285dd5b270 ApplicationContextInitializers now listen for ContextRefreshedEvent
The AutoConfigurationReportLoggingInitializer wasn't working in
non-GenericApplicationContext becasue teh BeanFatcory wasn't available
for registering its listener during initialization. Instead of
relying on that rather fragile state I decided to give any
ApplicationContextInitializer that was itself an ApplicationListener
an explicit callback with a ContextRefreshedEvent, and move that
interface up a level in the logging initializer. Works much better.
2013-11-21 09:35:00 +00:00
Dave Syer 06c16ae452 Only check for singleton in AutoConfigurationReportLoggingInitializer
Using containsBean() involves looking in the parent bean factory
if there is one, and that would mean that the same report woykd be used
for multiple contexts, which wouldn't make sense.
2013-11-20 11:42:32 +00:00
Dave Syer faf02a21ab Prevent @Bean method from being called during @PreDestroy 2013-11-20 11:19:54 +00:00
Dave Syer fce48c00c7 Really fix it 2013-11-20 09:10:25 +00:00
Dave Syer 71cd1926b9 Fix test on command line 2013-11-20 08:58:45 +00:00
Dave Syer 156ef3f1a0 Weird build problem? 2013-11-19 09:16:37 +00:00
Dave Syer ded9020916 Allow Batch datbase initializer to be disabled 2013-11-19 09:03:43 +00:00
Dave Syer 60f3dd9386 Be defensive about adding autoconfig report bean 2013-11-19 09:03:43 +00:00
Dave Syer 640b9d2680 Add RedisAutoConfiguration 2013-11-18 10:54:33 +00:00
Dave Syer 2f7214002d Update Spring to catch SPR-11069 2013-11-17 07:59:16 +00:00
Phillip Webb 64f32893bb Source format and clean-up 2013-11-16 00:08:18 -08:00
Phillip Webb 883fd9162f Polish 2013-11-16 00:08:17 -08:00
Dave Syer 11149443e3 Make sure Batch autoconfig only gets inlcuded once 2013-11-14 14:55:03 +00:00
Phillip Webb dafeddca09 Rework auto-configure report
Update the auto-configuration report to improve log formatting and to
separate the internal report data-structure from the JSON friendly
endpoint data-structure.
2013-11-06 21:40:05 -08:00
Phillip Webb 04fd7fdbbe Improve message used on match
Update OnBeanCondition and OnClassCondition to improve the message used
on a successful match.
2013-11-06 21:31:58 -08:00
Phillip Webb ab249b034d Rename Outcome -> ConditionOutcome 2013-11-06 15:40:09 -08:00
Phillip Webb a9a6077fdb Polish SpringApplicationErrorHandler 2013-11-06 15:40:09 -08:00
Phillip Webb 68e07eba5c Minor formatting polish 2013-11-06 15:40:09 -08:00
Dave Syer 51f240c1d5 Jpa auto configuration updates for new Spring Data release
User now gets @EnableSpringDataWebSupport for free in any
autoconfigured JPA webapp.

[Fixes #53028329] [bs-216]
2013-11-06 13:02:27 +00:00
Phillip Webb 4c75700164 Detect Tomcat start failures
Detect if the tomcat container fails to start and propagate an
exception to the caller.
2013-11-05 17:00:14 -08:00
Dave Syer fa998287ab Only log report if INFO enabled 2013-11-05 11:28:01 +00:00
Dave Syer 5ab2b472a8 Be more lax with --debug parsing 2013-11-05 10:21:54 +00:00
Dave Syer c6efac87f5 Shorten field names a bit 2013-11-05 09:02:43 +00:00
Phillip Webb d784cb6a88 Apply eclipse-formatter conventions 2013-11-04 10:25:27 -08:00
Dave Syer 0def447750 More care required getting beans early in lifecycle 2013-11-04 18:16:30 +00:00
Dave Syer 0c79c8913f Ensure AutoConfigurationReport is always present 2013-11-04 17:07:04 +00:00
Greg Turnquist b63016d8fc Create a report based on Boot's autoconfiguration decisions
- Gather autoconfiguration conditional decisiions (true and false)
- Provide an actuator endpoint as one means to read the report
- Define @EnableAutConfigurationReport annotation to turn this feature on
- Tidy up autoconfig report a bit and log it if --debug=true
2013-11-04 17:07:04 +00:00
Christian Dupuis 368f279788 Fix failing database test on 1.7 2013-11-04 17:32:28 +01:00
Christian Dupuis 90a2bf38da Ignore DataSourceAutoConfigurationTests.testExplicitDriverClassClearsUserName() as it fails without running mysql instance 2013-11-04 17:22:02 +01:00
Dave Syer 09de86fde8 Fix test broken by MySQL dependency 2013-11-04 16:16:06 +00:00
Dave Syer 97e6d77711 Do not default username/password for DataSource unless embedded
To use a DataSource pool (Tomcat or DBCP) the user must supply a valid
driver class name *and* database URL. If both are supplied and the
driver class is not one of the embedded ones, then no default username
or password is provided.

Fixes gh-94
2013-11-04 13:35:59 +00:00
Dave Syer 894940d7aa Add test for dispatcher registration 2013-11-04 13:35:59 +00:00
Dave Syer 9f48376cbc Remove unused argument (causes autowiring issues) 2013-10-31 14:52:14 +00:00
Phillip Webb a9c9c383f4 Polish pom.xml
Aplly consistent formatting, drop JDK 8 support and cleanup repo
locations to use spring.io.
2013-10-28 07:37:02 -07:00
Dave Syer a4c0733d4a Revert aspectj to default version 2013-10-25 09:54:41 -04:00
Dave Syer 18ee229748 Add support for annotation scan in @ConditionalOn*Bean 2013-10-24 12:39:33 -04:00
Dave Syer 86a369b955 Add renamed Rabbit config to factories 2013-10-24 12:39:33 -04:00
Dave Syer 276f9b784c Add virtual host to Rabbit config 2013-10-24 12:39:33 -04:00
Dave Syer 0498617411 Disable whitelabel view if Thymeleaf error.html detected 2013-10-23 10:48:14 -04:00
Dave Syer e789840b3c Adjust db type if postgres 2013-10-23 08:36:31 -04:00
Andy Wilkinson e5e511fd43 Reinstate use of hasMappingForPattern
Use of hasMappingForPattern was commented out during work on the
Aether-based Grape implementation as it was temporarily removed in 
Spring 4's snapshots. It's since been reinstated in the snapshots, so
its use should have been reinstated prior to merging Aether work into
master.
2013-10-22 17:20:37 +01:00
Andy Wilkinson 39e8e46e2a Provide an Aether-based Grape Engine
Previously, @Grab annotations would use Ivy to download the
dependencies with some of Ivy's known limitations being worked around
by GrapeEngineCustomizer.

This commit adds a GrapeEngine implementation that uses Aether,
the dependency resolution 'engine' used by Maven and Grails. To ensure
consistent behaviour with a Maven build, the Aether-powered dependency
resolution uses the dependency management configuration from the
spring-boot-starter-parent pom file.
2013-10-22 16:06:53 +01:00
Andy Wilkinson a28947f276 Move database files into target directory 2013-10-22 15:58:56 +01:00
Dave Syer 43f8a71af4 Ensure JdbcTemplate and DB initializer still work when user supplies DataSource 2013-10-16 13:43:59 -04:00
Dave Syer 837070d6e9 Tidy up log message (add space) 2013-10-15 16:51:58 -04:00
Dave Syer acf458b462 Standardize on spring.datasource.* for database config
[Fixes #58921238] [bs-333] spring.database.* and
spring.datasource.* used to configure database
2013-10-15 16:39:59 -04:00
Dave Syer b7ed5bbc76 Revert "Temporary fix for Spring snapshot changes"
This reverts commit 8a804f6185.
2013-10-15 10:16:29 -04:00
Dave Syer 8a804f6185 Temporary fix for Spring snapshot changes 2013-10-15 09:56:19 -04:00
Dave Syer 0ec2d19e38 Add spring.thymeleaf.encoding to ThymeleafAutoConfiguration
Both the template resolver and the view resolver now have their
encoding set explicitly (defaulting to UTF-8).

Fixes gh-79
2013-10-10 09:58:09 -04:00
Dave Syer 2c60828cf2 Ensure ServerProperties default values does not override
Since ServerProperties had primitive properties for port (in
particular) it was not possible to check when applying those
properties if the user had actually changed the value. This
in turn meant that a custom EmbeddedServletContainerFactory
could not set the default values.

Fixed by making int properties of ServerProperties into
Integer and checking for null before setting on the
container factory.

Fixes gh-84
2013-10-10 09:46:14 -04:00
Dave Syer 64d9f4f18d Allow user to override static resource handler mappings
A new API in Spring allows us to check for existing mappings in the
resource handler registry
2013-10-09 13:13:39 -04:00
Phillip Webb af0d08c998 Polish 2013-10-08 21:17:39 -07:00
Phillip Webb b772f7c2e4 Polish
Minor formatting and consistent copyright header.
2013-10-08 20:30:45 -07:00
Roy Clarkson 5cdaa43912 Add Spring Mobile Device Resolver autoconfiguration 2013-10-08 17:43:09 -04:00
Dave Syer 3b2abe9c17 Use create_drop JPA as default if in-memory
[Fixes #55277582] [bs-288]
2013-10-07 17:38:08 -04:00