Commit Graph

10971 Commits

Author SHA1 Message Date
Andy Wilkinson
63b8e82c10 Update OnBeanCondition to consider hierarchy for PARENTS search strategy
Closes gh-6762
2016-08-31 13:28:08 +01:00
Andy Wilkinson
9874c22e23 Fix HAL browser endpoint redirect and entry point with custom servlet path
Previously, the HAL browser endpoint did not consider the dispatcher
servlet’s path (server.servlet-path) when redirecting to browser.html
or when updating the API entry point in the served HTML.

This commit moves to using ServletUriComponentsBuilder to build the URI
for the redirect and the path for the entry point. In the interests of
simplicity the logic that sometimes redirected and sometimes forwarded
the request has been changed so that it will always perform a redirect.

Closes gh-6586
2016-08-31 11:22:45 +01:00
Stephane Nicoll
ff48a88b91 Enable fork more when devtools is present
This commit improves the run goal to automatically fork the process when
devtools is present and log a warning when fork has been disabled via
configuration since devtools will not work on a non-forked process.

We don't want devtools to kick in for integration tests so the logic has
been placed in `RunMojo` requiring a couple of protected methods to
override.

Closes gh-5137
2016-08-31 12:10:35 +02:00
Stephane Nicoll
7765d31edd Merge branch '1.3.x' 2016-08-31 10:47:54 +02:00
Stephane Nicoll
c8632f12f6 Clarify scope of Guava's CacheLoader
Closes gh-6778
2016-08-31 10:47:41 +02:00
Stephane Nicoll
f93775ec12 Clarify scope of Caffeine's CacheLoader
Closes gh-6770
2016-08-31 10:43:52 +02:00
Stephane Nicoll
cf07d19ed4 Polish
See gh-6792
2016-08-31 09:27:50 +02:00
Stephane Nicoll
b0face34f4 Upgrade to Spring AMQP 1.6.2.RELEASE
Closes gh-6788
2016-08-31 09:18:07 +02:00
Phillip Webb
a985a5c861 Update @MockBean to support generics
Update @MockBean and @SpyBean to support field generics. Prior to this
commit the following fields would fail with a "Duplicate mock
definition" exception:

  @MockBean
  private IdentityProvider<PasswordIdentity> passwordIdentityProvider;

  @MockBean
  private IdentityProvider<Oauth2Identity> oauth2IdentityProvider;

Fixes gh-6602
2016-08-29 21:42:44 +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
Stephane Nicoll
c4cb831770 Polish 2016-08-28 11:02:19 +02:00
Stephane Nicoll
afadac27bd Merge branch '1.3.x' 2016-08-27 12:34:05 +02:00
Stephane Nicoll
97f15d606d Auto-detect fork value in stop goal
So far, one has to set the "fork" value to both the start and stop
goals. Since they have the same name, sharing them in a global
configuration element does the trick. However, the plugin also supports
auto-detection of the fork value according to other parameters:
typically if an agent or jvm arguments are set, forking will be
automatically enabled. This is a problem since the stop goal is not aware
of that.

This commit transmits the value in a property attached to the
`MavenProject`. That way, the stop goal can retrieve that value and
apply the same defaults. This has the side effect that specifying the
fork value isn't necessary anymore.

Closes gh-6747
2016-08-27 12:33:44 +02:00
Andy Wilkinson
cc53f8810a Correct deprecated ErrorPage javadoc's reference to its replacement
Closes gh-6764
2016-08-26 20:16:08 +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
62bc955ba7 Merge pull request #6746 from xenoterracide:neo4j-bolt
* pr/6746:
  Polish contribution
  Detect Neo4j bolt driver
2016-08-26 14:25:45 +02: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
Andy Wilkinson
10402a651f Close context to ensure that logging system is cleaned up
See gh-6688
2016-08-25 20:41:43 +01:00
Andy Wilkinson
43361e0ca5 Prevent child applications from reinitializing the logging system
Closes gh-6688
2016-08-25 19:55:47 +01:00
Stephane Nicoll
25e72fab71 Initialize FailureAnalyzer earlier
This commit changes `FailureAnalyzers` so that the loaded
`FailureAnalyzer` instances are initialized before the context eventually
fails.

Before this commit, the `BeanFactoryAware` callback was processed at a
time where the context has already shutdown. Some implementations need
to access components that are no longer available.

Instead, we now initialize them before the context is refreshed.

Closes gh-6748
2016-08-25 13:33:55 +02:00
Andy Wilkinson
07a50bb16c Update the samples to make use of auto-configured TestRestTemplate
Closes gh-6730
2016-08-25 12:07:40 +01:00
Andy Wilkinson
3c5cf02882 Provide method to create TestRestTemplate with basic auth from existing
Closes gh-6732
2016-08-25 12:07:19 +01:00
Andy Wilkinson
2377d78a40 Update auto-configured TestRestTemplate to use SSL when it’s enabled
Closes gh-6731
2016-08-25 09:47:23 +01:00
Andy Wilkinson
46e03529fb Remove redundant bean declarations from some of the security samples
Closes gh-6740
2016-08-24 17:34:29 +01:00
Stephane Nicoll
d6e9ccecec Upgrade to Spring Security 4.1.3.RELEASE
Closes gh-6738
2016-08-24 09:04:42 +02:00
Stephane Nicoll
2c61064d93 Fix property prefix
This commit fixes the prefix for the WebClient and WebDriver auto-config
so that it complies with the prefix set on `AutoconfigureWebMvc`

Closes gh-6727
2016-08-23 17:11:14 +02:00
Andy Wilkinson
5a1741e2e8 Improve documentation of when TestRestTemplate is auto-configured
Closes gh-6729
2016-08-23 15:48:40 +01:00
Andy Wilkinson
9e2dcbbe96 Merge pull request #6721 from Mark Paluch
* gh-6721:
  Include netty-handler as transient dependency of cassandra-driver-dse
2016-08-23 14:57:26 +01:00
Mark Paluch
84234858db Include netty-handler as transient dependency of cassandra-driver-dse
Previously, Spring Data Cassandra excluded Netty from the Cassandra
Driver's dependencies. This was an error that we replicated in
our dependency management. The exclusion has been removed from
Spring Data Cassandra's pom. This commit makes the equivalent update
to our dependency management.

Fixes gh-6616
Closes gh-6721
2016-08-23 14:56:45 +01:00
Stephane Nicoll
3d04fbc0d4 Merge pull request #6728 from izeye:polish-20160823
* pr/6728:
  Polish
2016-08-23 15:13:48 +02:00
Johnny Lim
524edaea51 Polish
Closes gh-6728
2016-08-23 15:13:33 +02:00
Andy Wilkinson
742657983b Improve the error message when additional build-info prop has null value
Closes gh-6724
2016-08-23 11:30:23 +01:00
Andy Wilkinson
f41e629760 Provide M2E lifecycle mapping metadata for Maven plugin’s build-info goal
Previously, configuring the build-info goal in a pom would result in 
Eclipse reporting an error for the pom as it didn’t know if/when to
execute the build-info goal.

This commit adds lifecycle mapping metadata so that the goal is executed
on incremental builds. This ensures that the contents of the generated
file are kept up-to-date, reflecting the latest build time, etc.

Closes gh-6723
2016-08-23 11:30:23 +01: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
a16aa767dc Tweak performance of RelaxedNames.separatedToCamelCase
Closes gh-6661
2016-08-22 22:09:24 +01:00
Andy Wilkinson
53374ec51d Merge pull request #6706 from Maciej Walkowiak
* gh-6706:
  Polish “Add constructor to TestRestTemplate that takes a RestTemplateBuilder”
  Add constructor to TestRestTemplate that takes a RestTemplateBuilder
2016-08-22 20:52:04 +01:00
Andy Wilkinson
f117b93d49 Polish “Add constructor to TestRestTemplate that takes a RestTemplateBuilder”
Closes gh-6702
2016-08-22 20:51:54 +01:00
Maciej Walkowiak
53d7fd5aab Add constructor to TestRestTemplate that takes a RestTemplateBuilder
Closes gh-6706
See gh-6702
2016-08-22 20:51:54 +01:00
Andy Wilkinson
6cb18835b9 Reorder javadoc at-clauses to appease the Checkstyle gods 2016-08-22 20:51:00 +01:00
Andy Wilkinson
269bb9148c Add methods to RestTemplateBuilder for configuring interceptors
Closes gh-6701
2016-08-22 20:37:28 +01:00
Andy Wilkinson
32d0021eec Merge branch '1.3.x' 2016-08-22 15:49:52 +01:00