Commit Graph

5742 Commits

Author SHA1 Message Date
Andy Wilkinson
11e0444814 Upgrade to Spring Security JWT 1.0.3.RELEASE
Closes gh-2304
2015-02-17 09:56:15 +00:00
Andy Wilkinson
99a0661565 Upgrade to Spring Batch 3.0.3.RELEASE
Closes gh-2503
2015-02-17 09:55:47 +00:00
Andy Wilkinson
4840417cd9 Upgrade to mongo-java-driver 2.12.5
Closes gh-2502
2015-02-17 09:55:16 +00:00
Andy Wilkinson
3b8c9418b1 Upgrade to JDom 2.0.6
Closes gh-2501
2015-02-17 09:54:51 +00:00
Andy Wilkinson
8c534547c9 Upgrade to Groovy 2.3.9
Closes gh-2500
2015-02-17 09:54:26 +00:00
Andy Wilkinson
cdc2008146 Upgrade to AspectJ 1.8.5
Closes gh-2499
2015-02-17 09:54:01 +00:00
Andy Wilkinson
3f285d1bf0 Upgrade to Tomcat 7.0.59
Closes gh-2498
2015-02-17 09:53:29 +00:00
Andy Wilkinson
6a93fa1dd0 Upgrade to Jackson 2.3.5
Closes gh-2497
2015-02-17 09:52:59 +00:00
Stephane Nicoll
34ede2f31f Add Version and VersionRange utilities
Parse a version using our version format or any version that complies
with Major.Minor.Patch. Also add a VersionRange utility that can
determine if a given version is withing that range.

Closes gh-2494
2015-02-16 18:34:26 +01:00
Stephane Nicoll
e8e39e4bcf polish 2015-02-13 14:56:13 +01:00
Dave Syer
5efdb85876 Enhance note about Java Bean getters and setters 2015-02-13 13:11:12 +00:00
Dave Syer
e541e139a2 Add note about Java Bean getters and setters
Apparently some users are unclear that setters and getters are
mandatory for @ConfigurationProperties. This should clear it up.
2015-02-13 09:17:28 +00:00
Stephane Nicoll
2843744190 Merge pull request #2320 from joshiste/datasourceMetrics-fix
* datasourceMetrics-fix:
  Fix for empty datasource-name in metrics
2015-02-13 09:33:35 +01:00
Johannes Stelzer
05e388012d Fix for empty datasource-name in metrics
If there is more than one DataSource and the non-primary bean-name is
'datasource' an incorrect metric name is chosen.

The metrics are named datasource.active and not datasource.xxx.active. To
avoid this, the shortening of the bean-name only occurs if the bean-name
is longer than 'datasource'.

See gh-2320
2015-02-13 09:31:31 +01:00
Andy Wilkinson
a8726c4ae1 Merge branch '1.1.x' 2015-02-12 17:53:07 +00:00
Andy Wilkinson
d7ae0f3b06 Ensure that management endpoints with nested paths are secured
Previously each endpoint was secured for path, path/, and path.*.
This meant that a request to path/foo was not secured. This commit
secures path/** to ensure that requests to a nested endpoint path are
also secured.

Fixes gh-2476
2015-02-12 17:50:38 +00:00
Andy Wilkinson
a4b4b850d5 Remove duplicate deployment tests
Closes gh-2472
2015-02-12 16:44:06 +00:00
Andy Wilkinson
201fb5e534 Make Joda DateTime serialization format configurable
We allow the serialization format of dates to be configured using
spring.jackson.date-format. However, this property only applies to
java.util.Date instances and has no effect on a Joda DateTime.

This commit updates our auto-configuration for Jackson to allow
the format string that is used to  serialize a Joda DateTime to be
configured. A new property, spring.jackson.joda-date-time-format has
been introduced. When configured, it is used to configure the
serialization format for a Joda DateTime. When it is not configured,
we fall back to using spring.jackson.date-format. If this fails,
either because the format string is incompatible (unlikely) or because
the user's configured the fully-qualified name of a DateFormat class,
a warning is logged encouraging the use of
spring.jackson.joda-date-time-format.

Fixes gh-2225
2015-02-12 16:07:53 +00:00
Andy Wilkinson
f11bcb9495 Register Module beans with Jackson2ObjectMapperBuilder
Prior to this commit, Module beans were registered with all
ObjectMapper beans, but were not registered with the auto-configured
Jackson2ObjectMapperBuilder. This meant that any ObjectMapper created
with the builder but not exposed as a bean would not have the Module
beans registered with it. One such ObjectMapper is the one used by the
auto-configured MappingJackson2XmlHttpMessageConverter. This caused
XML (de)serialization to be different to JSON (de)serialization.

This commit updates JacksonAutoConfiguration to register all of the
application context's Module beans with the auto-configured
Jackson2ObjectMapperBuilder. This ensures consistent configuration
of any ObjectMapper that's created using the builder, irrespective of
whether or not that ObjectMapper is also exposed as a bean, and
also ensures that (de)serialization of JSON and XML is consistent.

See gh-2327
2015-02-12 13:52:13 +00:00
Dave Syer
0899ffdadf Add realm name to 401 responses from basic auth
Since the BasicAuthenticationEntryPoint does its own
challenge when authentication fails, we need to add that
entry point in the SpringBootWebSecurityConfiguration
explicitly.

Fixes gh-2483
2015-02-12 12:07:59 +00:00
Dave Syer
12724bf332 Fix ordering of keys in PropertySourcesPropertyValues
Since @ConfigurationProperties binding uses a single instance of
PropertySourcesPropertyValues per bean, there doesn't seem to be
any issue with using a normal LinkedHashMap. Then the order
passed in as PropertySources will be preserved.

Fixes gh-2487
2015-02-12 10:09:19 +00:00
Andy Wilkinson
0ef3de4d82 Document how to disable auto registration of a Servlet or Filter bean
Closes gh-2173
2015-02-11 13:21:49 +00:00
Andy Wilkinson
b183309728 Stop a BeanPostProcessor from preventing config of packages to scan
Previously, if a BeanPostProcessor bean was declared in a configuration
class that depended on the persistence context, packages to scan would
not be configured on the LocalContainerEntityManagerFactoryBean. This
was due to the BeanPostProcessor bean triggering the early instantiation
of the LCEMFB before EntityScanBeanPostProcessor, the BeanPostProcessor,
that applies the @EntityScan configuration, had been given a chance to
configure it.

This commit updates EntityScanBeanPostProcessor to implement Ordered
with an order of zero. This ensures that its ordering is predictable
and that it will be driven before any unordered BeanPostProcessor. This
means that, unless the user has specifically ordered their
BeanPostProcessor to run before EntityScanBeanPostProcessor, 
LCEMFB’s packages to scan will be configured as expected.

Fixes gh-2478
2015-02-10 20:15:15 +00:00
Stephane Nicoll
1035e5b029 Expose RepositoryRestMvcBootConfiguration
If an application defines a custom RepositoryRestMvcConfiguration, all
Spring Boot defaults are lots. While this sounds sensible, it can be
confusing as Spring Boot exposes properties (`spring.data.rest.*`) that
are no longer honored.

RepositoryRestMvcBootConfiguration is now public and can be used as an
extension point for those who need to customize the Spring Data REST
configuration and keep boot's specific defaults.

Fixes gh-2392
2015-02-10 16:00:11 +01:00
Andy Wilkinson
11b7fd832d Report non-matching outer class conditions
Update ConditionEvaluationReport so that, whenever a negative outcome
is added for a source, any existing outcomes for inner classes of that
source are updated with a non-matching outcome that indicates that the
outer configuration did not match.

Conditions are evaluated in two phases; PARSE_CONFIGURATION first and
REGISTER_BEAN second. If a parent class’s conditions match in
PARSE_CONFIGURATION then its inner classes will have their
PARSE_CONFIGURATION conditions evaluated. If they all match, the inner
class will be reported as a positive match in the auto-configuration
report even if the outer class does not match as a result of the
subsequent evaluation of a REGISTER_BEAN condition.

Fixes gh-2122
2015-02-09 14:05:12 -08:00
Phillip Webb
636898f9ad Polish 2015-02-09 11:39:48 -08:00
Andy Wilkinson
5922cfa41f Avoid use of SimpleNamingContextBuilder as it pollutes JVM’s JNDI config
Closes gh-2397
2015-02-09 13:44:30 +00:00
Andy Wilkinson
82d1e61ab1 Prevent attempt to export MBean for DataSource retreived from JNDI
Tomcat 8's default DataSource implemention is an MBean. Previously,
when such a DataSource was consumed from JNDI and an MBeanExporter had
been auto-configured an attempt would be made to export this MBean to
the MBean server. This would fail due to Tomcat having already
registered the MBean.

This commit updates JndiDataSourceAutoConfiguration to instruct the
MBeanExporter (if there is one) not to export a DataSource MBean
that's been retrieved from JNDI. The assumption is that any MBean in
JNDI will have already been registered with the MBean server by the
same infrastructure that registered it with JNDI.

Fixes gh-2397
2015-02-09 13:05:07 +00:00
Andy Wilkinson
b40f689e1d Merge branch '1.1.x'
Conflicts:
	spring-boot-dependencies/pom.xml
2015-02-09 10:18:40 +00:00
Andy Wilkinson
6aaa5ee933 Upgrade to CRaSH 1.3.1
Closes gh-2425
2015-02-09 10:17:34 +00:00
Stephane Nicoll
23d7a6bd8f Merge pull request #2469 from izeye/application-properties
* application-properties:
  Improve doc for application.properties.
2015-02-08 10:07:46 +01:00
izeye
319663a628 Improve doc for application.properties. 2015-02-08 09:58:40 +01:00
Andy Wilkinson
b4cb7a35c9 Document spring.http.converters.preferred-json-mapper
See gh-2247
2015-02-05 12:06:19 +00:00
Andy Wilkinson
b39ecdf006 Rename preferred-mapper property so its clear it only applies to JSON
preferred-mapper has been renamed to preferred-json-mapper to make it
clear that it only affects the JSON mapper and that the XML mapper
that will be used (if any) is unaffected

See gh-2247
2015-02-05 11:01:29 +00:00
Andy Wilkinson
230048ae8b Prefer Jackson unless user explicity states preference for Gson
This commit rewords the changes made in d718a80 so that simply adding
Gson to the classpath isn't sufficient to stop Jackson being used
for HTTP JSON mapping. To use Gson, the user must now either remove
Jackson from the classpath (not an option if they also wish to use
the Actuator) or configure the spring.http.converters.preferred-mapper
property with a value gson.

Closes gh-2247
2015-02-05 10:56:26 +00:00
Andy Wilkinson
e5d653dbd4 Update to Spring AMQP 1.4.3.RELEASE
Closes gh-2452
2015-02-04 18:12:57 +00:00
Andy Wilkinson
f64081872c Merge branch '1.1.x' 2015-02-04 18:12:38 +00:00
Andy Wilkinson
9212574191 Upgrade to Spring AMQP 1.3.9.RELEASE
Closes gh-2453
2015-02-04 18:11:39 +00:00
Andy Wilkinson
aca47ab67e Allow FaviconConfiguration to be disabled
Setting spring.favicon.enabled to false will now disable the
/**/favicon.ico handler mapping.

Closes gh-2377
2015-02-04 18:02:09 +00:00
Andy Wilkinson
d718a80316 Make it easier to use Gson and the Actuator at the same time
Previously the recommendation when a user wanted to use Gson was to
exclude Jackson from the classpath and add Gson. This worked fine until
the user also want to use the Actuator which requires Jackson. To get
over this hurdle the user could leave Jackson on the classpath and
perform their own HttpMessageConverter configuration and register a
GsonHttpMessageConverter instead of or before any Jackson-based
converter. A little complicated, but it worked.

This commit makes things easier by updating the auto-configuration for
HTTP message converters to prefer Gson when both Gson and Jackson are
on the classpath, i.e. in the presence of both, a
GsonHttpMessageConverter will be auto-configured and a
MappingJackson2HttpMessageConverter won’t be. This allows an
application to easily use Gson while allowing the Actuator to continue
to use Jackson.

Closes gh-2247
2015-02-04 17:34:14 +00:00
Andy Wilkinson
68c7c65d52 Configure SnakeYAML so the timestamp-like strings do not become Dates
By default, SnakeYAML will convert a timestamp-like string into a
java.util.Date. This differs to properties file-based configuration
where the values are always strings. Dates are problematic as the
round trip (string -> Date -> string) can change the value. For example,
“2015-01-27” becomes “Tue Jan 27 00:00:00 GMT 2015”.

This commit updates YamlPropertySourceLoader to use a Yaml with a
custom Resolver subclass that suppresses the addition of the implicit
resolver for timestamps. Supressing the addition of the unwanted
resolver, rather than overriding addImplicitResolvers and registering
the resolvers that we do want, ensures that we get all of the other
default Resolvers in their default order.

Fixes gh-2422
2015-02-04 16:50:51 +00:00
Andy Wilkinson
54e90c03fc Polish the javadoc in spring-boot-cli
Add missing @param and @return elements
2015-02-04 14:00:44 +00:00
Andy Wilkinson
17f05467bc Document IDEA’s quirky classpath ordering and its effect on templates
Closes gh-2319
2015-02-04 11:35:21 +00:00
Phillip Webb
8e398dc6a7 Polish Javadoc
Update Javadoc to add missing @return and @param elements.
2015-02-03 11:35:06 -08:00
Andy Wilkinson
e489ab9b29 Update docs to clarify ordering for profile-specific properties
Closes gh-2404
2015-02-03 14:12:04 +00:00
Andy Wilkinson
a88f27168a Add support to the Gradle plugin for disabling direct use of resources
The Maven plugin allows spring-boot:run to be configured so that
resources are loaded from their output location rather than from
src/main/resources. This commit adds an equivalent configuration
option to the Gradle plugin. To disable source resources from being
added to the classpath in place of those in the output location
the configure the bootRun tasks like this:

bootRun {
	addResources = false
}

Closes gh-2431
2015-02-03 10:52:10 +00:00
Phillip Webb
c02b99b257 Rename CodahaleMetricWriter
Deprecate CodahaleMetricWriter and create DropwizardMetricWriter to
reflect the renamed project.

Fixes gh-2442
2015-02-02 22:19:06 -08:00
Phillip Webb
e1a80fa496 Fix broken reference documentation link 2015-02-02 21:30:49 -08:00
Phillip Webb
3d9cf06c31 Log OnBeanCondition.addDeducedBeanType errors
Update addDeducedBeanType.addDeducedBeanType to log any exceptions at
debug level.

Fixes gh-2436
2015-02-02 20:55:47 -08:00
Phillip Webb
0696695e16 Add package javadoc 2015-02-02 17:05:38 -08:00