Commit Graph

607 Commits

Author SHA1 Message Date
Phillip Webb
49805661f0 Merge branch '1.1.x' 2014-08-21 12:44:02 -07:00
Phillip Webb
650e326ae7 Align MessageSource path search fix with SPR-12095
Update ExtendedPathMatchingResourcePatternResolver to use similar
code as the fix for SPR-12095.

Fixes gh-1378
2014-08-21 12:09:07 -07:00
Dave Syer
171b2e452b Make ServerProperties bean conditional on being a webapp 2014-08-20 09:09:19 +01:00
Phillip Webb
83bd36d8e0 Merge branch '1.1.x'
Conflicts:
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java
2014-08-18 13:02:44 -07:00
Phillip Webb
eb721b1e9f Find 'messages*.properties' in all jar URLs
Update the the PathMatchingResourcePatternResolver used in the
MessageSourceAutoConfiguration condition to deal with the fact
that `classpath*:` patterns do not work with URLClassLoaders when
the pattern doesn't include a folder.

The ExtendedPathMatchingResourcePatternResolver works by searching
all classpath URLs when the `findAllClassPathResources` method is
called with an empty location.

Fixes gh-1378
2014-08-18 12:58:41 -07:00
Phillip Webb
6e6bc25c44 Polish 2014-08-18 09:57:03 -07:00
Dave Syer
91d3edc220 Tidy imports 2014-08-18 14:57:28 +01:00
Phillip Webb
b3ba86390f Relax EntityManagerFactoryBuilder Map generic
Relax the generic signature on EntityManagerFactoryBuilder.properties
so that any object type can be added.

Fixed gh-1376
2014-08-15 11:49:25 -07:00
Phillip Webb
ebd0d265f8 Polish 2014-08-15 11:49:13 -07:00
Phillip Webb
8476a79dd2 Add support for RelaxedDataBinder aliases
Update RelaxedDataBinder to support property aliases and change
DataSourceBuilder to use them.

Fixes gh-1384
2014-08-15 10:46:06 -07:00
Phillip Webb
45c8eca4f2 Add @ConditionalOnMissingBean(MongoDbFactory)
Update MongoAutoConfiguration to be conditional on a missing
MongoDbFactory bean. The assumption is that if the user has declared
a MongoDbFactory they will either use it directly, or they will also
register a Mongo bean.

If the MongoDbFactory class cannot be found the existing Mongo
auto-configuration still applies. This ensures that users that do
not have Spring Data can still access a Mongo bean.

Fixes gh-1341
2014-08-14 21:41:10 -07:00
Phillip Webb
e0c3dd79f9 Add String type attribute to OnBean conditions
Fixes gh-1381
2014-08-14 21:02:35 -07:00
Ramnivas Laddad
912d5cf40b Add auto-configuration for Spring Cloud
Enable if all of the following are true:
- spring-cloud is on the classpath
- There is no Cloud bean present
  (usually done by extending AbstractCloudConfig)
- The "cloud" profile is active

Fixes gh-1302

Autoconfigure spring-cloud
2014-08-14 20:47:59 -07:00
Phillip Webb
21995cc85d Polish 2014-08-14 20:47:39 -07:00
Dave Syer
300910f7d5 Merge branch '1.1.x' 2014-08-11 17:43:14 -07:00
Dave Syer
0cf1c6f0e5 Refactor AuthenticationManagerConfiguration to make sure it works
if user also adds @EnableWebMvcSecurity. The problem is that the ordering
of the init() and configure() methods in the Spring Security configurers
can force things to happen too early unless we are careful. It's still a bit
twitchy I would say, but this relatively small change seems to fix the GS guide
and not break any existing tests.

I added a sample which mimic ths GS guide so we get an integration test that
executes the new code paths.

Fixes gh-1364
2014-08-11 17:42:30 -07:00
Phillip Webb
acb621e84f Polish 2014-08-11 09:04:55 -07:00
Stephane Nicoll
d089685935 Add auto configuration for Spring 4.1 JMS features
This commit adds two additional auto-configuration items that are new
in Spring 4.1

* A JmsMessagingTemplate is automatically created if none is present
* A default JmsListenerContainerFactory is automatically created if
  @EnableJms has been triggered and no default has been set manually

Fixes gh-1298
2014-08-11 11:52:24 +02:00
Stephane Nicoll
6217c1b095 polishing 2014-08-08 18:02:35 +02:00
Spring Buildmaster
74d0c5185a Next development version 2014-08-07 11:59:17 -07:00
Dave Syer
178386abc4 Merge branch '1.1.x' 2014-08-06 19:33:57 -07:00
Dave Syer
38f8d65756 Use ApplicationEvent to ensure that authentication event publisher is registered
There was a reference to an old (fixed) issue in Spring which led to some simplification
of the AuthenticationManager layering as well.

Fixes gh-1335
2014-08-06 19:30:27 -07:00
Phillip Webb
13bb23ac5a Merge branch '1.1.x' 2014-08-06 14:17:37 -07:00
Phillip Webb
88828f5097 Use MongoDbFactory to create GridFsTemplate
Update MongoDataAutoConfiguration to use the MongoDbFactory when
creating GridFsTemplate.

Fixes gh-1295
2014-08-06 14:16:18 -07:00
Andy Wilkinson
ce02e86b89 Merge branch '1.1.x' 2014-08-06 15:07:33 +01:00
Andy Wilkinson
7d213950ad Never run data.sql scripts if spring.datasource.initialize is false
Previously, the data scripts were always run in response to the
publication of a DataSourceInitializedEvent, irrespective of
spring.datasource.initialize. While the event won't be published by
DataSourceInitializer if spring.datasource.initialize is false, it
will be published if spring.jpa.hibernate.hbm2ddl.auto has been set.

This commit updates DataSourceInitializer's handling of
DataSourceInitializedEvent to only run the data scripts if
spring.datasource.initialize is true.

Fixes #1336
2014-08-06 14:48:26 +01:00
Dave Syer
68582bbac2 Merge branch '1.1.x' 2014-08-04 08:34:49 -07:00
Dave Syer
6c5f8f9581 Add @Inherited to @EnableAutoConfiguration
Fixes gh-1328
2014-08-04 08:34:06 -07:00
Phillip Webb
8e0b3dd00a Rename some ConditionalOnProperty attributes
Rename the newly introduced @ConditionalOnProperty `match` and
`defaultMatch` attributes to `havingValue` and `matchIfMissing`.

Also added a new `name` attribute as an alternative to `value` to
aid readability.

Closes gh-1000
2014-07-29 09:13:58 -07:00
Phillip Webb
6825a7b42e Polish 2014-07-29 09:12:47 -07:00
Oliver Gierke
81cd11b4ec Improved detection of manual Spring Data repository configuration
The presense of store-specific RepositoryConfigurationExtension beans
is used to disable auto-configuration for JPA, Mongo, and Solr

Closes #1267
2014-07-29 15:56:26 +01:00
Max Bruchmann
ee40fb8cf1 Add auto-configuration for Thymeleaf data dialect
Closes #1120
2014-07-29 11:12:02 +01:00
Phillip Webb
53d24301d1 Merge branch '1.1.x' 2014-07-28 15:41:42 -07:00
Phillip Webb
f8bf0e2031 Polish 2014-07-28 15:40:40 -07:00
Phillip Webb
5e1552b718 Retain default order in HttpMessageConverters
The original fix for gh-1293 (commit 05e6af23) caused test failures due
to the fact that Spring Boot's MappingJackson2HttpMessageConverter was
added before Spring's default StringHttpMessageConverter.

This commit changes the HttpMessageConverters logic so that additional
converts are added just before any default converter of the same type.
This allows additional converters to be added whilst still retaining
the sensible ordering of the default converters.

Fixes gh-1293
2014-07-28 15:40:33 -07:00
Dave Syer
5ce4669055 Merge branch '1.1.x' 2014-07-28 09:32:58 -07:00
Dave Syer
05e6af23cf Prepend without replacing in HttpMessageConverters
It was incorrect to simply replace existing instances because you can't
tell from the instance which media types and java types it supports. This
fix just prepends the custom converters so they get higher priority.

Fixes gh-1293
2014-07-28 09:32:15 -07:00
Andy Wilkinson
0960908bd7 Add support for configuring SSL declaratively
Both Tomcat and Jetty can now be configured to use SSL via the
environment (typically application.properties or application.yml)

Closes #1084
2014-07-24 15:10:09 +01:00
Dave Syer
ac2ab39a54 Use class name not value to support non-Hibernate JPA vendors
With this change I got a simple Eclipselink version of the data-jpa
sample working. I'll push that when I get time to research it a bit more
(I needed to set up a Java agent so either that might be a problem
for our integration tests if we can't work around it).

Fixes gh-1268.
2014-07-21 22:25:47 +01:00
Dave Syer
8cb90a5645 Merge branch '1.1.x' 2014-07-17 12:33:22 +01:00
Dave Syer
0c52817c88 Ensure order is preserved in Rabbit addresses
Using StringUtils.commaDelimitedListToSet() does not preserve order (why?),
so we have to use commaDelimitedListToStringArray().

Fixes gh-1262
2014-07-17 12:31:37 +01:00
Stephane Nicoll
120ad56a5c Replace @ConditionalOnExpression
This commit replaces @ConditionalOnExpression instances that are
checking for a specific value to @ConditionalOnPropertyValue
2014-07-17 11:50:13 +02:00
Stephane Nicoll
270809783c Merge @ConditionalOnPropertyValue
This commit merges the features of @ConditionalOnPropertyValue
to the existing @ConditionalOnProperty.

The "match" attribute provides the value to match against. By default,
the value should not be equal to "false" which is the existing default
of @ConditionalOnProperty. "defaultMatch" specifies if the value
should be present. The default matches also the existing behavior of
@ConditionalOnProperty.

Fixes gh-1000
2014-07-17 11:11:42 +02:00
Stephane Nicoll
d7d77f3d06 Add OnPropertyValueCondition annotation
This commit adds a new conditional annotation that checks if a
property has a given value. This allows to replace constructs
such as

@ConditionalOnExpression("'${app.myProperty:foo}' == 'foo'")

to

@ConditionalOnPropertyValue(property="app.myProperty",
        value="foo", defaultMatch=true)

Which is definitely more verbose but has the following advantages:

1. Works by default if the actual property in the environment is
   a bit different (i.e. my-property)
2. Works if the value of the property has a diferent case (FoO or
   FOO would match)
3. Gives a precise reporting in the auto configuration report

The defaultMatch flag is meant to mention that the condition should
also match if the value is not set; the auto-config report would
also have an explicit report about it.

Fixes gh-1000
2014-07-16 16:00:43 +02:00
Stephane Nicoll
621b33f7ad Missing setter on spring.batch.job.names property
Relates to gh-1249
2014-07-14 11:36:18 +02:00
Stephane Nicoll
8f886e22ce Use @ConfigurationProperties for Thymeleaf
Add missing properties to complement 6568495

Fixes gh-1250
2014-07-14 11:18:36 +02:00
Stephane Nicoll
65684957ea Use @ConfigurationProperties for Thymeleaf
Fixes gh-1250
2014-07-14 11:08:16 +02:00
Stephane Nicoll
90cf722365 Use @ConfigurationProperties for Spring Batch
Fixes gh-1249
2014-07-14 11:04:21 +02:00
Stephane Nicoll
20e08494ae Fix typo 2014-07-11 16:02:08 +02:00
Stephane Nicoll
d01154c212 Move Spring Social and Spring Mobile configuration
This commit uses dedicated Properties classes instead of accessing
the raw environment for Spring Social and Spring Mobile. This
improves the readability and the discovery of such properties.

Fixes gh-1238
2014-07-11 11:02:00 +02:00