Commit Graph

263 Commits

Author SHA1 Message Date
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