Commit Graph

579 Commits

Author SHA1 Message Date
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
Stephane Nicoll 249e09d9bc Switch master to 1.2.0.BUILD-SNAPSHOT 2014-07-11 10:44:05 +02:00
Dave Syer ede385d1b6 Modify @Condition for detecting existing message bundle resource
The problem with the old code is that it worces a ResourceBundle to
initialize with the default encoding (and that is then cached in the
JDK) during @Condition evaluation (so before the encoding is known).

Includes test for swedish messages

Fixes gh-1228
2014-07-10 12:42:02 +01:00
Spring Buildmaster 40327e1ae6 Next development version 2014-07-08 02:33:36 -07:00
Gary Russell ce0cbe05bf Restore AMQP vHost leading `/` support
Update RabbitProperties since vHosts have no restrictions requiring a
leading slash and can have any number of leading slashes.

Fixes gh-1206
2014-07-08 01:33:47 -07:00
Phillip Webb 4ede9cd1be Support websockets with Tomcat 8.0.8
Fixes gh-1210
2014-07-08 00:59:34 -07:00
Andy Wilkinson 6a0eb90007 Upgrade to Spring Batch 3.0.1
Due to a mistake in Spring Batch 3.0.0 it has been necessary to
introduce a breaking API change (the addition of
BatchConfigurer.getJobExplorer()) in the 3.0.1 release. This commit
updates Boot to use 3.0.1 and modifies the Batch auto-configuration
and associated tests to implement the new method.
2014-07-08 00:03:30 -07:00
Dave Syer aa38d33404 Support for setting credentials and vhost in rabbit addresses
User can now add credentials, vhost and protocol prefix (amqp://)
to any or all of the addresses, extending the format beyond that accepted
bu the rabbitmq client, but making it cloud friendly. Only one of
the addresses needs those properties and all are optional. Port
also defaults to 5672 in an address.
2014-07-07 19:56:50 +01:00
Phillip Webb fa88c481a5 Remote trailing whitespace 2014-07-02 15:17:14 -07:00
Toshiaki Maki e306cff4ff Fix typo in FlywayAutoConfiguration's javadoc
Closes #1183
2014-07-01 09:44:22 +01:00
Toshiaki Maki 9febd4a4cb Support sqlScriptEncoding in schema.sql
Fixes gh-1165, fixes gh-1164
2014-06-27 12:55:12 +01:00
Spring Buildmaster 981669b7c0 Next development version 2014-06-26 14:09:54 -07:00
Phillip Webb 200cd535c2 Revert "Next development version"
This reverts commit 67189477fe.
2014-06-26 11:03:09 -07:00
Spring Buildmaster 67189477fe Next development version 2014-06-26 10:51:35 -07:00
Phillip Webb 9632abf825 Formatting and cleanup 2014-06-26 09:41:15 -07:00
Dave Syer c0305ecbbb Take care registering DataSourceInitializer
The DataSourceInitializer is instantiated early by the
DataSourceInitializerPostProcessor, so it has to live in
isolation (in its own @Configuration) to prevent early
instantiation of the DataSourceAutoConfiguration.

Fixes gh-1166
2014-06-26 09:49:44 +01:00
Spring Buildmaster 542f3cbda8 Next development version 2014-06-24 13:53:56 -07:00
Dave Syer b2db3790de Improve test for JobLauncherCommandLineRunner (see gh-1125) 2014-06-24 10:39:28 +01:00
Phillip Webb c713c8091d Polish 2014-06-23 19:41:22 -07:00
Jonas Bergvall 078db8cb74 Separate the configuration/creation of the default ObjectMapper
bean from the registration of Jackson modules to avoid circular creation
of the default ObjectMapper bean (and thus failing to obtain the ObjectMapper
and registering the module(s)).

Fixes gh-1132
2014-06-22 09:57:53 +01:00
Phillip Webb bfe4240ed2 Polish 2014-06-20 10:29:04 -07:00
Phillip Webb 445589a5d2 Polish RabbitMQ Changes
Fix the formatting which was messed up in commit ad1636fd. Also
simplify the RabbitProperties.setVirtualHost logic a little

See gh-1128
2014-06-20 10:29:04 -07:00
Phillip Wirth ad1636fd34 RabbitMQ virtual hosts can how start with a slash
The autoconfig strips out slashes where necessary to make a valid
hostname

Fixes gh-1128
2014-06-20 17:46:54 +01:00
Dave Syer 1e5882b19c Make copy of job parameters before weeding out non-identifying ones
Fixes gh-1125
2014-06-19 18:15:44 +01:00
Dave Syer c6175073ae Be slightly more defensive in DataSource initialization
Adding an Order to the BeanPostProcessor and catching an exception
are enough to get a simple web app with @EnableGlobalMethodSecurity
and JDBC user details running. It actually doesn't solve an underlying
problem in Spring Security, but I'll deal with that separately.

See gh-1115
2014-06-19 14:26:22 +01:00
Phillip Webb 34a32991fa Be defensive about solr classes required
Update SolrAutoConfiguration to specifically require HttpSolrServer
and CloudSolrServer classes rather than the generic SolrServer.

This prevents the rather cryptic "@ConditionalOnMissingBean annotations
must specify at least one bean" error that can occur if an earlier
version of solr happens to be on the classpath (as is the case when
hibernate-search is used).

Fixes gh-1098
2014-06-18 16:30:39 -07:00
Phillip Webb 46c46dbd0c Refine Spring Social auto-configuration
Refine auto-configuration for Spring Social to:

- Only auto-configure FB/Twitter/LinkedIn if the `app-id` property is
  set.
- Only configure ConnectController and ProviderSignInController if
  there is a ConnectionFactoryLocator.
- Auto-configure Spring Social's SpringSocialDialect for Thymeleaf if
  Thymeleaf is present.
- Added several tests around Spring Social auto-configuration.

Fixes gh-1118
2014-06-18 13:46:19 -07:00
Phillip Webb 179e1558f6 Polish 2014-06-18 12:48:42 -07:00
Dave Syer f8e847a6fc Change ordering of DataSourceInitializer a bit
It needs to run as soon as the DataSource is available really otherwise
anything else that depends on the DataSource (like Security JDBC
initializers) might fail when it tries to use it.

One change from 1.1.1 is that if you have a schema.sql you had better
make sure your data.sql talks to the same tables. In 1.1.1 you could
sometimes get away with letting Hibernate initialize the tables for
your data.sql and *also* have a schema.sql. This was fragile and doomed
to fail eventually if the DataSourceInitializer somehow got
initialized earlier (e.g. through a @DependsOn), so in the spririt
of honesty being the best policy we explicitly disallow it now.

Fixes gh-1115
2014-06-18 15:19:53 +01:00