Commit Graph

2209 Commits

Author SHA1 Message Date
Phillip Webb 88c84ce234 Merge branch '1.4.x' into 1.5.x 2016-11-22 14:53:30 -08:00
Phillip Webb b6b8bef009 Polish 2016-11-22 14:51:56 -08:00
Phillip Webb 7e2d0fd1c0 Check for Spring Data before configuring Couchbase
Add guard to `CouchbaseAutoConfiguration` so ensure that Spring Data
Couchbase is on the classpath.

Fixes gh-7453
2016-11-22 14:32:38 -08:00
Grigory Fadeev 1ea829e003 Fix connector used to configure connection timeout
Fix Tomcat customization so that the main connection is configured with
any timeout.

Closes gh-7425
2016-11-22 14:28:57 -08:00
Andy Wilkinson 65d0c07fd6 Polish "Validate excluded autoconfiguration classes"
- Apply code formatting
- Move configuration of excepted exception to immediately before line
  that will throw the exception
- Use String.format with %n to produce platform-specific new lines

See gh-7407
2016-11-22 14:10:37 +00:00
Madhura Bhave a9ffdca6f2 Validate excluded autoconfiguration classes
Closes gh-7407
See gh-6865
2016-11-22 14:02:51 +00:00
Andy Wilkinson ff4bbd9291 Fix javadoc and apply code formatting to Kafka contribution
See gh-6961
2016-11-22 11:34:29 +00:00
Andy Wilkinson 29f0ae3fa8 Use a random port in new tests in SpringBootWebSecurityConfigurationTests
See gh-7373
2016-11-22 11:03:05 +00:00
Stephane Nicoll cc07f56c87 Merge pull request #6961 from garyrussell:kafkaAutoConfig
* pr/6961:
  Polish "Apache Kafka support" contribution
  Add Apache Kafka support
2016-11-22 10:29:01 +01:00
Stephane Nicoll 642af52d01 Polish "Apache Kafka support" contribution
Closes gh-6961
2016-11-22 10:22:00 +01:00
Gary Russell c4188c8e4a Add Apache Kafka support
See gh-6961
2016-11-22 09:34:01 +01:00
Andy Wilkinson 5a9fc9aa49 Merge branch '1.4.x' into 1.5.x 2016-11-21 13:35:22 +00:00
Andy Wilkinson 3464c0b16e Ensure that Hypermedia-related auto-config works without Jackson
Previously, both HypermediaAutoConfiguration and HttpMessageConverters
assumed that if Spring HATEOAS was on the class path, then Jackson
would be too. When this was not the case, an application would fail
to start.

This commit updates both classes to back off appropriately when
Spring HATEOAS is on the classpath but Jackson is not.

Closes gh-7434
2016-11-21 13:25:25 +00:00
Stephane Nicoll 9423b9831c Merge branch '1.4.x' into 1.5.x 2016-11-20 15:52:49 +09:00
Stephane Nicoll 249ed899a6 Fix use of KB and MB in Multipart documentation
Closes gh-7364
2016-11-20 15:51:47 +09:00
Phillip Webb 1657120286 Move ModifiedClassPathRunner to its own module
Migrate `ModifiedClassPathRunner` from `spring-boot` test source to
its own module.

Fixes gh-7420
2016-11-18 17:27:54 -08:00
Phillip Webb 9e18021e8c Merge branch '1.4.x' into 1.5.x 2016-11-18 15:59:05 -08:00
Phillip Webb fce17ca6d9 Polish 2016-11-18 15:50:19 -08:00
Andy Wilkinson 1cd781b242 Make spring-boot-test compatible with Mockito 2.1 and 2.2
We use some internal Mockito classes and some  breaking API changes
have been made to them in Mockito 2. This commit introduces a utility
class, SpringBootMockUtil, to shield our code from these differences.
Mockito 1 is called directly and Mockito 2 is called via reflection.

To allow these changes to be tested, FilteredClassPathRunner has been
enhanced to also support overriding a dependency on the class path.
As a result it has been renamed to ModifiedClassPathRunner. The new
ClassPathOverrides annotation can be used to provide the Maven
coordinates of one or more dependencies that should be resolved and
added to the class path. Such additions are added to the start of
the class path so that they override any existing dependency that
contains the same classes.

Closes gh-6520
2016-11-18 16:39:44 +00:00
Andy Wilkinson af4ca7cf6e Align Spring Data Neo4j auto-configuration with latest Ingalls snapshots
Closes gh-7391
2016-11-18 11:22:39 +00:00
Stephane Nicoll 2ba3b27954 Merge branch '1.4.x' into 1.5.x
# Conflicts:
#	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
#	spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
2016-11-18 11:56:22 +09:00
Stephane Nicoll 0072a93915 Expose Tomcat's accesslog requestAttributesEnabled
This commit adds an extra property to the `server.tomcat.accesslog` to
control the `reqestAttributesEnabled` flag. This flag sets request
attributes for IP address, Hostname, protocol and port used for the
request.

Closes gh-7367
2016-11-18 11:48:09 +09:00
Phillip Webb 238c22cd73 Polish content security policy contribution
See gh-7373
See gh-7373
2016-11-16 15:30:36 -08:00
Christoffer Sawicki d7bbea63b7 Add properties for content security policy
Add `content-security-policy` and `content-security-policy-mode`
`security.header` properties and update auto-configuration to apply
them when specified.

Fixes gh-7373
Closes gh-7357
2016-11-16 15:30:36 -08:00
Johnny Lim 8038882d46 Polish
Closes gh-7403
2016-11-16 13:36:51 -08:00
Andy Wilkinson 387a406aad Merge branch '1.4.x' into 1.5.x 2016-11-16 09:13:17 +00:00
Andy Wilkinson b3e0a37197 Remove unwanted System.out calls in test code 2016-11-16 09:12:13 +00:00
Spring Buildmaster e712a9ba8c Next Development Version 2016-11-08 16:55:37 +00:00
Stephane Nicoll b51f92d9a4 Merge branch '1.4.x' into 1.5.x 2016-11-06 11:25:44 +01:00
Vedran Pavic 5783cd5593 Fix JWT token URI derivation
Closes gh-7299
2016-11-06 11:24:50 +01:00
Phillip Webb 81c5753f4d Merge branch '1.4.x' into 1.5.x 2016-11-03 14:49:38 -07:00
Phillip Webb 90afc8ebbe Formatting 2016-11-03 14:48:10 -07:00
Madhura Bhave 73308ba24b Merge remote-tracking branch 'springsource/1.4.x' into 1.5.x 2016-11-03 10:15:49 -07:00
Madhura Bhave b04a74f01d Fix failure analysis for Collections and Maps
Closes gh-6996
2016-11-03 10:14:01 -07:00
Phillip Webb 5b66ffbb4b Merge branch '1.4.x' into 1.5.x 2016-10-31 23:09:36 -07:00
Phillip Webb f4328b41af Polish 2016-10-31 23:09:25 -07:00
Phillip Webb 1b17677e0b Polish TLD skip pattern support
See gh-5010
2016-10-31 23:09:24 -07:00
Phillip Webb dbf6d3d418 Don't detect persistenceUnitRootLocation
Update JpaBaseConfiguration so that the persistenceUnitRootLocation is
no longer detected. The update to gh-7003 means that we can now rely on
the standard detection mechanism.

Fixes gh-6983
See gh-6635
2016-10-31 15:57:18 -07:00
Stephane Nicoll 9100897dcb Automatically exclude auto-configurations from component scan
Previously, if an auto-configuration class was (wrongly) located in a
candidate package for component scanning, the class was silently loaded
as an app configuration (i.e. with the wrong lifecycle).

This commit adds an `AutoConfigurationExcludeFilter` to
`@SpringBootApplication` so that such classes are automatically
filtered. Since they are registered in `spring.factories`, we can
silently ignore them since we know they'll be loaded later on.

Closes gh-7168
2016-10-31 15:13:58 +01:00
Stephane Nicoll 4f06e52d7e Allow adding additional tld skip patterns
This commit improves `TomcatEmbeddedServletContainerFactory` so that tld
skip patterns can be set or added to an existing set. An additional
`server.tomcat.additional-tld-skip-patterns` is now being exposed to
easily add patterns via configuration.

Closes gh-5010
2016-10-31 10:15:16 +01:00
Stephane Nicoll 94da9ad6e6 Merge branch '1.4.x' into 1.5.x 2016-10-30 11:24:46 +01:00
Stephane Nicoll 1a6ab90255 Polish test 2016-10-30 11:24:33 +01:00
Stephane Nicoll ed7de8eb60 Polish contribution
Also add rotate attribute to Undertow

Closes gh-7225
2016-10-26 11:31:17 +02:00
Matthieu Mouminoux 1d95219c4b Allow to configure Tomcat's rotatable property
See gh-7225
2016-10-26 10:28:06 +02:00
Stephane Nicoll ae4dd0d17e Merge branch '1.4.x' into 1.5.x 2016-10-24 18:08:23 +02:00
Stephane Nicoll a638dcd51b Remove unnecessary use of System.out.println 2016-10-24 18:07:40 +02:00
Andy Wilkinson a416f496c0 Clean up deprecation and unused code warnings 2016-10-18 20:43:05 +01:00
Andy Wilkinson 29d4a01b30 Merge branch '1.4.x' into 1.5.x 2016-10-13 12:30:05 +01:00
Andy Wilkinson 7968c6b548 Assign on order to OnPropertyCondition
Closes gh-7144
2016-10-13 12:29:35 +01:00
Andy Wilkinson cc04621dc2 Assign an order to OnResourceCondition
Closes gh-7145
2016-10-13 12:27:47 +01:00
Madhura Bhave 90722a9bca Add @ConditionalOnCloudPlatform
Add a @ConditionalOnCloudPlatform annotation that matches based on the
active ClouldPlatform.

Fixes gh-7155
2016-10-12 13:32:37 -07:00
Phillip Webb d818a09ed8 Polish 2016-10-11 23:38:14 -07:00
Phillip Webb d3e06c4627 Merge branch '1.4.x' into 1.5.x 2016-10-11 21:46:06 -07:00
Phillip Webb db3f488d5a Polish 2016-10-11 17:54:00 -07:00
Stephane Nicoll 6fb53f90e5 Polish contribution
Closes gh-6666
2016-10-11 17:03:10 +02:00
Maciej Walkowiak 47ec8630c8 Add Rabbit idleEventInterval property
This commit adds a property to configure how often idle container events
should be published.

See gh-6666
2016-10-11 15:49:10 +02:00
Andy Wilkinson f0b235cbc5 Merge branch '1.4.x' into 1.5.x 2016-10-11 13:04:59 +01:00
Andy Wilkinson 0333416952 Update WelcomePageHandlerMapping to handle reqs with no Accept header
Closes gh-7138
2016-10-11 13:02:36 +01:00
Stephane Nicoll ab2a2579c8 Polish contribution
Closes gh-6571
2016-10-10 11:37:21 +02:00
Aurélien Leboulanger 7efdb91641 Manage Tomcat queued connections
Adding two tomcat server properties:
- server.tomcat.accept-count
- server.tomcat.max-connections

Closes gh-6433
2016-10-10 11:37:12 +02:00
Stephane Nicoll 3e1425ebed Polish contribution
Closes gh-6543
2016-10-10 10:43:12 +02:00
Vedran Pavic 286a928347 Improve database initializers
This commit improves database initializers for Spring Batch and Spring
Session by introducing `AbstractDatabaseInitializer` which eliminates
duplicated logic in existing initializers. Additionally, database
platform resolution now relies on `DatabaseDriver`.

See gh-6543
2016-10-10 09:53:40 +02:00
Stephane Nicoll ed333a67b4 Expose Spring Data Rest RepositoryDetectionStrategy
Closes gh-7113
2016-10-07 10:35:48 +02:00
Stephane Nicoll 02b0e3955c Merge branch '1.4.x' into 1.5.x 2016-10-07 09:46:21 +02:00
Johnny Lim 1c4c0c6119 Fix String.format() usages
Closes gh-7120
2016-10-07 09:45:43 +02:00
Andy Wilkinson 9b8f33df6d Merge branch '1.4.x' into 1.5.x 2016-10-06 15:53:07 +01:00
Andy Wilkinson 20a2db79bd Separate conditions that did and did not match in auto-config report
Closes gh-7098
2016-10-06 15:52:45 +01:00
Stephane Nicoll f82e91df39 Merge branch '1.4.x' into 1.5.x 2016-10-06 13:29:53 +02:00
Stephane Nicoll 03961e6692 Polish contribution
Closes gh-7004
2016-10-06 13:28:23 +02:00
Rob Fletcher 7fcb197092 Allow configuration to specify randomly generated database name
See gh-7004
2016-10-06 11:40:19 +02:00
Stephane Nicoll 200e246238 Merge branch '1.4.x' into 1.5.x 2016-10-06 09:35:01 +02:00
Johnny Lim 91254f2110 Remove unused parameters in String.format()
Closes gh-7111
2016-10-06 09:34:32 +02:00
Stephane Nicoll cf28663cd7 Deprecate commons-dbcp 1
Closes gh-6787
2016-10-05 15:21:09 +02:00
Stephane Nicoll 07690bab25 Allow customization of the auto-configured JmsTemplate
Closes gh-6825
2016-10-04 15:00:42 +02:00
Phillip Webb a2315378d4 Formatting 2016-10-03 22:44:36 -07:00
Phillip Webb f2b0fa284e Merge branch '1.4.x' into 1.5.x 2016-10-03 22:38:22 -07:00
Phillip Webb 3326841a97 Formatting 2016-10-03 22:19:35 -07:00
Phillip Webb 39ed0d4dfb Polish 2016-10-03 21:58:13 -07:00
Stephane Nicoll 8ad477537e Fail fast if both uri and client attributes are set
Previously, an URI and individual client attributes can be set to
configure the mongo client. In such a scenario, the URI is ignored.

This commit changes the URI to be "null" and the creation of the client
to fail if both the uri and client attributes are set. If no client
attributes are set, the uri is used as before.

Closes gh-6739
2016-10-03 11:29:20 +02:00
Stephane Nicoll e643fc5bd1 Merge branch '1.4.x' into 1.5.x 2016-10-02 11:08:33 +02:00
Johnny Lim 503d735fdd Polish
Closes gh-7081
2016-10-02 11:07:04 +02:00
Stephane Nicoll 7ffa499949 Merge branch '1.4.x' into 1.5.x 2016-09-30 10:52:44 +02:00
Stephane Nicoll e56119165e Close JestClient on shutdown
Closes gh-7051
2016-09-30 10:51:48 +02:00
Stephane Nicoll 8ed20068ca Fix list property to be mutable
Closes gh-7045
2016-09-30 10:34:25 +02:00
Andy Wilkinson 2a035d0748 Remove support for Velocity following its deprecation in 1.4
Closes gh-6971
2016-09-29 15:44:36 +01:00
Andy Wilkinson 464915d2cc Remove support for HornetQ following its deprecation in 1.4
See gh-6971
2016-09-29 15:44:36 +01:00
Andy Wilkinson 0232e3b16c Merge branch '1.4.x' into 1.5.x 2016-09-29 15:09:08 +01:00
Andy Wilkinson d08c84af42 Ensure that JtaAutoConfiguration runs before ArtemisAutoConfiguration
Closes gh-7062
2016-09-29 15:08:24 +01:00
Andy Wilkinson b4d052a7b3 Merge branch '1.4.x' into 1.5.x 2016-09-29 15:01:54 +01:00
Andy Wilkinson 33ea73996e Make auto-config for Narayana back off when Transaction SPI not on classpath
Closes gh-7061
2016-09-29 14:56:05 +01:00
Vedran Pavic c4aa78679a Upgrade Hazelcast to 3.7.1
In addition, dependency management for `hazelcast-hibernate5` module has
been added, and a separate dependency version was introduced for
`hazelcast-hibernate4` module.

Closes gh-7023
2016-09-29 10:37:29 +02:00
Stephane Nicoll cdd59707fc Merge branch '1.4.x' into 1.5.x 2016-09-28 17:00:30 +02:00
Johnny Lim 30a677646f Polish
Closes gh-7030
2016-09-28 16:45:19 +02:00
Vedran Pavic f485660482 Upgrade Spring Session to 1.3.0.M2
Closes gh-6979
2016-09-28 11:07:11 +01:00
Stephane Nicoll 7dfa3a8c83 Harmonize Caffeine CacheManager bean name
Closes gh-6980
2016-09-26 10:47:09 +02:00
Andy Wilkinson aaf435ff2a Suppress Neo4J-related deprecation warnings
See gh-6976
2016-09-21 20:57:05 +01:00
Andy Wilkinson c108da9d53 Upgrade to Spring Data Ingalls M1
Closes gh-6785
Closes gh-5835
2016-09-21 17:01:47 +01:00
Stephane Nicoll bd7c20eb1c Deprecate Guava support 2016-09-21 14:59:02 +02:00
Stephane Nicoll ce1e41dce3 Remove deprecated code
This code removes code deprecated in 1.4 with the exception of code that
requires an update to Spring Framework 5.

Closes gh-6971
2016-09-21 14:30:28 +02:00
Stephane Nicoll 6bd670edbc Initiate 1.4.x branch 2016-09-21 11:11:24 +02:00
Spring Buildmaster 7e9ed5e1a7 Next Development Version 2016-09-21 07:58:07 +00:00
Phillip Webb 51092af739 Polish 2016-09-20 14:32:09 -07:00
Eddú Meléndez bc55b6e0d4 Add contextPath LocalHostUriTemplateHandler URIs
Update `LocalHostUriTemplateHandler` so that the `server.context-path`
property is also considered when building the URL.

Fixes gh-6904
Closes gh-6919
2016-09-17 19:33:06 -07:00
Phillip Webb 0eab3e0c5a Drop printed link to reference documentation
Tweak the fix from 50c68a49 to no longer print a link the reference
documentation.

See gh-6593
2016-09-16 17:52:25 -07:00
Phillip Webb 825dd0a26c Merge branch '1.3.x' 2016-09-16 15:07:18 -07:00
Phillip Webb b97e0bd471 Allow HttpPutFormContentFilter to be disabled
Add `spring.mvc.formcontent.putfilter.enabled` property to allow the
HttpPutFormContentFilter to be disabled.

Fixes gh-6519
2016-09-16 14:14:21 -07:00
Phillip Webb a2e4127d4f Fix multi-annotation nested condition logic
Update `AbstractNestedCondition` to correctly group nested conditions
on members.

Fixes gh-6672
2016-09-16 13:31:55 -07:00
Stephane Nicoll 50c68a497b Improve startup error message
This commit improves the startup error message so that it does not
reference  `--debug` anymore. Such command-line switch only works when
the application is started using `java -jar`.

The error message now refers directly to a section of the documentation
that provides more details and links to more useful examples.

Closes gh-6593
2016-09-16 16:37:50 +02:00
Stephane Nicoll 78bb04f2c1 Polish 2016-09-16 14:54:11 +02:00
Stephane Nicoll 284988f0cd Clarify SpringBootWebSecurityConfiguration scope
This commit fixes the documentation that wrongly states that
SpringBootWebSecurityConfiguration is an auto-configuration. Rather than
excluding this class, we should exclude SecurityAutoConfiguration that
imports it.

Closes gh-6861
2016-09-16 14:53:50 +02:00
Oliver Gierke 0860ad4fd4 Use default simple types with MongoMappingContext
Change the auto-configure MongoMappingContext to use the
SimpleTypesHolder instance `Set` that's produced by a CustomConversions
bean, which we in turn now default, too.

This update is necessary as `CustomConversions` registers converters by
inspecting the classpath (to automatically detect Java 8, JodaTime etc.)
and by that rendering the types for which we find converters for as
simple ones, i.e. non-entities.

Fixes gh-6881
Closes gh-6882
2016-09-15 10:42:59 -07:00
Phillip Webb dcfe2673fd Fix failing test following Tomcat upgrade
Tomcat 8.5.5 has change the default value of `validationInterval` to
3000. See https://bz.apache.org/bugzilla/show_bug.cgi?id=59923 for
details.

See gh-6703
See gh-6657
2016-09-14 17:14:37 -07:00
Johnny Lim caa4c0800f Polish
Closes gh-6872
2016-09-13 09:25:06 +02:00
Phillip Webb c56f30fd91 Formatting 2016-09-12 12:44:31 -07:00
Stephane Nicoll ee668e6782 Polish contribution
Closes gh-6651
2016-09-12 14:53:02 +02:00
Vedran Pavic 06a1f44128 Validate Spring Batch database initializer configuration
This commit adds Spring Batch configuration validation that disables
database initializer in case custom table prefix is configured with
default schema.

See gh-6651
2016-09-12 14:42:07 +02:00
Stephane Nicoll def40bf27f Polish 2016-09-12 14:36:12 +02:00
Stephane Nicoll a347a780e7 Polish contribution
Closes gh-6649
2016-09-12 14:34:40 +02:00
Vedran Pavic 9141177f1a Validate Spring Session database initializer configuration
This commit adds Spring Session JDBC configuration validation that
disables database initializer in case custom table name is configured
with default schema.

See gh-6649
2016-09-12 14:11:00 +02:00
Phillip Webb 56544c8dd5 Polish 2016-09-09 10:27:44 -07:00
Brian Clozel 274734e787 Add `spring.thymeleaf.check-template` property
This commit adds a new `spring.thymeleaf.check-template` property which
is only used for Thymeleaf 3.0+.

Since thymeleaf/thymeleaf#419, the Thymeleaf template resolver
implementations can implement the `setCheckExistence` method - this
enables the template existence verification at **resolution** time,
which means the resolver can return null as a `TemplateResolution`
and let other template resolvers in the chain try.

This new property is set to `true` by default and can be disabled if the
application only has a single resolver and the template existence check
is considered as a performance penalty with the configured resolver.

Fixes gh-6500
2016-09-09 16:35:57 +02:00
making 8a5c026a9d Add spring.http.multipart.resolve-lazily
This commit adds the `spring.http.multipart.resolve-lazily`
property, in order to configure whether the multipart request
should be resolved lazily, as the parameters are accessed.
2016-09-09 10:34:49 +02:00
Stephane Nicoll b450fece2e Add NoSuchBeanDefinitionException failure analyzer
Add a `FailureAnalyzer` that handles the case where the context does
not start because no candidate bean was found for an `InjectionPoint`.

The implementation inspects the auto-configuration report for beans
that are candidate and output the condition(s) that lead to such beans
to be discarded on startup. If a whole auto-configuration class is
disabled (or excluded), its beans are inspected and candidates are
extracted in a similar way.

This works for both injection by type and by name.

Closes gh-6612
2016-09-07 16:50:25 -07:00
Phillip Webb 7396ccfe04 Harmonize ConditionOutcome messages
Add ConditionMessage class to help build condition messages in a
uniform format and update existing conditions to use it.

Fixes gh-6756
2016-09-07 10:50:39 -07:00
Johnny Lim 4b9f6869f0 Polish
Closes gh-6817
2016-09-05 09:08:08 +02:00
Andy Wilkinson 2e1988f97e Rework welcome page so that it only handles reqs that accept text/html
Closes gh-6668
2016-08-31 19:26:17 +01:00
Andy Wilkinson 3814e509a3 Polish @deprecated javadoc and link to replacements where available
Closes gh-6765
2016-08-31 14:34:49 +01:00
Andy Wilkinson d720645275 Polishing
Fix mistake introduced during forward merge
2016-08-31 14:06:37 +01:00
Phillip Webb 2a22a7af12 Remove ApplicationInfo
Rework commit 4a69755b to remove the need for the ApplicationInfo class.
The updated code now uses the auto-configuration class to compute a
default persistence unit root location

Closes gh-6635
2016-08-31 14:49:15 +02:00
Andy Wilkinson b488a3d9a3 Merge branch '1.3.x' 2016-08-31 13:30:39 +01:00
Andy Wilkinson 63b8e82c10 Update OnBeanCondition to consider hierarchy for PARENTS search strategy
Closes gh-6762
2016-08-31 13:28:08 +01:00
Phillip Webb 565ad79856 Polish 2016-08-29 20:26:30 +01:00
Phillip Webb 850141c405 Merge branch '1.3.x' 2016-08-29 15:30:30 +01:00
Phillip Webb 69e96c6211 Polish 2016-08-29 15:29:54 +01:00
Andy Wilkinson 55f6fb94ef Merge branch '1.3.x' 2016-08-26 17:32:50 +01:00
Andy Wilkinson a5c6b0954d Consider ancestors when finding primary beans for ConditionalOnSingleCandidate
Closes gh-6559
2016-08-26 17:29:47 +01:00
Andy Wilkinson 6df279d3a1 Merge branch '1.3.x' 2016-08-26 14:30:49 +01:00
Andy Wilkinson 75c1e50c5a Improve type determination for factory beans during condition evaluation
Previously, BeanTypeRegistry did not correctly determine the type
that would be created by a factory bean if that factory bean was
returned from a bean method with arguments on a configuration class
found via component scanning.

The key difference is that bean definitions for bean methods on
configuration classes found via component scanning use ASM-based
metadata rather than reflection-based metadata. The ASM-based method
data does not provide direct access to the Method that will create the
bean. In this case, BeanTypeRegistry was falling back to looking for
a method with the matching name and no arguments. Therefore, if
the bean method had any arguments it would fail to find the method
and would, therefore, be unable to determine the type of bean
produced by the factory bean.

This commit updates BeanTypeRegistry to use logic that is very similar
to Spring Framework's ConstructorResolver's
resolveFactoryMethodIfPossible method to locate the method that will
produce the factory bean. It looks for a single method with
the required name with any number of arguments. If it finds multiple
methods with the required name and different arguments it returns
null, just as ConstructorResolver does.

Closes gh-6755
2016-08-26 13:46:56 +01:00
Stephane Nicoll 47c568a24d Polish contribution
Closes gh-6746
2016-08-26 14:24:19 +02:00
Caleb Cushing bb7b789cd9 Detect Neo4j bolt driver
Closes gh-6690
2016-08-26 13:44:02 +02:00
Stephane Nicoll b9104c9337 Restore support for empty persistence unit with fat jars
Due to the layout format change in 1.4, Spring Framework is no longer
able to compute a default persistence unit root URL. If a Spring Boot 1.4
application has JPA but does not have any entity, the application started
from a fat jar now fails with a quite cryptic exception.

This commit introduces `ApplicationInfo` as a general replacement for
the `ApplicationArguments` and `Banner` singleton beans that
`SpringApplication` registers on startup. `ApplicationInfo` also defines
the detected "main" `Class` that can be used to compute a last resort
URL that makes sense.

If such bean is available, `EntityManagerFactoryBuilder` now sets the
default persistence unit root location, preventing Spring Framework to
attempt to resolve an unknown location. Note that in our case the
persistence unit root location is actually useless: given the way the
persistence unit is created, nothing actually uses it but Hibernate, as a
compliant JPA provider, has to make sure this setting is set to a valid
URL nevertheless.

Closes gh-6635
2016-08-26 13:38:17 +02:00
Stephane Nicoll 86757efcdf Add FailureAnalyzer for Hikari
Hikari can configure both an underlying Driver or DataSource. Spring Boot
only supports the former so any attempt to trigger the creation of the
latter will lead to an exception since the auto-configuration has set
driver-specific field.

This commit adds an analyzer that intercepts such faulty scenario and
indicate that users should configure Hikari with an underlying DataSource
themselves.

Closes gh-6568
2016-08-26 11:31:46 +02:00
Johnny Lim 524edaea51 Polish
Closes gh-6728
2016-08-23 15:13:33 +02:00
Stephane Nicoll 6c1b46e162 Mark auto-configured `JdbcTemplate` as primary
This commit marks the auto-configured `JdbcTemplate` as `Primary`. Spring
session creates its own so we could end up with two in a fully auto
configured context.

Closes gh-6717
2016-08-23 10:42:55 +02:00
Andy Wilkinson e465368f54 Ensure that access log is flushed periodically
Previously, Tomcat’s background processing was only enabled on the
context but access logging was configured on the engine. This means that
the access log valve’s background processing method was never called
and, therefore, that it wasn’t flushed periodically.

This commit moves the enablement of background processing up to the
engine, thereby ensuring that the access log is flushed periodically.
Background processing cascades down the container hierarchy so, after
this change, background processing will still be performed on the
context as well.

Closes gh-6646
2016-08-22 23:01:44 +01:00
Andy Wilkinson 1dc231f771 Use Hamcrest's containsString matcher rather than Mockito's 2016-08-22 15:48:44 +01:00
Andy Wilkinson d4c9a2b271 Merge branch '1.3.x' 2016-08-22 15:07:03 +01:00
Andy Wilkinson ba51dc5c4a Make configuration of Liquibase’s logging more robust
We make Liquibase aware of our custom Commons Logging-based logger by
adding its package to the Liquibase ServiceLocator’s packages to scan.
Previously, this was happening too late so Liquibase may have already
initialized and cached a particular logger.

This commit moves the registration of the extra package from the
Liquibase auto-configuration to the application listener that customises
Liquibase’s ServiceLocator. This ensures that the package is added
before Liquibase is used. Unfortunately, configuring Liquibase’s
ServiceLocator and its packages to scan causes it to try to perform
some logging, resulting in it caching the wrong type of logger. We
work around this problem by resetting Liquibase’s LogFactory once we’ve
finished setting everything up.

Closes gh-6713
2016-08-22 14:58:34 +01:00
Stephane Nicoll c9a3880f27 Remove hard-coded property values
As of Spring Boot 1.4, IDEs are supposed to provide auto-completion for
hints and enum values. This commit removes the hard-coded copy of
allowed values for enum-based properties. This was mostly the case
already and this commit fixes the few ones remaining.

Closes gh-6654
2016-08-22 15:39:41 +02:00
Stephane Nicoll 54a3ce8827 Restore support for spring.datasource.type
This commit restores the support of "spring.datasource.type". If this
property is set to an unsupported `DataSource` implementation, we now
properly create it again, rather than ignoring it because its value did
not match any value we support.

Since Spring Boot 1.4 now redirects `DataSource` implementation settings
to dedicated namespaces, the documentation has been updated to explicitly
mention how one can create such arrangement for an unsupported
implementation.

As a convenience, `DataSourceProperties` can initialize a
`DataSourceBuilder` based on its internal state, making it very easy for
anyone to create a `DataSource` from a `DataSourceProperties` instance.

Closes gh-6695
2016-08-22 11:49:32 +02:00