Commit Graph

6086 Commits

Author SHA1 Message Date
Andy Wilkinson bc590a8bf4 Polishing, primarily to keep Checkstyle happy 2015-10-06 11:14:05 +01:00
Andy Wilkinson b7719a131b Merge branch '1.2.x' 2015-10-06 11:01:07 +01:00
Andy Wilkinson b8b4ea489e Improve MetricsFilter’s handling of async requests
Previously, MetricsFilter would treat async requests the same as
sync requests and would record their response status as soon as the
request had been processed by the filter chain. This would result in a
200 response being recorded and the actual response status produced by
the async processing being ignored. Furthermore, the time that was
recorded for the request would not include the time take for any async processing.

This commit updates MetricsFilter to check whether or not an async
request has been started before it records the metrics for the request.
In the event of an async request having been started no metrics are
recorded. Instead, the StopWatch is stored in a request attribute that
is then retrieved during the filtering of the request’s async
dispatch(es). Once the async processing has completed (isAsyncStarted()
returns false), the StopWatch is stopped, removed from the request’s
attributes and the metrics for the request are recorded.

Closes gh-4098
2015-10-06 11:00:59 +01:00
Andy Wilkinson 45cad3c3b7 Merge branch 'gh-4082' 2015-10-06 09:58:06 +01:00
Andy Wilkinson 2c2c7cee8d Polish contribution
See gh-4082
2015-10-06 09:58:00 +01:00
Benedikt Ritter 6978694cb8 Improve error reporting when driver class version is unsupported
ClassUtils.isPresent(String, ClassLoader) swallows all Throwables when
trying to load a class by name. For this reason
UnsupportedClassVersionError will also be swallowed when user code is
trying to use a driver library which has been compiled with a later
JDK than the one the application is running with. All the user would

see was "Cannot load driver class". This change simply propagates the
UnsupportedClassVersionNumberError so that it is easier for users to
find the root cause of the problem.

Closes gh-4082
Closes gh-4091
2015-10-06 09:58:00 +01:00
Dave Syer e17eab6430 Add placeholder resolution to OnResourceCondition
Users can write @ConditionalOnResource("${path.to.file}") and
placeholders are resolved from the environment.
2015-10-06 09:33:07 +01:00
Dave Syer 5d8ccbacdf Add a convenience AstTransformation base class for BOMs
Plugin authors can extend this class, provide missing methods,
and specify a BOM to add to the dependency management lookup
(i.e. dependencies by artifactId)
2015-10-06 09:31:23 +01:00
Stephane Nicoll 7e6097e419 Merge pull request #4093 from r11runner/typos
* pr/4093:
  Fix typos
2015-10-06 09:33:09 +02:00
r11runner 586f525a6b Fix typos
Closes gh-4093
2015-10-06 09:32:15 +02:00
Dave Syer 44c1348094 Fix DependencyResolutionContext for multiple boms
The problem was that it was not accumulating DependencyManagement
instances. It was throwing away the old ones and replacing with
only the latest.
2015-10-05 21:39:20 +01:00
Andy Wilkinson 60d508cda2 Fix FileSystemWatcherTests.sourceFolderMustExist on Windows 2015-10-05 17:32:07 +01:00
Andy Wilkinson 2292cff1ea Document the need to use spring.data.mongodb.uri with Mongo 3.0
Closes gh-4051
2015-10-05 15:22:26 +01:00
Andy Wilkinson cff1eea4c4 Make new configuration inner class static
See gh-4079
2015-10-05 14:35:00 +01:00
Alexander Tokarev 91a40dd66c Disable unnecessary database initialization
If a DataSource class is found in the classpath then
EmbeddedDataSourceConfiguration will not be used, so the in-memory
database will not be shutdown on application context closing.
As a result, unnecessary database initialization may cause subsequent
tests to fail, for example see [1].

[1] https://github.com/spring-projects/spring-boot/issues/1712
2015-10-05 14:18:39 +01:00
Andy Wilkinson bee7d24c1a Provide an example of using a .conf file with a truly executable jar
Closes gh-3522
2015-10-05 14:14:51 +01:00
Andy Wilkinson a4eec42813 Ensure that new JPA-based test doesn’t accidentally enable Bitronix 2015-10-05 14:07:01 +01:00
Andy Wilkinson d01236db30 Fix compile failure that doesn’t occur in Eclipse but does on Travis 2015-10-05 13:47:35 +01:00
Andy Wilkinson fd53cbf2f3 Stop JPA and a custom Flyway bean from causing a startup failure
Previously, if an application used JPA and declared its own Flyway bean,
startup would fail. The custom Flyway bean would switch off
auto-configuration of the FlywayMigrationInitializer bean but the
context’s entity manager factory beans would still be configured to
depend on the migration initialiser.

This commit splits the post-processor that configures the dependencies
into two. One that configures the dependency on the Flyway bean and
one that configures the dependency on the FlywayMigrationInitializer
bean. When to auto-configuration of the FlywayMigrationInitializer is
switched off, the auto-configuration of the latter dependency is also
switched off.

Closes gh-4079
2015-10-05 13:36:20 +01:00
Andy Wilkinson 81f6a77d15 Update starters to only depend on AspectJ Weaver
AspectJ’s weaver module contains a superset of the classes found in
AspectJ’s RT module. This commit updates the starters to exclude
aspectjrt so that only aspectjweaver is on the classpath.

Closes gh-3975
2015-10-05 12:41:17 +01:00
Andy Wilkinson b85756a0de Upgrade to Reactor and Reactor Spring 2.0.6.RELEASE
Closes gh-4003
2015-10-05 12:24:33 +01:00
Andy Wilkinson 917077c3dd Merge branch '1.2.x' 2015-10-05 11:41:30 +01:00
Andy Wilkinson a94f3a0cbf Only try to auto-configure Jetty when jetty-webapp is on the classpath
Closes gh-4089
2015-10-05 11:41:23 +01:00
Andy Wilkinson 26324f68b9 Make system props available when building model for CLI dep mgmt bom
Certain Maven profile activator’s require access to System properties
to determine whether or not a profile should be activated.
JdkVersionProfileActivator is one such activator.

Prior to this commit, the presence of a Maven profile that was activated
based on the JDK in a bom imported using @DependencyManagementBom in the
CLI would trigger a failure as the JdkVersionProfileActivator could not
determine the version of Java on which it was running.

This commit updates the CLI to pass the JVM’s System properties to the
request to build a bom’s model so that those system properties can be
used by JdkVersionProfileActivator (and any other activators which need
them).
2015-10-05 11:33:04 +01:00
Thomas Raehalme 3865f3b303 Allow launch script to be used by accounts that use /sbin/nologin
Closes gh-3852
Closes gh-3906
2015-10-05 11:08:52 +01:00
Andy Wilkinson 5c35d89fd1 Revert "Update tests to shut down in-memory databases proactively"
For reasons I don't (yet?) understand, shutting down the databases
proactively triggers a StackOverflowError in Jersey. Reverting the
change while I try to figure out what's going in.
2015-10-05 11:07:47 +01:00
Andy Wilkinson 72122ec965 Update tests to shut down in-memory databases proactively 2015-10-05 10:15:49 +01:00
Dave Syer ddbbd37718 Change order of bom transformation to allow others earlier 2015-10-05 09:54:58 +01:00
Stephane Nicoll cec4a8ec19 Merge pull request #4083 from ApiSecRay/master
* pr/4083:
  Fix typos
2015-10-03 11:52:53 +02:00
Ray Sinnema 5dc2290608 Fix typos
Closes gh-4083
2015-10-03 11:51:55 +02:00
Dave Syer 3e7b335e04 Upgrade to Spring AMQP 1.5.1 2015-10-03 09:56:31 +01:00
Stephane Nicoll 7d182028af Remove unecessary modifier 2015-10-03 09:11:32 +02:00
Stephane Nicoll 2beae9ad2a Merge pull request #4087 from izeye/polish-20151003
* pr/4087:
  Polish
2015-10-03 08:53:34 +02:00
izeye a13b23e7f8 Polish
Closes gh-4087
2015-10-03 08:53:19 +02:00
Phillip Webb 4ffcd3a22c Log active profiles on SpringApplication.run
Fixes gh-3766
2015-10-02 16:08:03 -07:00
Phillip Webb d1b936ef2c Merge branch '1.2.x' 2015-10-02 15:44:25 -07:00
Phillip Webb 87a515f6a0 Fix TemplateAvailabilityProvider binding issues
Update all TemplateAvailabilityProvider implementations to use the
relaxed property binder. Also fix FreeMarkerTemplateAvailabilityProvider
to use `template-loader-path` rather than `path`.

Fixes gh-4085
2015-10-02 15:39:43 -07:00
Phillip Webb 5e58645202 Log warning for template folder not found problems
Update template auto-configurations to log a warning message rather
than throw an exception if the template folder cannot be found.

Fixes gh-4075
2015-10-02 15:37:39 -07:00
Phillip Webb 5ccd9afc78 Merge branch '1.2.x' 2015-10-02 15:08:25 -07:00
Phillip Webb 891faa9d35 Fix test cleanup to reset commons logging 2015-10-02 15:04:04 -07:00
Andy Wilkinson fac42adb61 Use the right version of ClassUtils 2015-10-02 21:13:52 +01:00
Phillip Webb 2f694fa406 Add per-line match indicators to a/c report
Update the logged auto-configuration report so that each line includes
"matched", "did not match" text. This helps when looking to see if a
specific auto-configuration class was applied or not.

Fixes gh-4084
2015-10-02 13:09:31 -07:00
Andy Wilkinson eae7b0364b Replace use of deprecated JdkVersion API by looking for presence of classes
This commit updates ConditionalOnJava to remove a dependency on the
deprecated JdkVersion API from Spring Framework. In its place it now
looks for the presence of certain classes to determine the version of
Java on which its running.

Closes gh-4005
2015-10-02 19:55:38 +01:00
Phillip Webb 6a31c1dda1 Include debug message on management context fail
Update EndpointWebMvcAutoConfiguration to log exception details at DEBUG
in addition to the WARNING message when the child context fails to
start.

See gh-4064
2015-10-02 11:44:41 -07:00
Phillip Webb e272b3a957 Introduce AbstractEndpointMvcAdapter
Pull up functionality from EndpointMvcAdapter to a new
AbstractEndpointMvcAdapter which doesn't define any @RequestMappings and
update HealthMvcEndpoint to make use of it.
2015-10-02 11:26:03 -07:00
Phillip Webb c3b7764b72 Polish 2015-10-02 11:25:56 -07:00
Gary Russell 48ba1d888f Update Spring AMQP to 1.4.6 2015-10-02 13:04:26 -04:00
Phillip Webb fe8e8df701 Fix failing LocalDevToolsAutoConfigurationTests
Looks like a file was missed from the commit.

See gh-3851
2015-10-02 09:44:59 -07:00
Andy Wilkinson 3553e1d825 Merge branch '1.2.x'
Conflicts:
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/velocity/VelocityAutoConfiguration.java
2015-10-02 16:57:21 +01:00
Andy Wilkinson 2b748a7b44 Fix SampleOAuth2SsoApplicationTests
The redirect happens in two stages, first from / to /login on localhost
and then to github.com. This commit updates the test to check that the
first redirect has worked, i.e. from / to /login on localhost.
2015-10-02 16:55:00 +01:00