Commit Graph

1620 Commits

Author SHA1 Message Date
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
Dave Syer
bbec4f7cf5 Make default proxyTargetClass=false
If the default is true JPA repositories all have to have
default constructors etc.
2013-10-07 17:37:54 -04:00
Eberhard Wolff
c6e0c76341 Added test for AOP auto configuration and dependency to AspectJ 2013-10-07 11:55:54 -04:00
Dave Syer
dfb660aa87 Add schema.sql,data.sql to default SQL initializers
...for compatibility with Spring JDBC. Users can still
optionally specify spring.database.schema, but the default
location is schema-${spring.database.platform}.sql, schema.sql,
data.sql.

[Fixes #58332710]
2013-10-07 08:14:14 -04:00
Dave Syer
5fe9ef69c7 Add SpringApplicationContextLoader 2013-10-02 15:07:04 -04:00
Dave Syer
345c0fc5a4 Add SpringApplicationBuilder
Builder for SpringApplication and ApplicationContext instances with
convenient fluent API and context hierarchy support. Simple example
of a context hierarchy:

   new SpringApplicationBuilder(ParentConfig.class)
               .child(ChildConfig.class).run(args);

Another common use case is setting default arguments, e.g.
active Spring profiles, to set up the environment for an application:

     new SpringApplicationBuilder(Application.class).profiles("server")
 		.defaultArgs("--transport=local").run(args);

If your needs are simpler, consider using the static convenience
methods in SpringApplication instead.

[#49703716] [bs-116] Parent context for some beans maybe?
2013-10-02 07:06:12 -04:00
Dave Syer
3879afccfb Important: restrict PPC scanning to current context 2013-10-02 06:41:29 -04:00
Dave Syer
0df4156b57 Lazy initialization of management server properties 2013-10-02 06:41:21 -04:00
Dave Syer
5b1503d07d Extract DispatcherServletAutoConfiguration so it can be used independently 2013-10-02 06:39:28 -04:00
Dave Syer
52e0193d95 Refactor Rabbit and JMS to avoid bean name clash 2013-09-27 10:17:21 -04:00
Dave Syer
923f286ae2 Add spring.view.{prefix,suffix} properties
Fixes #62
2013-09-27 09:34:10 -04:00
Dave Syer
9bb6e0f497 Fix test 2013-09-26 12:14:24 -04:00
Greg Turnquist
941d163709 Add support for Spring Rabbit (via Spring AMQP) to Boot
- If RabbitTemplate is on the classpath, turn on autodetection.
- Create a RabbitTemplate, a Rabbit ConnectionFactory, and a RabbitAdmin is spring.rabbitmq.dynamic:true
- Enable some **spring.rabbitmq** properties like host, port, username, password, and dynamic
- Add tests to verify functionality
- Add Groovy CLI functionality. Base it on @EnableRabbitMessaging. Add spring-amqp to the path.
- Create rabbit.groovy test to prove it all works.
- Make Queue and TopicExchange top-level Spring beans in rabbit.groovy test script
2013-09-26 12:14:06 -04:00
Greg Turnquist
fa6e6fde6c Add JMS autoconfig support
* application.properties support for spring.jms and spring.activemq

* more tests to verify ActiveMQConnectionFactory pooling

* Groovy support and simple sample with activemq

* Groovy detection mechanism is @EnableJmsMessaging annotation
2013-09-26 11:53:06 -04:00
Phillip Webb
26303a9767 Ensure DataSource can load database driver
Update DataSource conditional to ensure that the driver class
can actually be loaded by the DataSource. This fixes an issue when
deploying a classic WAR where `org.apache.tomcat.jdbc.pool.DataSource`
is found the parent classloader but the database driver cannot be loaded
because is included as a local `/lib` dependency.
2013-09-25 19:49:58 -07:00
Phillip Webb
c544921eaa Polish whitespace 2013-09-24 15:42:45 -07:00
Oliver Gierke
604b9069b1 #58 - Upgraded Spring Data JPA dependencies to Babbage release train.
Adapted to changes in the API in Spring Data Commons which requires to pass in the current Environment into the AnnotationRepositoryConfigurationSource.
2013-09-24 08:45:05 +01:00
Phillip Webb
fd9e258d12 Replace 'springsource.org' with 'spring.io'
Replace all references to 'springsource.org' with the new 'spring.io'
domain.
2013-09-23 14:44:59 -07:00
Dave Syer
5925e153b4 Make sure JMS is on classpath as well 2013-09-20 10:27:42 +01:00
Phillip Webb
9a529b41c1 Polish 2013-09-18 12:50:47 -07:00
Greg Turnquist
5801e422cf [BS-48] Add autoconfigured JMS support
* Add ability to detect spring-jms on the path and create a JmsTemplate with
  ActiveMQConnectionFactory
* Create tests showing autoconfigured JmsTemplate with ActiveMQ, but prove it
  backs off if a separate ConnectionFactory exists.
* Add support to spring-boot-cli to that it detects JmsTemplate, DefaultMessageListenerContainer,
  or SimpleMessageListenerContainer, and turns on autoconfiguration as well as
  add proper @Grab's and import statements.
* Write a jms.groovy test showing proper CLI support

Simplify ActiveMQ configuration

Update ActiveMQ to 5.7.0
2013-09-18 17:52:14 +01:00
Dave Syer
4bb99e80d0 Upgrade to reactor M3 2013-09-15 12:37:07 -07:00
Dave Syer
e6c1586717 Fix off -by-one logic error 2013-09-12 09:31:29 -07:00
Dave Syer
191894a16a Add Mongo auto configuration
Spring Data Mongo is the only dependency so it doesn't
really need a new starter. Added a sample though.
2013-09-11 09:53:36 -07:00
Dave Syer
d06d202fd0 Add AopAutoConfiguration (also starter and sample)
A side effect is that spring-boot-starter-data-jpa needs
to include an aspectjweaver depdendency. Hope that doesn't
hurt anything else.

[Fixes #56780004]
2013-09-11 06:18:34 -07:00
Dave Syer
759aa785a7 Fix bug in datasource autoconfiguration
The AbstractDataSourceConfiguration had path= in its
@ConfigurationProperties by mistake (should have been value)
2013-09-05 17:15:16 -07:00
Dave Syer
38e565e920 Back to SNAPSHOT for dev 2013-09-05 17:15:15 -07:00
Dave Syer
b634b3bde6 Update to 0.5.0.M2 2013-09-05 17:15:15 -07:00
Dave Syer
c4223d645d Updated WebSocketAutoConfiguration to use @EnableWebSocket 2013-09-05 17:14:17 -07:00
Dave Syer
5fa0166dea Upgrade to Reactor 1.0.0.M2 2013-09-05 17:14:17 -07:00
Phillip Webb
6a227a2298 Move non-inherited JPA @Condition annotations
Move JPA @Condition annotations from JpaBaseConfiguration to
HibernateJpaAutoConfiguration since they are not inherited.
2013-09-05 17:14:16 -07:00
Phillip Webb
cb7cc3991b Make data-jpa conditional on DataSource bean 2013-09-05 17:14:16 -07:00
Phillip Webb
1c1f36c4ce Add support for web-jar resources
Include resource mapping for web-jar resources.

Issue: #55752928
2013-09-05 17:14:13 -07:00
Phillip Webb
a95494fe61 Remove '/resources/**' mapping and default servlet
Remove '/resources/**' mapping since it can cause problems with the
'/**' when the developer defines their own 'resources' sub-folder.

Also remove default servlet config since the resources mapping renders
it redundant.

Issue: #55494446
2013-09-05 17:14:13 -07:00
Dave Syer
43fc107437 Fix security config
The management endpoints were still all mixed up
with the user endpoints. Fixed that and extracted
user endpoints in to conditional block so not
protected if path explicitly set to empty string.

[#53029715]
2013-09-05 17:14:11 -07:00
Phillip Webb
2b54b6286f Rework database auto-configure
Rework several aspects of database auto-configuration:

- Use RelaxedPropertyResolver to obtain property values
- Extract EmbeddedDatabaseConnection from EmbeddedDatabaseConfiguration
- Rename several configuration classes for consistency

Issue: #53028397
2013-09-05 17:14:11 -07:00
Phillip Webb
2041a79970 Use RelaxedPropertyResolver in auto-configuration
Update several existing auto-configuration classes to use the new
RelaxedPropertyResolver.

This commit also rename the spring.template property to spring.thymeleaf
in case we wish to support more templating engines in the future.
2013-09-05 17:14:11 -07:00
Phillip Webb
d64a44547c Fix DataSourceConfiguration isTestOnReturn()
Fix setTestOnReturn to use isTestOnReturn.
2013-09-05 17:14:11 -07:00
Dave Syer
767aa43e31 Add WebSocketAutoConfiguration
Opinionated defaults for WebSockets:

* If spring-websocket is on the classpath and so is
the Tomcat WSci initializer then it is added to the context
* A DefaultSockJsService is added if none is present
* User has only to define @Beans of type WebSocketHandler with
name starting "/"
* Each one is converted to a SockJsHttpRequestHandler and
mapped to "/<beanName>/**"
2013-09-05 17:14:10 -07:00
Phillip Webb
94b182cc81 Allow hibernate naming strategy to be specified
Issue: #53028397
2013-09-05 17:14:09 -07:00
Phillip Webb
71946f9d83 Update WebMvcAutoConfiguration conditional bean
Change WebMvcAutoConfiguration to use WebMvcConfigurationSupport instead
of HanderAdapter as the @ConditionalOnMissingBean. This allows MVC to
be auto-configured even if you define additional HanderAdapters.

Issue: #55493342
2013-09-05 17:14:09 -07:00
Phillip Webb
d4fe320254 Update trace logging to include Hibernate SQL 2013-09-05 17:14:09 -07:00
Phillip Webb
6858c3987e Use Hibernate ImprovedNamingStrategy by default
Update HibernateJpaAutoConfiguration to use the ImprovedNamingStrategy
for better table and column names.

Issue: #55261888
2013-09-05 17:14:08 -07:00
Phillip Webb
7e3cb50a22 Polish 2013-09-05 17:14:08 -07:00
Phillip Webb
021fe45d83 Exclude spring-data-rest package from being stored
Update AutoConfigurationUtils to specifically exclude spring-data-rest
packages from being stored. This prevent missing class errors caused
when Spring Boot attempts to use @ComponentScan packages as the source
for JPA entities and reads annotations that are not on the classpath.

Issue: #55489346
2013-09-05 17:14:08 -07:00
Phillip Webb
fc841e0269 Move inner class to end of file for consistency 2013-09-05 17:14:08 -07:00
Dave Syer
d205d9404a Add additional ViewResolver configuration
The DispatcherServlet adds a default InternalViewResolver
which was used by some apps, but when the actuator was
available it added an "/error" bean and effectively
switched off the default view resolver. The net fix was
to add an InternalViewResolver at the same time as
adding any other ViewResolvers.

[Fixes #55357516] [bs-290] Actuator UI app cannot serve static index.html
2013-09-05 17:14:08 -07:00
Phillip Webb
3fc8752a37 Update autoconfigure README.md with --debug info 2013-09-05 17:13:36 -07:00
Phillip Webb
840fdeb50f Create common SpringBootCondition base class
Create a new SpringBootCondition that will log why a condition has
or has not been applied. The removes the need for ConditionLogUtils
and simplifies many of the existing condition implementations.

Issue: #55203236
2013-09-05 17:13:36 -07:00
Phillip Webb
4e83826b41 Polish 2013-09-05 17:13:35 -07:00
Phillip Webb
82ed7a676d Readme for auto-configuration 2013-09-05 17:13:35 -07:00
Phillip Webb
1ff76459db Polish ConditionalOn annotations
Update ConditionalOn annotations :
- Use consistent attribute names for OnClass and OnMissingClass
- Update javadoc
- Rename tests to reflect the annotation rather than the interface
2013-08-12 23:00:07 -07:00
Dave Syer
0d583deb27 Add CLASSPATH elements back to spring CLI script
Also add @WebConfiguration as a shortcut for groovy
scripts to get MVC behaviour (without a @Controller)

[#54926366]
2013-08-12 18:18:11 +01:00
Dave Syer
68e84f7d02 Add pool parameters to AbstractDataSourceConfiguration
* Exposed common pool properties in the base class for data source configuration
* Made it @ConfigurationProperties so it binds in strongly typed sense

[Fixes #53028455] [bs-214] Add pool parameters to AbstractDataSourceConfiguration
2013-08-12 11:16:34 +01:00
Dave Syer
56f5b3ad0f Add logging to dispatcher servlet condition 2013-08-12 10:39:04 +01:00
Dave Syer
0af9d2022a Allow user to supply servlets and filters and still get default DispatcherServlet
Instead of not installing one at all if there is any ServletContextInitializer,
Spring Boot will now install a DispatcherServlet if context does not contain one
already with the magic name "dispatcherServlet".

[Fixes #54674870] [bs-277]
2013-08-12 10:32:49 +01:00
Phillip Webb
00fc04c01e Simplify OnBeanCondition
Merge OnMissingBeanCondition into OnBeanCondition and simplify code.
Polish on bean conditions
2013-08-09 12:36:20 -07:00
Phillip Webb
82320b3525 Simplify OnWebApplicationCondition
Merge OnNotWebApplicationCondition into OnWebApplicationCondition and
simplify code.
2013-08-09 12:35:43 -07:00
Phillip Webb
7525eb31f1 Simplify OnClassCondition
Merge OnMissingClassCondition into OnClassCondition and simplify code.
2013-08-09 12:34:14 -07:00
Phillip Webb
cf655945aa Polish 2013-08-09 12:28:54 -07:00
Phillip Webb
8a33c39f0b Polish AutoConfigurationSorter 2013-08-07 16:29:41 -07:00
Dave Syer
33658c2933 Add @AutoConfigureBefore and simple implementation
[#54597932] [bs-273] Circular view reference for /error
2013-08-07 10:19:56 +01:00
Phillip Webb
4e11ae1671 Documentation
Various updates to README.md files.
2013-08-05 22:36:22 -07:00
Phillip Webb
1db22aca5c Rework POM structure
Rework main build POM to be an aggregator pom that does not inherit
from any parent. Introduce new spring-boot-dependencies module to
act as a parent for both spring-boot-starter-parent and
spring-boot-parent.
2013-08-02 21:58:24 -07:00
Dave Syer
4bb5de02e7 Switch back to SNAPSHOT for dev 2013-08-02 12:00:14 +01:00
Dave Syer
68e5a7e887 Bump version to 0.5.0.M1 2013-08-02 12:00:14 +01:00
Phillip Webb
e1c6860a41 Documentation 2013-08-02 00:34:53 -07:00
Phillip Webb
c83400d265 Move conditions from boot to autoconfigure
Issue: #54393078
2013-07-31 12:58:47 -07:00
Phillip Webb
36c3ceab97 Include servlet support for index.html resources
Issue: #54228642
2013-07-29 13:03:42 -07:00
Phillip Webb
772cc851a0 Polish WebMvcAutoConfiguration resource locations 2013-07-29 12:48:48 -07:00
Dave Syer
4c359e1a4d Two choices are available to users for welcome page
* For a jar deployment add classpath:static/index.html
(works via Spring MVC mapping)
* For a war the same thing works, but so does adding
index.html to src/main/webapp (works via container
default servlet)

[Fixes #54092261] [bs-252]
2013-07-29 11:57:44 +01:00
Phillip Webb
b665a2bb1d Renamed packages
Issue: #54095231
2013-07-26 14:11:04 -07:00
Phillip Webb
3f2bb03fb8 Renamed some projects and polish POMs
Issue: #54095231
2013-07-26 12:31:37 -07:00