Commit Graph

6011 Commits

Author SHA1 Message Date
Andy Wilkinson 995ff66eae Configure m2e to ignore reserve-network-port in Cassandra sample 2015-10-14 13:23:56 +01:00
Stephane Nicoll cca153e986 Document how to return custom JSON on errors
Closes gh-3999
2015-10-14 14:16:45 +02:00
Stephane Nicoll 266335339d Extract BindingResult if necessary
Previously, no `errors` attribute is made available in the standard JSON
error document if a request body object is invalid. This is due to the
fact that the framework throws a `MethodArgumentNotValidException holding
a `BindingResult` object that was not detected.

We now make sure to extract the `BindingResult` from such exception.

Closes gh-4166
2015-10-14 13:29:16 +02:00
Andy Wilkinson 17fde264e2 Merge branch '1.2.x' 2015-10-14 12:20:09 +01:00
Andy Wilkinson e4895f8fde Disable child context's /error endpoint if disabled in parent
Previously, EndpointWebMvcChildContextConfiguration would attempt to
create a /error endpoint, irrespective of whether or not the parent
had such an endpoint. If the endpoint was disabled in the parent this
would cause a failure due to the absence of an ErrorAttributes bean.

This commit updates EndpointWebMvcChildContextConfiguration to make
the creation of its /error endpoint conditional on the existence of
an ErrorAttributes bean.

Closes gh-4164
2015-10-14 12:06:10 +01:00
Stephane Nicoll 01b23c886f Use random port for Cassandra tests
Closes gh-4028
2015-10-14 11:37:19 +02:00
izeye 033823f493 Disable SecurityFilterAutoConfiguration when spring-security-web is missing
Previously, SecurityFilterAutoConfiguration would be created even if
spring-security-web was not on the classpath. This didn't cause a
failure as all of its beans were disabled. It was, however, wasteful,
as the configuration class was processed and a bean created for it
unnecessarily.

This commit makes the whole class conditional on the presence of
spring-security-web so that it will be skipped entirely when the
dependency is not available.

Closes gh-4160
2015-10-14 10:16:31 +01:00
Andy Wilkinson 1e58f08b9a Provide dependency management for Cassandra Driver
This commit adds dependency management for Cassandra Driver’s three
modules. The version is the latest maintenance release of the minor version that’s used by Spring Data Cassandra in the Spring Data Gosling release train.

Closes gh-4167
2015-10-14 10:09:37 +01:00
Phillip Webb 5150e051c0 Allow remote restart to work with nested JARs
Update remote restart support so that JARs multi-module projects work.

Fixes gh-4040
2015-10-14 01:31:10 -07:00
Stephane Nicoll e79ef9b73b Add option to exclude devtools from fat jar
Add an `excludeDevtools` property to both the Maven and Gradle plugin
that removes `org.springframework.boot:spring-boot-devtools` (if
necessary) when repackaging the application.

Closes gh-3171
2015-10-14 01:22:57 -07:00
Phillip Webb e2fc30ef24 Polish 2015-10-14 00:20:32 -07:00
Phillip Webb ab7bec1160 Update clarify of bean conditions
See gh-4104
2015-10-14 00:20:32 -07:00
Phillip Webb ff0daa8d5c Use DelegatingFilterProxy for Spring Security
Update SecurityFilterAutoConfiguration to use a DelegatingFilterProxy
filter rather directly referencing the springSecurityFilterChain bean.

Using a DelegatingFilterProxy helps to prevent early initialization of
beans and makes Spring Security work in a similar to way to if were
installed in a regular WAR deployment.

Fixes gh-4154
2015-10-14 00:20:25 -07:00
Phillip Webb a3f978793e Add DelegatingFilterProxyRegistrationBean
Add a RegistrationBean that can be used to create DelegatingFilterProxy
filters that don't cause early initialization.

Fixes gh-4165
2015-10-13 23:09:09 -07:00
Stephane Nicoll a7bdef61de Clarify usage of `@ConditionalOn[Missing]Bean`
Closes gh-4104
2015-10-13 18:55:47 +02:00
Stephane Nicoll 9d3858caff Update health endpoint documentation
Closes gh-4157
2015-10-13 18:36:27 +02:00
Stephane Nicoll e221dfc3a6 Clarify ConversionService initialization
Spring Boot will eagerly initialize a `ConversionService` named
`conversionService` for configuration keys processing. This commit adds
a note in the documentation regarding that special behaviour.

Closes gh-4162
2015-10-13 17:39:31 +02:00
Andy Wilkinson 3e79647b35 Fix import ordering 2015-10-13 16:02:25 +01:00
Andy Wilkinson 25e719f549 Fix handling of security.headers.* to allow headers to be disabled
Spring Security 4’s default configuration will, irrespective of any
other header writers that are added, enable writers for the following
headers:

 - X-Content-Type
 - X-XSS-Protection
 - Cache-Control
 - X-Frame-Options

Previously, SecurityProperties.headers used false as the default for the
properties that enable or disable these headers but the configuration is
only applied when the properties are true. This left us with the right
default behaviour (the headers are enabled) but meant that the
properties could not be used to switch off the headers.

This commit changes the defaults for the four properties to true and
updates SpringBootWebSecurityConfiguration to only apply the
configuration when the properties are false. This leaves us with the
desired defaults while allowing users to disable one or more of the
properties by setting the relevant property to false.

Closes gh-3517
2015-10-13 15:43:57 +01:00
Stephane Nicoll f4c1efd128 Clarify property expansion
So far we have wrongly advertized that the `spring-boot-starter-parent`
filters application configuration in such a way that standard Spring
placeholders are not processed.

In order to achieve such feature, the `useDefaultDelimiters` property
must be set to `false` as otherwise default delimiters are appended to
the list of custom delimiters.

This property is not enabled so that only keys surrounded by `@` are
filtered by the build.

Closes gh-3092
2015-10-13 11:41:23 +02:00
Stephane Nicoll 8e0a94f1d7 Make sure Caching is initialized before JPA support
The second level cache of Hibernate can be configured with dedicated
factories that look up for the presence of a cache infrastructure. As
Hibernate shouldn't have to know about Spring, that lookup is done
against the respective proprietary APIs.

We now make sure that caching (and the general purpose Hazelcast
auto-configuration) is fully processed before JPA kicks in. In particular
an explicit `dependsOn` attribute on those beans is added when they are
processed.

Closes gh-4158
2015-10-13 10:54:15 +02:00
Phillip Webb c6bf13c0a1 Support multi-profile YAML in application-* files
Update ConfigFileEnvironmentPostProcessor to load profile specific
sections for all previously processed profiles. Prior to this commit
multi-profile YAML files were only loaded from the root
`application.yml` file.

With the updated logic, an `application-test.yml` file containing the
following:

	someTestProperty: xyz
	---
	spring:
	  profiles: profile1
	  specificProperty: one

Can have the profile sub-document loaded using:

	-Dspring.profiles.active=test,profile1

Fixes gh-4132
2015-10-12 16:25:54 -07:00
Andy Wilkinson a899058ac3 Add a tip to the docs about using DB_CLOSE_ON_EXIT=false with H2
Closes gh-4135
2015-10-12 18:08:17 +01:00
Andy Wilkinson 5af0903c0e Merge branch '1.2.x' 2015-10-12 15:06:26 +01:00
Andy Wilkinson 9218d5ad11 Use Maven Central as source of Tomcat binaries for deployment tests
Closes gh-4151
2015-10-12 15:05:53 +01:00
Andy Wilkinson 667500ff49 Merge branch '1.2.x' 2015-10-12 14:59:16 +01:00
Andy Wilkinson baa2473da1 Update to CRaSH 1.3.2
Closes gh-4150
2015-10-12 14:45:31 +01:00
Andy Wilkinson 100ad995e6 Upgrade to Groovy 2.4.5
Closes gh-4149
2015-10-12 14:40:34 +01:00
Andy Wilkinson ed022fb79a Upgrade to AspectJ 1.8.7
Closes gh-4148
2015-10-12 14:39:54 +01:00
izeye acadc688bb Upgrade to Spring REST Docs 1.0.0.RELEASE
Closes gh-4140
2015-10-12 14:29:59 +01:00
Andy Wilkinson dcbb27320d Upgrade to jOOQ 3.7.0
Closes gh-4147
2015-10-12 14:18:00 +01:00
Andy Wilkinson 8ee8c9fe90 Merge branch '1.2.x' 2015-10-12 14:12:20 +01:00
Andy Wilkinson d33d068fae Upgrade to Tomcat 8.0.28 and test support for SSL config from classpath
Prior to 8.0.28 Tomcat required the key store and trust store (if any)
to be available directly on the filesystem, i.e. classpath: resources
would not work. Tomcat 8.0.28 removed this limitation.

This commit updates to Tomcat 8.0.28, updates the tests to verify
the new Tomcat capability and removes the obsolete documentation of
the restriction.

Closes gh-4048
2015-10-12 13:36:32 +01:00
Andy Wilkinson d90647d712 Merge branch '1.2.x' 2015-10-12 13:07:44 +01:00
Andy Wilkinson ee3d4b34a0 Consider parent when application is built and then run
Previously, the parent context was only considered when the builder
was used to run the application. If the application was built using
the builder and then run using SpringApplication.run, the parent
context was not considered.

This commit updates the builder to consider the parent both when it's
used to run the application and when it's used to build the
application that will later be run via SpringApplication.run

Closes gh-4014
2015-10-12 13:06:44 +01:00
Stephane Nicoll 00af1f5c10 Flag main MbeanExporter `@Primary`
When the actuator is enabled, Spring Boot provides two `MBeanExporter`
bean definitions: a general purpose one and a dedicated one for Actuator
endpoints.

This commit flag the general purpose one `@Primary` so that component
can safely inject it by type if necessary. In particular, this fix the
doc of the `JmxMetricWriter`.

Closes gh-4007
2015-10-12 11:43:16 +02:00
Andy Wilkinson 6c4e4520d4 Merge branch '1.2.x' 2015-10-12 10:37:25 +01:00
Andy Wilkinson 050a4fed17 Restore compatibility with Gradle 2.0
Gradle 2.0, and only 2.0, requires a Plugin implementation to be
public. The changes made in gh-4113 (9c14ed3) made the class
package-private.

Closes gh-4139
2015-10-12 10:33:33 +01:00
Andy Wilkinson 60a7880f62 Merge branch '1.2.x' 2015-10-12 10:31:37 +01:00
Andy Wilkinson 9c14ed3502 Remove stale Java source from src/main/groovy in the Gradle plugin
Closes gh-4113
2015-10-12 10:30:31 +01:00
Stephane Nicoll b1a38a8a44 Upgrade to Undertow 1.3.0.Final
Closes gh-3969
2015-10-12 10:13:18 +02:00
Stephane Nicoll fb4cc718c2 Reuse existing ElasticSearch client
Instead of always creating a new ElasticSearch client, we now check for
the presence of a custom bean configuration and use that if it's
available.

Closes gh-4143
Closes gh-4146
2015-10-12 09:47:48 +02:00
Stephane Nicoll dd163edc92 Merge branch '1.2.x' 2015-10-12 09:22:12 +02:00
Stephane Nicoll ed1b5cbfde Upgrade to H2 1.4.190
Closes gh-4145
2015-10-12 09:21:29 +02:00
Stephane Nicoll 6f941e3a04 Upgrade to H2 1.4.190
Closes gh-4145
2015-10-12 09:20:36 +02:00
Phillip Webb 877e6e034c Polish 2015-10-09 17:08:28 -07:00
Phillip Webb 13d9601799 Merge branch '1.2.x' 2015-10-09 16:48:43 -07:00
Phillip Webb 70214da2e4 Fix broken formatting 2015-10-09 16:41:36 -07:00
Phillip Webb 822820f256 Revert "Relax `ParenPad` checkstyle rule"
The updated formatter means that we can reinstate the rule.

This reverts commit 82fffe3062.
2015-10-09 13:54:33 -07:00
Phillip Webb b6667e8495 Reformat code using Spring code formatter plugin 2015-10-09 13:54:33 -07:00