Commit Graph

321 Commits (c0cf31cfd87724335f2affba69b5d752644c97eb)

Author SHA1 Message Date
Christian Dupuis efe8494f46 Remove hard coded bean names for couple of @ConfigurationProperties beans 11 years ago
Phillip Webb bcd74bb72d Remove custom JodaModule support
Remove the custom JodaModule support which is not necessary with
Spring 4.0.1.

Fixes gh-186
11 years ago
Phillip Webb b34102c30c Polish 11 years ago
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
11 years ago
Dave Syer 8d05cd1fb6 Allow hibernate.version as synonym in dependency management 11 years ago
Dave Syer 19ca4d4eae Add destroyMethods to DataSources 11 years ago
Dave Syer 76b15c4446 Add spring.messages.encoding (default utf-8)
Fixes gh-260
11 years ago
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
11 years ago
Dave Syer 195eb9f9bc Updates to redis repositories
* Ensure prefix ends with period
* Allow prefix and key index to be set separately
11 years ago
Phillip Webb 43e54d38f7 Make fields private where possible 11 years ago
Phillip Webb 0160760568 Apply latest eclipse cleanup rules 11 years ago
Phillip Webb ac54d7fe3c Final polish before 1.0.0.RC1 11 years ago
Phillip Webb cdda330acd Update copyright header for files changed in 2014 11 years ago
Dave Syer ea3b82091b Tweak javadocs in SprinApplicationBuilder 11 years ago
Dave Syer 8f4059147c Revert "Upgrade to Tomcat 7.0.50"
This reverts commit 3d60696b9b.
11 years ago
Phillip Webb 68293f34af Upgrade version to 1.0.0.BUILD-SNAPSHOT
Fixes fg-243
11 years ago
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
11 years ago
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
11 years ago
Dave Syer 8db1d0e044 Fix some TODOs 11 years ago
Dave Syer 07da034571 Allow @EnableTransactionManagement to be supplied by user 11 years ago
Christopher Smith 25cc68cafe Add spring.resources.cachePeriod to MvcAutoConfiguration
Fixes gh-232
11 years ago
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
11 years ago
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
11 years ago
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
11 years ago
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
11 years ago
Andy Wilkinson b45683f103 Only auto-configure Reduce if Lettuce is on the classpath
Fixes #226
11 years ago
Phillip Webb ffe8bf5419 Remove unused .gitignore files 11 years ago
Phillip Webb 47da8a817a Polish 11 years ago
Christian Dupuis 62e02d3d81 Add initialSize configuration property to datasource auto configuration
fixes #206
11 years ago
Christian Dupuis 1a44b3e676 Fix sorting of auto configuration classes on JDK 8 11 years ago
Dave Syer 2377bd9ec9 Don't load BatchAutoConfiguration at all if there is no JobLauncher
Fixes gh-204
11 years ago
Dave Syer b1db714c23 Allow @EnableGlobalMethodSecurity in a non webapp
Fixes gh-202
11 years ago
Dave Syer aebaa580db Add test for user overriding @EnableJpaRepositories 11 years ago
Dave Syer c8152bfc70 SpringBootTestUtils->EnvironmentTestUtils 11 years ago
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
11 years ago
Dave Syer 561cb3a50f TestUtils -> SpringBootTestUtils 11 years ago
Dave Syer 321ce3aad2 TestUtils -> SpringBootTestUtils 11 years ago
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
11 years ago
Dave Syer 633dea9d80 Add declarative ApplicationListener 11 years ago
Dave Syer 441572c61c Migrate config file initializer to a listener 11 years ago
Dave Syer 3dacf4be17 Migrate Logging and Liquibase initializers to be listeners 11 years ago
Dave Syer 27ae6a5fd6 Add ApplicationListener as first class component in Spring Application 11 years ago
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
11 years ago
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.
11 years ago
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
11 years ago
Phillip Webb 1bcd3de7b5 Polish 11 years ago
Phillip Webb 7623c291a2 Attempt to fix failing CI build 11 years ago
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.
11 years ago
Dave Syer fe1336edcc Add JobExplorer and JobOperator 11 years ago
Dave Syer c94fb7fc53 Fix bizarre compiler error 11 years ago
Dave Syer 6c4ee0b05d Add PoolConfig to Redis 11 years ago
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.
11 years ago
Dave Syer e2c962ac28 Switch to thymeleaf-spring4 11 years ago
Christian Dupuis b694556483 Set JMX export on by default 11 years ago
Phillip Webb dbec81cabe Disable jmx by default
Change JmxAutoConfiguration so that by default JMX exposure is not
enabled. This matches the Javdoc text.
11 years ago
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
11 years ago
Dave Syer 997b015d10 Split SecurityAutoConfiguration
Spring Security 3.2 has a new annotation @EnableWebMvcSecurity that we
should use if MVC is being used.
11 years ago
Dave Syer 72bfd4ce68 Protect HttpMessageConverters if MVC is not available 11 years ago
Dave Syer 3789424f22 Add JodaModule bean if detected on classpath
Fixes gh-146
11 years ago
Dave Syer bdcb94a139 Remove initialization concerns fom HttpMessageConverters 11 years ago
Phillip Webb 513c6a1de2 Polish 11 years ago
Phillip Webb 85fb1cba0b Rework HttpMessageConverters 11 years ago
Dave Syer b72002142d Split MessageConverters auto config out into separate class 11 years ago
Dave Syer c78973e375 MessageConverters -> HttpMessageConverters 11 years ago
Dave Syer 370501f4a9 Add test and fix bug in MessageConverters 11 years ago
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.
11 years ago
Christian Dupuis 2b16a4af39 Fix failing test due to change in JMX export default setting 11 years ago
Dave Syer c40d0aba0d Document switching off DispatcherServlet 11 years ago
Christian Dupuis 5c6a0fd472 Enabled JMX export auto configuration by default 11 years ago
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".
11 years ago
Christian Dupuis b931cce386 Auto configuration support for JMX export 11 years ago
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.
11 years ago
Dave Syer cf53b76430 Remove another annotation= attribute
Hopefully really fixes gh-151
11 years ago
Dave Syer ed8d161d33 Remove debug logging on stderr 11 years ago
Dave Syer 2543ef7072 Change @Conditional for existing security configuration
Fixed by using `WebSecurityConfiguration` to detect existing
security configuration (not the annotation).

Fixes gh-151
11 years ago
Dave Syer f57c8f52bf Check for null before trying to use ApplicationContext
Fixes gh-145
11 years ago
Dave Syer 33c38b3a51 Remove inaccurate TODO 11 years ago
Dave Syer 322b03779d Upgrade Thymeleaf and Spring 11 years ago
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.
11 years ago
Dave Syer c03a06b52d Add test for customize container factory 11 years ago
Dave Syer 4a60e3ccf6 Unignore condition tests 11 years ago
Dave Syer a4cb09c4eb Unignore some tests 11 years ago
Dave Syer 259e6a6ec1 RedisProperties prefix -> spring.redis 11 years ago
Dave Syer 16222270b8 Improve reporting of SpEL condition matching 11 years ago
Dave Syer 20bede21ad Add support for parent hierarchy in AUtoConfigurationReport 11 years ago
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.
11 years ago
Dave Syer 7ef9688d99 Javadocs clarification of role of DispatcherServlet 11 years ago
Dave Syer 94e2f90793 Ensure endpoints.jolokia.enabled=false switches off jolokia 11 years ago
Phillip Webb f4f668a52b Polish 11 years ago
Dave Syer a9e4400f82 Add test for PropertyPlaceholderAutoConfiguration 11 years ago
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).
11 years ago
Dave Syer 59f07d37ab Scan for port near default 11 years ago
Dave Syer 61dd7d1dbb Add port scan to ServerProperties (server.scan=true)
Also moved ServerProperties to autoconfigure project.
11 years ago
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).
11 years ago
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.
11 years ago
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.
11 years ago
Dave Syer faf02a21ab Prevent @Bean method from being called during @PreDestroy 11 years ago
Dave Syer fce48c00c7 Really fix it 11 years ago
Dave Syer 71cd1926b9 Fix test on command line 11 years ago
Dave Syer 156ef3f1a0 Weird build problem? 11 years ago
Dave Syer ded9020916 Allow Batch datbase initializer to be disabled 11 years ago
Dave Syer 60f3dd9386 Be defensive about adding autoconfig report bean 11 years ago
Dave Syer 640b9d2680 Add RedisAutoConfiguration 11 years ago
Dave Syer 2f7214002d Update Spring to catch SPR-11069 11 years ago
Phillip Webb 64f32893bb Source format and clean-up 11 years ago
Phillip Webb 883fd9162f Polish 11 years ago
Dave Syer 11149443e3 Make sure Batch autoconfig only gets inlcuded once 11 years ago
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.
11 years ago
Phillip Webb 04fd7fdbbe Improve message used on match
Update OnBeanCondition and OnClassCondition to improve the message used
on a successful match.
11 years ago
Phillip Webb ab249b034d Rename Outcome -> ConditionOutcome 11 years ago
Phillip Webb a9a6077fdb Polish SpringApplicationErrorHandler 11 years ago
Phillip Webb 68e07eba5c Minor formatting polish 11 years ago
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]
11 years ago
Phillip Webb 4c75700164 Detect Tomcat start failures
Detect if the tomcat container fails to start and propagate an
exception to the caller.
11 years ago
Dave Syer fa998287ab Only log report if INFO enabled 11 years ago
Dave Syer 5ab2b472a8 Be more lax with --debug parsing 11 years ago
Dave Syer c6efac87f5 Shorten field names a bit 11 years ago
Phillip Webb d784cb6a88 Apply eclipse-formatter conventions 11 years ago
Dave Syer 0def447750 More care required getting beans early in lifecycle 11 years ago
Dave Syer 0c79c8913f Ensure AutoConfigurationReport is always present 11 years ago
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
11 years ago
Christian Dupuis 368f279788 Fix failing database test on 1.7 11 years ago
Christian Dupuis 90a2bf38da Ignore DataSourceAutoConfigurationTests.testExplicitDriverClassClearsUserName() as it fails without running mysql instance 11 years ago
Dave Syer 09de86fde8 Fix test broken by MySQL dependency 11 years ago
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
11 years ago
Dave Syer 894940d7aa Add test for dispatcher registration 11 years ago
Dave Syer 9f48376cbc Remove unused argument (causes autowiring issues) 11 years ago
Phillip Webb a9c9c383f4 Polish pom.xml
Aplly consistent formatting, drop JDK 8 support and cleanup repo
locations to use spring.io.
11 years ago
Dave Syer a4c0733d4a Revert aspectj to default version 11 years ago
Dave Syer 18ee229748 Add support for annotation scan in @ConditionalOn*Bean 11 years ago
Dave Syer 86a369b955 Add renamed Rabbit config to factories 11 years ago
Dave Syer 276f9b784c Add virtual host to Rabbit config 11 years ago
Dave Syer 0498617411 Disable whitelabel view if Thymeleaf error.html detected 11 years ago
Dave Syer e789840b3c Adjust db type if postgres 11 years ago
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.
11 years ago
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.
11 years ago
Andy Wilkinson a28947f276 Move database files into target directory 11 years ago
Dave Syer 43f8a71af4 Ensure JdbcTemplate and DB initializer still work when user supplies DataSource 11 years ago
Dave Syer 837070d6e9 Tidy up log message (add space) 11 years ago
Dave Syer acf458b462 Standardize on spring.datasource.* for database config
[Fixes #58921238] [bs-333] spring.database.* and
spring.datasource.* used to configure database
11 years ago
Dave Syer b7ed5bbc76 Revert "Temporary fix for Spring snapshot changes"
This reverts commit 8a804f6185.
11 years ago
Dave Syer 8a804f6185 Temporary fix for Spring snapshot changes 11 years ago
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
11 years ago
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
11 years ago
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
11 years ago
Phillip Webb af0d08c998 Polish 11 years ago
Phillip Webb b772f7c2e4 Polish
Minor formatting and consistent copyright header.
11 years ago
Roy Clarkson 5cdaa43912 Add Spring Mobile Device Resolver autoconfiguration 11 years ago
Dave Syer 3b2abe9c17 Use create_drop JPA as default if in-memory
[Fixes #55277582] [bs-288]
11 years ago
Dave Syer bbec4f7cf5 Make default proxyTargetClass=false
If the default is true JPA repositories all have to have
default constructors etc.
11 years ago