Commit Graph

1029 Commits (b719b0271cf9878c6665ddf97a401642ec11446e)

Author SHA1 Message Date
Phillip Webb c0f69d28d3 Remove inadvertently committed debug System.out 10 years ago
Dave Syer 5946ade199 Merge branch '1.1.x' 10 years ago
Dave Syer 95c15733bc Use ErrorController.getErrorPath() to ignore the error path for security
Fixes gh-1548 again
10 years ago
Andy Wilkinson e8ce93715a Merge branch '1.1.x' 10 years ago
Andy Wilkinson eed58eecb4 Improve error handling in EnableAutoConfigurationImportSelector
Previously, EnableAutoConfigurationImportSelector assumed that it
would always find auto-configuration attributes from an
@EnableAutoConfiguration annotation. This assumption does not hold
true in certain circumstances, although exactly what those
circumstances are is unclear. It could occur if the import selector
were used directly, but it's package-private making that unlikey. In
such circumstances a NullPointerException was being thrown.

This commit asserts that the attributes are non-null and, should the
assertion fail, produces an error that is more helpful than an NPE.

Closes gh-1512
10 years ago
Andy Wilkinson 284e7b2091 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 468b6cb1f7 Add support for configuring RemoteIpValve’s internalProxies
Closes gh-1522
10 years ago
Andy Wilkinson 4b25b0e7a2 Allow Jackson features to be configured via the environment
Enhance JacksonAutoConfiguration to configure features on the
ObjectMapper it creates based on the following configuration
properties:

spring.jackson.deserialization.* = true|false
spring.jackson.generator.* = true|false
spring.jackson.mapper.* = true|false
spring.jackson.parser.* = true|false
spring.jackson.serialization.* = true|false

The final part of each property name maps onto an enum. The enums are:

deserialization: com.fasterxml.jackson.databind.DeserializationFeature
generator: com.fasterxml.jackson.core.JsonGenerator.Feature
mapper: com.fasterxml.jackson.databind.MapperFeature
parser: com.fasterxml.jackson.core.JsonParser.Feature
serialization: com.fasterxml.jackson.databind.SerializationFeature

Closes gh-1227
10 years ago
Phillip Webb 26ac68df05 Polish Redis sentinel support 10 years ago
Phillip Webb b129bc261a Polish 10 years ago
Phillip Webb 565e449d89 Merge branch '1.1.x'
Conflicts:
	spring-boot-docs/src/main/asciidoc/howto.adoc
10 years ago
Phillip Webb 5ba86a103d Polish 10 years ago
Andy Wilkinson c02804931f Merge branch '1.1.x' 10 years ago
Andy Wilkinson 6f9f335ea1 Add additional class conditions for JTA auto-configuration
Previously, JTA auto-configuration would fail with a variety of
ClassNotFoundExceptions and NoClassDefFoundErrors if it was used with
an “incomplete” classpath. This commit adds a number of classes to
@ConditionalOnClass annotations so that the auto-configuration backs
off gracefully in the absence of certain classes.

Specifically, the following now work as expected:

 - Deploying an app to a server with JTA available via JNDI when the
   app does not use transactions
 - Auto-configuration of Atomikos without JMS
 - Auto-configuration of Bitronix without JMS

Both XADataSourceAutoConfiguration and JndiDataSourceAutoConfiguration
have been updated to back off in the absence of spring-jdbc; a
dependency of DataSourceProperties which is used by both classes.

Error handling in AtomikosDependsOnBeanFactoryPostProcessor and
BitronixDependentBeanFactoryPostProcessor has been enhanced so that the
correct dependencies are established, even in the absence of JMS.

Fixes gh-1538
10 years ago
Dave Syer 6456f2a542 Add url,user,password to LiquibaseProperties
User can set those properties (optionally) to use a different
DataSource than the default.

Fixes gh-1558
10 years ago
Dave Syer 59ce634437 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. Cherry picked onto master after (apparently) a failed
merge of commit ac2ab39.
10 years ago
Dave Syer 049cd4b85b Merge branch '1.1.x' 10 years ago
Dave Syer 437fb75424 Add /error to ignored paths for security autoconfig
Protecting /error doesn't make a great deal of sense and if it is
protected you don't get the ErrorPageFilter for the attempt at loading
it, so Tomcat renders its own HTML error page (when deployed as WAR).

Fixes gh-1548
10 years ago
Dave Syer 389c4f3e0b Merge branch '1.1.x' 10 years ago
Dave Syer 9902f98a3d Ensure the AuthenticationManager is created when needed
There was too much state really in the old implementation of
AuthenticationManagerConfiguration, and it was leading occasionally
to null pointers when method A assumed that method B had already
been called and it hadn't. This change manages to concentrate all the
references to an AuthenticationManagerBuilder into a single method
call, removoing the need for storing it at all.

Fixes gh-1556
10 years ago
Dave Syer 0950072b5e Fix integration test (shared context by accident) 10 years ago
Christoph Strobl c8a4891441 Add support for Redis Sentinel configuration
Spring Data Redis 1.4.0 introduced Redis Sentinel support. When
specified, RedisConnectionFactory uses the Sentinel configuration to
determine the current master.

Sentinel configuration can be specified using two new properties:
spring.redis.sentinel.master and spring.redis.sentinel.nodes.

For example:

spring.redis.sentinel.master=mymaster # name of redis server
spring.redis.sentinel.nodes=127.0.0.1:26379,127.0.0.1:26380

Alternatively, a bean of type RedisSentinelConfiguration can be declared
and it will be used to configure the connection factory.

Note: At this time, Sentinel support is only available for Jedis

Closes gh-1337
10 years ago
Andy Wilkinson fbeb8c966c Upgrade to Spring Data Evans
The missing bean condition on the auto-configuration classes for
Elasticsearch, Jpa, Mongo and Solr repositories have been tightened to
look for ElasticsearchRepositoryFactoryBean, JapRepositoryFactoryBean,
MonoRepositoryFactoryBean, and SolrRepositoryFactoryBean respectively.

In Spring Data Evans, when there are multiple repository types on the
classpath, a strict mode is entered to prevent the different
repositories from trampling over each other. A side-effect of this is
that for the Mongo domain types in the tests to be discovered they
must be explicitly annotated with @Document.

Closes gh-1338
10 years ago
David Liu 8e9e502b6a Add support for auto-configuration of Commons DBCP2
Closes gh-1292
Closes gh-1477
10 years ago
Stephane Nicoll 02a8a9c07b Add auto configuration for Spring AMQP 1.4 features
This commit adds two additional auto-configuration items that are new
in Spring AMQP 1.4:

* A RabbitMessagingTemplate is automatically created if none is present
* A default RabbitListenerContainerFactory is automatically created if
none is present.

Besides @EnableRabbit is enabled automatically if the necessary classes
are present and a ConnectionFactory is available.

Fixes gh-1495
10 years ago
Phillip Webb 84249da941 Add @ConditionalOnBean to Thymeleaf dialect beans
Fixes gh-1507
10 years ago
Spring Buildmaster d63e4b4329 Next development version 10 years ago
Phillip Webb 4d27458fee Replace MongoProperties condition for spring-cloud
Replace @ConditionalOnBean(MongoProperties.class) on
MongoDataAutoConfiguration with @EnableConfigurationProperties since
MongoAutoConfiguration will not be applied in a cloud environment.

Fixes gh-1502
10 years ago
Phillip Webb 8bf1f9567a Apply eclipse formatting and cleanup rules 10 years ago
Andy Wilkinson 8399fc990c Verify that @EnableIntegrationMBeanExport can set custom JMX domain
Add a test to JmxAutoConfigurationTests which verifies that
@EnableIntegrationMBeanExport can be used on a @Configuration class
to customize the default domain used for MBeans created by Spring
Integration. See https://jira.spring.io/browse/SPR-12128.

Closes gh-1451
10 years ago
Phillip Webb 1697174cd8 Remove ExtendedPathMatchingResourcePatternResolver
Remove ExtendedPathMatchingResourcePatternResolver which is not required
with Spring 4.1

Fixes gh-1420
10 years ago
Phillip Webb f7cffce695 Allow custom JNDI ConnectionFactory lookup
Add a `spring.jms.jndi-name` property to allow a JMS ConnectionFactory
to be obtained from a custom JNDI location.

Fixes gh-1471
10 years ago
Phillip Webb 0326abfe01 Support for composed "any" condition
Add `AnyNestedCondition` which can be used to create a logical 'or' of
other conditions contained on nested classes. For example:

	static class OnJndiOrProperty extends AnyNestedCondition {

		@ConditionalOnJndi()
		static class OnJndi {
		}

		@ConditionalOnProperty("something")
		static class OnProperty {
		}

	}

Fixes gh-1490
10 years ago
Phillip Webb 236026a43a Support mixed XA/non-XA ConnectionFactory beans
Update ActiveMQ and HornetQ XA configurations to also expose non-xa
ConnectionFactory variants.

Fixes gh-1461
10 years ago
Phillip Webb ba5c3526da Merge branch '1.1.x' 10 years ago
Phillip Webb 34cbcf5e50 Support better HttpMessageConverters manipulation
Add additional constructor and a protected postProcessConverters method
to make it easier to manipulate the final converter list that will
be used.

Fixes gh-1482
10 years ago
Phillip Webb 5774e808c7 Fix HornetQ ClassNotFound issues when not embedded
Update HornetQConnectionFactoryConfiguration and
HornetQXAConnectionFactoryConfiguration so that they no longer depend
on the HornetQ EmbeddedJMS class. EmbeddedJMS beans are started
(when possible) from the HornetQConnectionFactoryFactory.

Fixes gh-1480
10 years ago
Phillip Webb 4c8d35db43 Rename CompositeDataSourcePoolMetadataProvider
Rename CompositeDataSourcePoolMetadataProvider to
DataSourcePoolMetadataProviders.
10 years ago
Phillip Webb a512bcf766 Always auto-configure pool metadata providers
Import DataSourcePoolMetadataProvidersConfiguration from
DataSourceAutoConfiguration so that PoolMetadataProviders are configured
even if actuator is not used.
10 years ago
Phillip Webb 69107cb1df Create metadata sub-package
Create `org.springframework.boot.autoconfigure.jdbc.metadata` package
and move DataSourcePoolMetadata classes.
10 years ago
Phillip Webb e56be6cf3d DataSourceMetadata -> DataSourcePoolMetadata
Rename DataSourceMetadata to DataSourcePoolMetadata
10 years ago
Phillip Webb e17769fc2f Polish DataSourceMetrics code 10 years ago
Phillip Webb adbded33ff Apply eclipse formatting rules to 3dc932db 10 years ago
Stephane Nicoll 53c4859a6a Reuse data source validation query in health endpoint
This commit improves DataSourceMetadata to expose the validation
query. This can be used by DataSourceHealthIndicator as the query
to use instead of "guessing" which query could be applied according
to the database type.

Fixes gh-1282
10 years ago
Stephane Nicoll 2694941b93 Fix DataSourceMetadata location
This commit complements 3dc932db8 and fix the package location of
DataSourceMetadata.

Fixes gh-1013
10 years ago
Phillip Webb 0143bec831 Polish 10 years ago
David Liu b1ceb8a43b Add database property to RedisProperties
Add database property to RedisProperties and use it in
RedisAutoConfiguration.

Fixes gh-1379
10 years ago
Phillip Webb f8a4df0838 Polish 10 years ago
Stephane Nicoll a0c316d392 Improve RepositoryRestConfiguration customization
This commit binds RepositoryRestConfiguration to the spring.data.rest
prefix so that any of its property can be customized through the
environment.

If a RepositoryRestMvcConfiguration is defined in the context, those
customization do not apply, as it was the case before.

Fixes gh-1171
10 years ago
Phillip Webb ff870de0f0 Fix a few JTA issues
- Search for ConnectionFactories in java:/JmsXA and
  java:/XAConnectionFactory
- Remove javax.transaction:jta managed dependency
- Removed unused JtaProperties argument

Fixes gh-947
10 years ago
Phillip Webb 1024d5d42a Polish 10 years ago
David Liu f4ccaa874a Provide auto-configuration for Gson
Closes #1339
10 years ago
Phillip Webb 239d19d38c Support JNDI for JTA and JMS.
Update auto-configuration for JMS and JTA to support a ConnectionFactory
and TransactionManager exposed via JNDI.

JTA configuration now attempts a simple JtaTransactionManager before
attempting Bitronix or Atomikos configuration.

The JMS auto-configuration also now attempts to find a ConnectionFactory
from JNDI before falling back to the previous strategies. If JNDI is
present a JndiDestinationResolver is also configured instead of the
default DestinationResolver.

See gh-947
10 years ago
Phillip Webb da88bb4791 Update JMS auto-configuration to support XA
Update JMS auto-configuration for ActiveMQ and HornetQ to support XA
transactions.

See gh-947
10 years ago
Phillip Webb 8219f2be4c Update DataSource auto-configuration to support XA
Update DataSource and JPA auto-configuration to consider XA datasources.

See gh-947
10 years ago
Josh Long 5ef136511f Add Atomikos and Bitronix JTA auto-configuration
Add auto-configuration for the Atomikos and Bitronix JTA libraries.

See gh-947
10 years ago
Josh Long 508bd14ad9 Add SpringJtaPlatform for Hibernate
Add SpringJtaPlatform Hibernate AbstractJtaPlatform implementation. Also
relocated SpringNamingStrategy to the `hibernate` sub-package.

See gh-947
10 years ago
Phillip Webb b3ce079ea1 Automatically apply @EnableJMS
Automatically apply @EnableJMS when spring-jms is on the classpath
and the annotation hasn't already been applied. This allow for Spring's
new @JmsListener annotation to just work.

Fixes gh-1425
10 years ago
Phillip Webb a4925dabf7 Add property for JNDI DataSource lookup
Add `spring.datasource.jndi-name` property to allow a DataSource to be
looked up from JNDI as an alternative to defining a URL connection.

Fixes gh-989
10 years ago
Phillip Webb c98713ba95 Inject PlatformTransactionManager bean for JMS
Update JmsAutoConfiguration to inject any PlatformTransactionManager
bean into the DefaultJmsListenerContainerFactory.

Fixes gh-1444
10 years ago
Phillip Webb 5b9d45b231 Inject any existing JMS DestinationResolver bean
Update JmsAutoConfiguration to inject any existing DestinationResolver
bean into JmsTemplate and DefaultJmsListenerContainerFactory.

Fixes gh-1443
10 years ago
Phillip Webb 7a5248e38c Polish 10 years ago
Dave Syer 3404850b2e Merge branch '1.1.x' 10 years ago
Dave Syer 95d65c2ff5 Add indirection to avoid runtime dependency on MVC in templates
Velocity and Freemarker share some common properties so the base class for
configuring their properties makes some sense. Unfortunately the implementation
pulls in Spring MVC at runtime because of the signature of one method (that
would never be called). We can fix that in a number of ways, but the least
disruptive is probably to change the signature of that method and only refer
to the concrete template view resolver type if the method is called.

Fixes gh-1437
10 years ago
Dave Syer 5fd9af23d6 Merge branch '1.1.x' 10 years ago
Dave Syer 607f78a779 Add secure sample with JDBC and data.sql
We can't easily solve the problem by not allowing Spring Security to
eagerly instantiate everything, but we can be defensive about data.sql
and make sure it is executed even if the listener isn't yet registered.

Fixes gh-1386
10 years ago
Phillip Webb 658dc10722 Merge branch '1.1.x' 10 years ago
Phillip Webb d515595ca1 Detect embedded DBs when deducing driver class
Fix DataSourceProperties getUsername() and getPassword() methods to
call getDriverClassName() rather than using `this.driverClassName` to
ensure than deduced driver classes can be used.

Fixes gh-1421
10 years ago
Phillip Webb e6c18a00a1 Polish 10 years ago
Phillip Webb 77bf558307 Relocate configuration prefix constant
Relocate DataSourceAutoConfiguration.CONFIGURATION_PREFIX to
DataSourceProperties.PREFIX.
10 years ago
Phillip Webb 3512f56c0a Polish spaces->tabs 10 years ago
Phillip Webb 059bf3aae1 Use org.hsqldb.jdbc.JDBCDriver HSQLDB Driver
Switch driver class to the more conventionally named
`org.hsqldb.jdbc.JDBCDriver`.
10 years ago
Phillip Webb 49805661f0 Merge branch '1.1.x' 10 years ago
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
10 years ago
Dave Syer 171b2e452b Make ServerProperties bean conditional on being a webapp 10 years ago
Phillip Webb 83bd36d8e0 Merge branch '1.1.x'
Conflicts:
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java
10 years ago
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
10 years ago
Phillip Webb 6e6bc25c44 Polish 10 years ago
Dave Syer 91d3edc220 Tidy imports 10 years ago
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
10 years ago
Phillip Webb ebd0d265f8 Polish 10 years ago
Phillip Webb 8476a79dd2 Add support for RelaxedDataBinder aliases
Update RelaxedDataBinder to support property aliases and change
DataSourceBuilder to use them.

Fixes gh-1384
10 years ago
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
10 years ago
Phillip Webb e0c3dd79f9 Add String type attribute to OnBean conditions
Fixes gh-1381
10 years ago
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
10 years ago
Phillip Webb 21995cc85d Polish 10 years ago
Dave Syer 300910f7d5 Merge branch '1.1.x' 10 years ago
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
10 years ago
Phillip Webb acb621e84f Polish 10 years ago
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
10 years ago
Stephane Nicoll 6217c1b095 polishing 10 years ago
Spring Buildmaster 74d0c5185a Next development version 10 years ago
Dave Syer 178386abc4 Merge branch '1.1.x' 10 years ago
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
10 years ago
Phillip Webb 13bb23ac5a Merge branch '1.1.x' 10 years ago
Phillip Webb 88828f5097 Use MongoDbFactory to create GridFsTemplate
Update MongoDataAutoConfiguration to use the MongoDbFactory when
creating GridFsTemplate.

Fixes gh-1295
10 years ago
Andy Wilkinson ce02e86b89 Merge branch '1.1.x' 10 years ago
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
10 years ago
Dave Syer 68582bbac2 Merge branch '1.1.x' 10 years ago
Dave Syer 6c5f8f9581 Add @Inherited to @EnableAutoConfiguration
Fixes gh-1328
10 years ago
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
10 years ago
Phillip Webb 6825a7b42e Polish 10 years ago
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
10 years ago
Max Bruchmann ee40fb8cf1 Add auto-configuration for Thymeleaf data dialect
Closes #1120
10 years ago
Phillip Webb 53d24301d1 Merge branch '1.1.x' 10 years ago
Phillip Webb f8bf0e2031 Polish 10 years ago
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
10 years ago
Dave Syer 5ce4669055 Merge branch '1.1.x' 10 years ago
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
10 years ago
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
10 years ago
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.
10 years ago
Dave Syer 8cb90a5645 Merge branch '1.1.x' 10 years ago
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
10 years ago
Stephane Nicoll 120ad56a5c Replace @ConditionalOnExpression
This commit replaces @ConditionalOnExpression instances that are
checking for a specific value to @ConditionalOnPropertyValue
10 years ago
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
10 years ago
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
10 years ago
Stephane Nicoll 621b33f7ad Missing setter on spring.batch.job.names property
Relates to gh-1249
10 years ago
Stephane Nicoll 8f886e22ce Use @ConfigurationProperties for Thymeleaf
Add missing properties to complement 6568495

Fixes gh-1250
10 years ago
Stephane Nicoll 65684957ea Use @ConfigurationProperties for Thymeleaf
Fixes gh-1250
10 years ago
Stephane Nicoll 90cf722365 Use @ConfigurationProperties for Spring Batch
Fixes gh-1249
10 years ago
Stephane Nicoll 20e08494ae Fix typo 11 years ago
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
11 years ago
Stephane Nicoll 249e09d9bc Switch master to 1.2.0.BUILD-SNAPSHOT 11 years ago
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
11 years ago
Spring Buildmaster 40327e1ae6 Next development version 11 years ago
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
11 years ago
Phillip Webb 4ede9cd1be Support websockets with Tomcat 8.0.8
Fixes gh-1210
11 years ago
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.
11 years ago
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.
11 years ago
Phillip Webb fa88c481a5 Remote trailing whitespace 11 years ago
Toshiaki Maki e306cff4ff Fix typo in FlywayAutoConfiguration's javadoc
Closes #1183
11 years ago
Toshiaki Maki 9febd4a4cb Support sqlScriptEncoding in schema.sql
Fixes gh-1165, fixes gh-1164
11 years ago
Spring Buildmaster 981669b7c0 Next development version 11 years ago
Phillip Webb 200cd535c2 Revert "Next development version"
This reverts commit 67189477fe.
11 years ago
Spring Buildmaster 67189477fe Next development version 11 years ago
Phillip Webb 9632abf825 Formatting and cleanup 11 years ago
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
11 years ago
Spring Buildmaster 542f3cbda8 Next development version 11 years ago
Dave Syer b2db3790de Improve test for JobLauncherCommandLineRunner (see gh-1125) 11 years ago
Phillip Webb c713c8091d Polish 11 years ago
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
11 years ago
Phillip Webb bfe4240ed2 Polish 11 years ago
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
11 years ago
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
11 years ago
Dave Syer 1e5882b19c Make copy of job parameters before weeding out non-identifying ones
Fixes gh-1125
11 years ago
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
11 years ago
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
11 years ago
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
11 years ago
Phillip Webb 179e1558f6 Polish 11 years ago
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
11 years ago
Phillip Webb 25eb6fb81a Polish 11 years ago
Stephane Nicoll 2bff12a7b5 Better support for HornetQ embedded broker
Prior to this commit it was not safe to start several contexts
using the HornetQAutoConfiguration in the same VM. Each context
was trying to start their own HornetQ embedded broker by default but
only the first was really starting. Worse, the various InVM connection
factories were all silently connecting to the first broker.

This commit introduces a new "serverId" property that is an auto-
incremented integer by default. This identifies the server to connect
to and allows each context to start its own embedded broker in total
isolation of other contexts.

This commits makes it possible for a context to disable its own
embedded broker and connect to an existing one, potentially started
by another context.

Fixes gh-1063
11 years ago
Dave Syer 13076b8792 Order logger output by short classname
Fixes gh-1067
11 years ago
Stephane Nicoll b646231327 Properly close context hierarchy in tests
Prior to this commit, some tests were creating a parent/child
relationship but were only closing the child context. This could
be an issue with the autoconfig module as a lot of auto-config
kicks in by default.

This commit adds a new test utility designed to properly handle
those situations. Updated tests that were creating a context
hierarchy to benefit from that.

Fixes gh-1034
11 years ago
Dave Syer 571a82fe90 Add @EnableEntityLinks to hypermedia support 11 years ago
Dave Syer 2ddf322a65 Add @Conditional to prevent HATEOAS blowing up
Spring Plugin is required when using @EnableHypermediaSupport
11 years ago
Phillip Webb eddc6b31f1 Improve error message on condition exceptions
Catch exceptions thrown from SpringBootCondition and re-throw with
more context.

See gh-1098
11 years ago
Phillip Webb a374929c90 Polish 11 years ago
Dave Syer 1bf256dd58 Ensure Weblogic and Websphere JMX are covered
To ensure an MBeanServer is available when needed you have to
look in JNDI before resorting to the JDK platform factory.

I had to copy some private code from Spring, but it seems
worth it.

Fixes gh-1092
11 years ago
Spring Buildmaster 4ca26a21dc Next development version 11 years ago
Dave Syer d36f9ce8e0 Add tests for switching message sources in tests
See gh-1075
11 years ago
Dave Syer 8d6f003e9a Defensive null check in case Hibernate autoconfig is off
If the Hibernate autoconfig is not used to create an EntityManager
then I suppose it's possible that the JpaProperties might be null
when everything else is ready for the event to be published.

There's no test case because I think it's a corner case.

Fxies gh-1075
11 years ago
Dave Syer 32a220da8f Test for message properties 11 years ago
Spring Buildmaster 05ed7b3bcd Next development version 11 years ago
Phillip Webb 3341a5db2b Deprecate @ConditionalOnMissingClass.value
Fixes gh-1069
11 years ago
Dave Syer e8fcb0c875 Use classname instead of value in @ConditionalOnMissingClass
See gh-1065
11 years ago
Phillip Webb 3007a777d0 Roll back to 1.1.0.BUILD-SNAPSHOT 11 years ago
Dave Syer 36130b27e1 Support for Jmx (and Integration) autoconfig in parent contexts
When there are parent contexts we already had a strategy for registering
the actuator endpoints, but not the regular JMX or Integration MBeans.
This chnage makes the autoconfigs for JMX aware of the parent context.

Also adds a sample with a parent context.

See gh-847
11 years ago
Spring Buildmaster c650f2391e Next development version 11 years ago
Phillip Webb b5d267ca89 Polish 11 years ago
Phillip Webb 2ad4c47d18 Polish 11 years ago
Dave Syer dcb17a7cb5 Enhance @Conditionals for JMX autconfig
Fixes gh-1059
11 years ago
Roy Clarkson 1a32a6a06b Fix issues with DeviceDelegatingViewResolverAutoConfiguration
- Log to the correct class
- Set Auto-configure after Thymeleaf hint on main class instead of
  internal static class
- Use 'thymeleafViewResolver' bean name instead of class for
  conditional bean checks
- Fix class name in properties documentation

Fixes gh-1052
11 years ago
Dave Syer aa30fdba18 Add MBeanServer @Bean in case it is needed
Anywhere that an MBeanServer is needed it should be
created @Conditionally, so that user can exclude the
JmxAutoConfiguration and still get the other JMX
behaviours automatically.
11 years ago
Dave Syer 1a5c4f88b4 Fix compilation error 11 years ago
Dave Syer 39a94428d3 Add @Conditionals to permit JPA/Mongo mixed usage
I decided to go with both approaches (make the autoconfig for
repositories @ConditionalOnMissingBean(RepositoryFactoryBeanSupport),
so the first one wins; and also make them conditional on
spring.data.*.repositories.enabled=true. The ordering problem
is still there really (it's not defined which repositories will
be created by the autoconfig), so if a user is going to have
2 repository implementations on the classpath, he is going to
have to either choose one to disable, or manualy @Enable* the
other one.

Fixes gh-1042
11 years ago
Phillip Webb 2852f7422e Polish Spring Mobile Auto-configuration
Update Spring Mobile support with the following changes:
- Apply source formatting
- User lowercase property prefixes
- Use dashed notation when accessing properties
- Inline some constants

See gh-1049
11 years ago
Dave Syer 6902f2ac97 Revert on bean condition for mongo repositories 11 years ago
Dave Syer dd176ccacf Fix broken test (ordering) 11 years ago
Dave Syer 376d6fb9bc Add test for mixed Mongo/Jpa repositories 11 years ago
Dave Syer e81e94924c Fix Devc->Devic
(Leaving the docs changes for later)

Fixes gh-1049
11 years ago
Craig Walls f2351f1ece Add ProviderSignInController for Spring Social
Update SocialWebAutoConfiguration to add a ProviderSignInController.
Also fix default UserIdSource.

Fixes gh-1050
11 years ago
Roy Clarkson 8f32b87c81 Improve Spring Mobile Auto-configuration
- Upgrade Spring Mobile dependency to 1.1.2
- Rename SitePreferenceAutoConfiguration "enabled" property
- Add Auto-configuration for LiteDeviceDelegatingViewResolver
- Update docs

Fixes gh-1049
11 years ago
Phillip Webb e891aa3525 Polish 11 years ago
Phillip Webb 93aefa8537 Polish Flyway and Liquibase
Extract common "depends on" functionality to a new
EntityManagerFactoryDependsOnPostProcessor class.

Apply consistent formatting.

Fix issue with Flyway location detection.
11 years ago
Phillip Webb 4a6e66fe8b Polish ConditionalOnJava
Apply formating and simplify the condition implementation. Delegate
to Spring's JdkVersion class to obtain the running version.
11 years ago
Phillip Webb e032b673a2 Polish DataSourceInitialization code
Rename a few classes and methods relating to DataSourceInitialization
and update the DataSourceInitializedPublisher to check for Hibernate
settings.
11 years ago
Dave Syer 38af1c2eb3 Remove @EnableAutoConfiguration from autoconfigure tests
It was doing scary things (like starting elasticsearch, hornetq etc).
There's still an outstanding question about why the context was
not being properly closed in such a scenario (maybe one of those
embedded servers lurking on a background thread?).

See gh-1034
11 years ago
Dave Syer 09200361de Align expectations of various JMX configurations
They all want to create an MBeanServer and when that happens
user sees no MBeans, or sometimes just one set (Spring Core,
Spring Integration or Spring Boot). To harmonise them we
create a @Bean of type MBeanServer and link to it in the
other autoconfigs

Fixes gh-1046
11 years ago
Oliver Gierke 6f98c63ac0 Add auto-configuration for Jackson's JodaTime and JSR-310 modules
We now register the Jackson JodaTime module with Jackson ObjectMappers
if it is on the classpath. We also register the JSR-310 module if it's
on the classpath and the application is running Java 8 or better.

Extracted the Jackson specific configuration previously residing in
HttpMessageConvertersAutoConfiguration into a JacksonAutoConfiguration
class.

Added the Jackson JSR-310 module as a managed Boot dependency.
11 years ago
Oliver Gierke 30bef1e95e Add @ConditionalOnJava
Added a new @ConditionalOnJava annotation that allows to conditionally
enable configuration based on the Java version that is running. 

The annotation currently supports two modes of restricting Java versions:
the default mode checks for a Java version equal or better than the
requested one. Beyond that it can be configured to only match if Java
version is older than the configured one.
11 years ago
Dave Syer dff7a3bf7c Remove dead code in ServerProperties 11 years ago
Dave Syer 53cbe74d83 Disable HornetQ by default for testing 11 years ago
Dave Syer 37121e69e6 Make DataSourceInitialization a no-op if there is no DataSource
Fixes gh-1041
11 years ago
Dave Syer 32dff415c3 Rationalize the Reactor autoconfig
It didn't make sense not to do anything at all if a Reactor @Bean
was detected, so now we only back off creating the rootReactor if
one is present.
11 years ago
Stephane Nicoll 36e0d44eb2 Attempt to fix test failures on CI
This commit is an attempt to fix the build failures with the HornetQ
tests and relates to #1034
11 years ago
Stephane Nicoll 49697c7ad7 polishing 11 years ago
Dave Syer 0ccfba939e Switch to a matches-none filter for security.basic.enabled=false
There were some residual issues to do with the changes to the implementation
of security.basic.enabled=false. It was a good idea to have a filetr chain
triggered by the flag being off because it smooths the way for user-defined
filter chains to use the Boot AuthenticationManager (as a first step at least),
but it wasn't a goog idea to add any actual secuity features to that filter.
E.g. if it has HSTS then even an app like Sagan that has some secure endpoints
that it manages itself and the rest is unsecured has issues because it can't
accept connections over HTTP even on unsecure endpoints.

TODO: find a way for security.ssl_enabled=true to apply to only the user-
defined security filter (maybe not possible or worth the effort, since they
can inject a SecurityProperties if they need it?).

See gh-928
11 years ago
Stephane Nicoll 726991c144 Use an embed HornetQ broker by default
This commit changes the default behavior of the HornetQ auto
configuration. Prior to this commit, an embedded broker was only
started when it was requested explicitly by a configuration option.

This is inconsistent with the ActiveMQ support and boot favors the
easiest route. If the necessary classes are available, HornetQ is
embedded in the application by default.

Fixes gh-1029
11 years ago
Oliver Gierke d6718025e6 Make HypermediaAutoConfiguration more lenient.
HypermediaAutoConfiguration didn't consider an @EnableHypermediaSupport 
annotation being present in the user configuration which could've caused 
it to be evaluated twice.

This is especially the case if both the auto-configuration for Spring 
HATEOAS and Spring Data REST kick in as Spring Data REST actively declares
@EnableHypermediaSupport. The double evaluation then causes injection
ambiguities as we now get multiple beans of e.g. LinkDiscoverers deployed.
11 years ago
Dave Syer 74166e770a Revert deferred DDL changes and re-oreder database migrations
Schema initialization now happens in @PostConstruct (effectively)
whether it is via the Hibernate EntityManagerFactory or the
Boot DataSourceInitialization (in addition or instead). The data.sql
script if it exists is still executed on an event fired from the
other places, so those tests are passing.

Flyway and liquibase have bean factory post processors (like
the one they use to order the audit aspect in Spring Data) that
enforce a dependency on those components from the EntityManagerFactory.
So Hibernate validation is still happy (and there are 2 tests to
prove it now as well).

Fixes gh-1022
11 years ago
Andy Wilkinson f7d1aab9f3 Make ElasticSearchAutoConfiguration conditional on SD Elasticsearch
ElasticSearchAutoConfiguration depends on two Spring Data Elasticsearch
classes (TransportClientFactoryBean and NodeClientFactoryBean), however
it’s only conditional on Elasticsearch itself being on the classpath.
This lead to start up failures due to a ClassNotFoundException. Its
@ConditionalOnClass configuration has been updated so that the
auto-configuration will only be enabled if both Elasticsearch and Spring
Data Elasticsearch are on the classpath.

The dependencies on TransportClientFactoryBean and NodeClientFactoryBean
were ‘hidden’ in ElasticsearchProperties. The logic that uses these
types has been moved into ElasticSearchAutoConfiguration so that the
usage of the types and the related @ConditionalOnClass configuration
is in the same file.

Fixes #1023
11 years ago
Dave Syer 0def7644c2 Check for existence of ResourceBundle before creating MessageSource
Irritatingly a ResourceBundleMessageSource never gives up trying to
create a resource bundle for every message resolution, so to stop
it logging all those warnings (and probably sucking performance-wise)
we need to disable the MessageSource if a bundle is not provided.

Fixes gh-1019
11 years ago
Dave Syer 740c132c23 pool -> pool2 11 years ago
Dave Syer 251dbddc6e Use null instead of 'none' for ddlAuto
Fixes gh-1012
11 years ago
Dave Syer 56e70ca585 Introduce subpackages for Spring Data autoconfig
(If we ever want to modularize this will make it less painful)

Fixes gh-1015
11 years ago
Dave Syer bc5a4bcc1e Compiler warnings 11 years ago
Dave Syer 77eaa9b24e Defensive on startup with Multipart config 11 years ago
Dave Syer 1f82ef4deb Ensure JPA/Security are not fighting with each other on startup
This is *really* nasty (and led me to discover a related bug
https://jira.spring.io/browse/SPR-11844), but fortunately easy to
hide from users once you have a test case.

The problem is that Spring Security registers a `BeanPostProcessor`
to handle `GlobalAuthenticationConfigurerAdapters`, and Boot
registers a `BeanPostProcessor` to handle injecting the packages
to scan into an `EntityManagerFactory` from `@EntityScan`. The
clash comes because the `EntityScanBeanPostProcessor` wants to be
postprocessed by the Security postprocessor, but if the Security
configuration depends on JPA it won't be ready in time.

The fix (or workaround) depending on how you look at it is to
prevent the other bean post processors from taking an interest in
`EntityScanBeanPostProcessor` at all (mark it as synthetic).

Fixes gh-1008
11 years ago
Dave Syer 49a09c807c Defer SQL initialization to fit with JPA better
Added 2 new spring.datasource.* properties ("data" like
"schema", and "deferDdl" like the "spring.jpa.hibernate.*"
flag). The SQL scripts are then run separately and the "data"
ones are triggered by a new DataSourceInitializedEvent,
which is also published by the Hibernate DDL schema export.

Fixes gh-1006
11 years ago
Dave Syer efcbb32788 Remove some compiler warnings 11 years ago
Phillip Webb 738d195587 Create JMS sub-packages
Reorganize the `jms` package into `hornetq` and `activemq` sub-pacakges.

Fixes gh-1005
11 years ago
Phillip Webb e5cda040b0 Restore test classes
Restore test classes accidentally deleted and ignored in c43fd04f3e.
11 years ago
Phillip Webb c43fd04f3e Add Elasticsearch tests
Add unit tests for elasticsearch packages. Also refactor some
of the existing tests to prevent Repository clashes.

See gh-408
11 years ago
Artur Konczak 99940337a9 Add support for Elasticsearch
Add auto-configuration and starters for Elasticsearch.

Fixes gh-408
11 years ago
Stephane Nicoll 5a69bb9267 Add HornetQ JMS support
Provide auto-configuration support for HornetQ JMS broker, along with
an additional starter POM.

The connection factory connects to a broker available on the local
machine by default. A configuration switch allows to enable an embedded
mode that starts HornetQ as part of the application.

In such a mode, the spring.hornetq.embedded.* properties provide
additional options to configure the embedded broker. In particular,
message persistence and data directory locations can be specified. It is
also possible to define the queue(s) and topic(s) to create on startup.

Fixes: gh-765
11 years ago
Phillip Webb 67beba9464 Switch HSTS enum to upper case.
Since the RelaxedBinder now supports it.
11 years ago
Dave Syer ef7390d3f0 Add extra @Conditional to be defensive in Social autoconfig
Older versions of Spring Social will not have the SocialConfigurerAdapter
so making social autoconfig conditional on that class makes sense (since it
all extends from it).

Fixes gh-986
11 years ago
Dave Syer 29cb21c322 Be lenient with prefix and add period if missing 11 years ago
Dave Syer b0579c1cf3 Ensure JPA vendor properties are period separated
If you bind to Map<String,Object> you get a nested Map instead
of period-separated keys. This change just makes JpaProperties
expose a Map<String,String> so the keys are sane.

Fixes gh-988
11 years ago
Phillip Webb 11a093bdc0 Polish 11 years ago
Dave Syer 5e3cc95ccf Adjust security.basic.enabled=false behaviour
Actually the web-secure sample is misusing
security.basic.enabled=false (IMO) - it should be a flag
to say that you want to temporarily disable the basic security
fallback on application endpoins, not  way to disable all
security autoconfiguration.

Added test case to web-secure sample to ensure a user
can log in.

Fixes gh-979
11 years ago
Phillip Webb bdcb9407eb Restore commons-logging dependency for spring-boot
Restore the dependency on commons-logging (transitively via spring-core)
for spring-boot. This means that we are not tied directly to SLF4J, but
it is still an option that can be used via `jcl-over-slf4j`.

The `spring-boot-starter-parent` continues to replace `commons-logging`
with `jcl-over-slf4j`.

Fixes gh-981
11 years ago
Phillip Webb 5a5a7be477 Polish 11 years ago
Andy Wilkinson 7a8be3d600 Use Spring Framework bom and fully exclude commons-logging
Closes #955
Closes #978
11 years ago
Phillip Webb 7fd26a556d Fix social property binding
Update Spring Social auto-configurations to read properties using
the `dashed` notation and with the appropriate prefixes. This allows
properties to be specified in any of the relaxed forms.

Also minor refactor to extract common logic to a new
SocialAutoConfigurerAdapter base class.

See gh-941
11 years ago
Andy Wilkinson 47e3a72390 Source code formatting 11 years ago
Craig Walls 5e1913576e Document Spring Social support 11 years ago
Craig Walls f006b1231c Add Spring Social autoconfiguration 11 years ago
Phillip Webb 6381fdcb49 Polish 11 years ago
Dave Syer 43481725b9 Fix bug in DataSourceBuilder 11 years ago
Dave Syer 32295b9bdc Add options for Flyway to have its own DataSource
Either set flyway.[url,user,password] or create a DataSource
@Bean and mark it @FlywayDataSource.

Fixes gh-807
11 years ago
Roy Clarkson 9f52a0dbd7 Add Spring Mobile SitePreferenceAutoConfiguration
New feature in Spring Mobile (user preferences per site).

Fixes gh-946
11 years ago
Dave Syer 68448a8c68 Use the ServerProperties to add prefixes to paths
when server.servletPath is set we need to add prefixes to
the security filter paths.

Fixes gh-945
11 years ago
Phillip Webb 28f88562f2 Make AutoConfigurationPackages.set public
Open up AutoConfigurationPackages.set(...) to allow programmatic
configuration of base packages.

Fixes gh-924
11 years ago
Phillip Webb a6b94e7cef Fix typo in warning 11 years ago
Andy Wilkinson f21151e594 Dont’t auto-configure FreeMarker and Velocity without context-support
Boot’s auto-configuration for FreeMarker and Velocity relies on Spring’s
support for them that’s packaged in spring-context-support. Only
auto-configure them if their respective Spring classes are on the
classpath

Fixes #940
11 years ago
Dave Syer 4999d41145 Add test for servletMapping() 11 years ago
Dave Syer 660d9e24dc Add servlet path to /error if it is customized
In addition I added some convenience methods to ServerProperties
(servletMapping() and servletPrefix()) for manipulating the
servlet path as provided by the user (e.g. normalizing it into
a valid Servlet mapping path for the DispatcherServlet).

Fixes gh-939, see also gh-936
11 years ago
Phillip Webb 0897cfb51b Deprecate and warn on namingstrategy
Deprecate setNamingstrategy() and log a warning letting people know
that they should use `naming-strategy`.

Issue #928
11 years ago
Andy Wilkinson aaa5b9ddf1 Continue to support spring.jpa.hibernate.namingstrategy
In 1.0, the property spring.jpa.hibernate.namingstrategy could be
used to configure Hibernate's naming strategy. This was at odds with
most other configuration where binding to namingStrategy would require
a property with some indication that it was two separate words, for
example: naming-strategy, naming_strategy, or namingStrategy

This commit adds a new setter, setNamingstrategy, to JpaProperties so
that an app that was using namingstrategy in 1.0 continues to work
in 1.1.

Issue #928
11 years ago
Phillip Webb 1a475102de Polish 11 years ago
apoplexy dfc1979ea2 Allow the tomcat maxHttpHeaderSize to be changed in external config
Prevents large SPNEGO headers from causing server errors for example.
Added the property to ServerProperties.

Fixes gh-931
11 years ago
Andy Wilkinson e45ef06b56 Polish Spring Data Solr integration 11 years ago
Christoph Strobl 6ed69709d7 Add auto configuration support for Spring Data Solr
Registers required components in application context if not available to
set up environment for usage with Spring Data Solr. Will listen on
SolrServer and SolrRepositories for configuration.

By default an HttpSolrServer is registered unless a zkHost (zookeeper
host) is defined. In that case an instance of CloudSolrServer will be
created.

By default multicore support is enabled, creating instances of
SolrServer for each core defined via @SolrDocument.
11 years ago
Dave Syer 146a337b53 Ensure Mongo autoconfig is easy to exclude 11 years ago
Dave Syer e9d594c693 Add conditional processing option for unhelpful FactoryBeans
OnBeanCondition has some issues with FactoryBean object types where
the FactoryBean is not generic (i.e. you have to instantiate it to
get its object type). This is a known issue (see tests in
ConditionalOnMissingBeanTests), but we can provide some help for
library authors who know the type in advance. The approach we have
taken here is to check the BeanDefinition for an attribute called
"factoryBeanObjectType" (OnBeanCondition.FACTORY_BEAN_OBJECT_TYPE)
which, if it exists, can be used as a tie-breaker. Its value should
be a Class<?> instance.

Fixes gh-921
11 years ago
Dave Syer 86ff5315b4 Update to Jedis 2.4.1 means commons-pool2
Fixes gh-918
11 years ago
Andy Wilkinson 00b18b114a Merge branch '1.0.x' 11 years ago
Phillip Webb 8bcda1bcbe Polish 11 years ago
Dave Syer 233a2e8fb5 Fix ordering problem with Mongo autoconfig 11 years ago
Andy Wilkinson eeefbdd5f8 Polish dependency management
- Remove dependency management for projects that Boot does not have a
  runtime dependency upon
- Provide dependency management for all of Spring Batch’s modules
11 years ago
Dave Syer e118515d7a Use Flyway to bind flyway.*
Since Flyway has bean properties (with getters and setters)
it can be used to bin directly to the Environment (instead of
copying all the properties into FlywayProperties).

Fixes gh-806
11 years ago
Dave Syer 7787b2ef6a Make Groovy templates work with Groovy 2.2
Fixes gh-890
11 years ago
Dave Syer e964b9eb34 Improved integration with Groovy 2.3.1
Groovy 2.3.1 has a new template loader abstraction that handles
compiler caching (better performance by factor of 10).
11 years ago
Dave Syer 85ac8f6b05 Add config hint to template error messages 11 years ago
Dave Syer 93a33f0197 Fix test 11 years ago
Andy Wilkinson 2378fe0900 Add support for using Velocity templates 11 years ago
Maciej Walkowiak b33eb95dd2 Added DriverClassNameProvider used for providing jdbc driver class based on jdbc url
Uses known databases from org.flywaydb.core.internal.util.jdbc.DriverDataSource

Fixes gh-824, fixes gh-809
11 years ago
Dave Syer a5543f18b9 Add callback for modifying or inspecting LocalContainerEntityManagerFactoryBean
A callback is added in autoconfig, so that if users inject the EntityManagerFactoryBuilder
into their app and use it to create multiple EntityManagerFactories, they all get the
same deferred DDL behaviour. The deferred DDL can also be disabled by setting
spring.jpa.hibernate.deferDdl=true.

Fixes gh-894
11 years ago
Dave Syer f2e3d94fa1 Use Hibernate native APIs to defer processing DDL
The EntityManagerFactory will happily process the DDL on startup, but
that happens too early (because of LoadtimeWeaverAware processing). We
can defer it to a more civilised stage, e.g. ContextRefreshedEvent by
using the Hibernate native APIs directly.

It makes the JpaProperties slightly more complex because they need
to distinguish between the early init and late processing versions
of the Hibernate properties.

Not ready for prime time yet because there is no way to deal with
multiple EntityManagers.

Fixes gh-894
11 years ago
Dave Syer 2cc5bdfa09 Hack to force Flyway to initialize early 11 years ago
Dave Syer 53ff50adb6 Map oracle->oracle10g for Batch schema initialization
Fixes gh-892
11 years ago
Dave Syer 586b52faf5 Fix Groovy template URLs 11 years ago
Dave Syer c8ca2495de Use URLs for groovy template resources 11 years ago
Dave Syer 7c7d1f55e0 Add RequestContext to Groovy template view model 11 years ago
Dave Syer f572992c5d Relax requirement for groovy template directory to exist
Since groovy-templates is included with groovy-all it is unreasonable
to expect anyone who has it on their classpath to have resolvable templates.
We may need to revisit this decision, but since the origain feature
that drove this was thymeleaf and idaiotic users having it on their
classpath but not using it, maybe we don't need to.
11 years ago
Dave Syer 15303a2de6 Add GroovyTemplates to autconfig 11 years ago
Dave Syer da2e25f90d Add Groovy template engine support for Spring MVC apps
Default suffix .tpl. If groovy-templates is on the classpath user
can now add templates and get them rendered and resolved in an MVC
app.

TODO: Macro helpers for message rendering etc.

See gh-878
11 years ago
Phillip Webb 938609fdc0 Merge branch '1.0.x'
Conflicts:
	spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
11 years ago
Phillip Webb 0b4e2b3667 Polish revisted JMS support
- Add createConnectionFactory method on ActiveMQProperties
- Change getBrokerUrl to return the broker URL and add new deduce method
- Move static methods to end of class
- Apply source formatting
11 years ago
Phillip Webb fa7da5925b Remove checked exceptions from @PostConstructs
Update all @PostConstruct methods to ensure that they don't throw
checked exceptions. Required to allow deployment of Spring Boot
applications on Glassfish.

Fixes gh-868
11 years ago
Stephane Nicoll e695e5d637 Revisit JMS support
Since ActiveMQ 5.8.0, the modules structure has been revisited and
activemq-core no longer exists. The activemq-broker is required to
create an embedded broker. Since Boot creates such broker by default
if ConnectionFactory is present, a condition has been added to do so
only when the necessary classes are present in the classpath.

The default embedded broker is now configured to disable message
persistence altogether as this requires an extra jar since 5.8.0, i.e.
activemq-kahadb-store.

Split the ActiveMQ auto configuration from the JmsTemplate auto
configuration so these are totally independent.
ActiveMQAutoConfiguration has been created to detect and configure
the ActiveMQ broker if necessary.

The brokerUrl parameter was ignored as long as the inMemory parameter
was true. The actual brokerUrl to use is now determined by the user
defined values of those parameters: if the brokerUrl is set, it is always
used. If no brokerUrl is set, the value of inMemory determines if an
embedded broker should be used (true) or a tcp connection to an
existing local broker (false).

JmsTemplateAutoConfiguration now creates a JmsTemplate only if a
ConnectionFactory is available.

Fixes gh-872, gh-882, gh-883
11 years ago
Dave Syer 0a11459c3e path->templateLoaderPath 11 years ago
Phillip Webb aaf50a768c spring.freemarker.templateLoaderPath -> path
Fixup tests and documentation following the rename of
spring.freemarker.templateLoaderPath to spring.freemarker.path
11 years ago
Dave Syer d2112e27a3 Add FreeMarkerProperties instead of raw Environment access
It's better for readability and tooling. Changed
templateLoaderPath -> path (simpler and unlikely to clash)
11 years ago
Dave Syer 6a10df0933 Fix freeMarker->freemarker 11 years ago
Dave Syer aca0d38f08 Make OnExpressionCondition package private
(consistent with the other Condition implementations)
11 years ago
Phillip Webb 01fcf61140 Polish 11 years ago
Dave Syer 7454c4866b Support for @ConfigurationProperties in JPA
Adds JpaProperties to bind to spring.jpa.* (making those
properties easier to reason about and visible in the
/configprops endpoint).

Also allows easy configuration of multiple EntityManagerFactories via new
EntityManagerFactoryBuilder. JpaBaseConfiguration has a @Bean of that type
so users can inject it to create new or additional EntityManagerFactories.
This also simplifies the Hibernate autoconfiguration.

Also renames the DataSourceFactory to DataSourceBuilder (since that's what it
is).
11 years ago
Dave Syer 5249f54c5a Integrate @ConfigurationProperties @Beans with DataSource configuration
We now have a much simpler DataSourceAutoConfiguration that binds to whatever
DataSource concrete type it finds at runtime. To be able to quickly switch between
Hikari and the other types of DataSource there's a minute shim for translating
the common properties (username, password, url, driverClassName), but actually
only url is different. The shim and also DataSource initialization is supported
through DataSourceProperties, but the other native properties get bound directly
through the concrete runtime type of the DataSource.

The /configprops endpoint works (and is exposed in the actuator sample).

Fixes gh-840, fixes gh-477, see also gh-808.
11 years ago
Dave Syer 1b284a0619 Add RelaxedDataSourceFactory 11 years ago
Christian Dupuis 9e56c38b7a Rename DefaulErrorAttributes to DefaultErrorAttributes
fixes #853
11 years ago
Christian Dupuis d8ec2719d7 Fix RedisAutoConfiguration with pool config
fixes #850
11 years ago
Phillip Webb 30ac768cbf Remove @ControllerAdvice from BasicErrorController
Update the BasicErrorController so that it no longer needs to implement
@ControllerAdvice or have an @ExceptionHandler method.

A new ErrorAttributes interface is now used to obtain error details,
the DefaultErrorAttributes implementation uses a
HandlerExceptionResolver to obtain root exception details if the
`javax.servlet.error.*` attributes are missing.

This change also removes the need for the extract(...) method on
ErrorController as classes such as WebRequestTraceFilter can
now use the ErrorAttributes interface directly.

See gh-839, gh-538
Fixes gh-843
11 years ago
Dave Syer 59a899a4da Add @ResponseStatus handler to global exception handler
We might need to revisit this to allow more fine-grained
control by users, but it seems like a sensible default.
The BasicErrorController now uses both of the deafult strategies
(ResponseStatusExceptionResolver and DefaultHandlerExceptionResolver)
from Spring MVC to try and determine an appropriate response.

Fixes gh-839
11 years ago
Lukasz Kryger 254b175c0a Read data-{platform}.sql in addition to data.sql
Update DataSourceAutoConfiguration to read platform specific `data.sql`
files in the same way as `schema.sql` files.

Fixes gh-837
11 years ago
Phillip Webb dac03fdb7b Extract WebMvcProperties
Extract WebMvcProperties from WebMvcAutoConfiguration and also
update conditionals to use @ConditionalOnProperty.
11 years ago
Phillip Webb 1c0cce441d Add spring.resources.add-mappings property
Add `spring.resources.add-mappings` allowing users to configure if
resource mappings should be added or not.

Fixes gh-804
11 years ago
Phillip Webb 4b51b6f9df Support relaxed names with ConditionalOnProperty
Update ConditionalOnProperty to optionally support relaxed form names.

Fixes gh-835
11 years ago
Maciej Walkowiak b79132ceff Update @ConditionalOnProperty to not match false
Update @ConditionalOnProperty so that properties that are present but
contain the value `false` are not considered a match.

Fixes gh-812
11 years ago
Maciej Walkowiak 56b8faf31b Add @ConditionalOnProperty annotation
Add @ConditionalOnProperty which enables conditional bean creation when
all required properties are defined in the Environment.

Fixes gh-812
11 years ago
Dave Syer 14d3b46809 Add constants to SecurityProperties and ManagementServerProperties
For the convenience of users who want to selectively override the
access rules in an application without taking complete control of the
security configuration we now have some constants:

* SecurityProperties.ACCESS_OVERRIDE_ORDER for overriding just the
application endpoint access rules

* ManagementServerProperties.ACCESS_OVERRIDE_ORDER for overriding the
application endpoint and management endpoint access rules

Fixes gh-803
11 years ago
Dave Syer f04f265515 Remove some compiler warnings 11 years ago
Andy Wilkinson f02a21f3fb Use the official JMS spec artifact 11 years ago
Andy Wilkinson 62ac51eead Upgrade to the Spring Data Dijkstra release train
In addition to the upgrade to Dijkstra (#743) Spring HATEOAS has been
upgraded to 0.11.0 (#801) and Mongo's Java driver has been upgraded to
2.12.1 (#689). In both cases this is the same version as is used by
Dijkstra RC1.

The new version of Mongo's Java driver changes the exception that's
thrown when Mongo isn't running and a connection attempt fails. The
Mongo sample has been updated accordingly.

RepositoryRestMvcAutoConfiguration has been updated to be configured
before JpaRepositoriesAutoConfiguration. This ensures that the
former's transitive import of SpringDataJacksonConfiguration takes
precedence over the latter's import of the same. This is necessary as
RepositoryRestMvcConfiguration requires a bean that's declared by
SpringDataJacksonConfiguration and, if JpaRepositoriesAutoConfiguration
is processed first, its conditions may cause the import
SpringDataJacksonConfiguration to be skipped causing instantiation
of RepositoryRestMvcConfiguration to fail.

Closes #689
Closes #743
11 years ago
Greg Turnquist 5eb08dc32e Upgrade to ActiveMQ 5.9.1
Closes #397 and #717
11 years ago
Stephane Nicoll 33082fd56d Harmonized maven dependency management
This commit harmonizes the dependency management of internal modules
so that versions can be omitted everywhere. Update the maven coordinates
to provide the full groupId for consistency
11 years ago
Stephane Nicoll a330cb9b8a Improve remote shell security documentation
Previous to this commit, the remote shell security configuration
described that a default password will be generated with no extra
configuration. Actually, when Spring Security is configured for the
application, the remote shell reuses that configuration by default.

It turns out that the default log message is confusing as it was
referring to "application endpoints". Updated that log to a more
generic log message and updated doc accordingly.

Fixes gh-779
11 years ago
Marcel Overdijk 0f738be114 Add specifying (fixed) date format via application properties
Fixes gh-778, Fixes gh-755
11 years ago
Dave Syer 41395d08e3 Upgrade flyway to 3.0
Fixes gh-771
11 years ago
Phillip Webb 5127614d59 Restore freeMarkerConfiguration for web
Restore `freemarker.template.Configuration` bean for the
FreeMarkerWebConfiguration. The @Bean method no longer uses a
@Condition since `FreeMarkerConfig` must already exist.
11 years ago
Phillip Webb 761b6e3229 Combine FreeMarkerAutoConfigurationTests
Combine and polish FreeMarkerAutoConfigurationTests and
FreeMarkerNonWebappTests
11 years ago
Phillip Webb b5451d54ee Polish 11 years ago
Dave Syer b04304b691 Add @since 11 years ago
Dave Syer 799f9edb0b Harmonize enabled flags for flyway and liquibase 11 years ago
Dave Syer 2cd7b13096 Drop 'spring' from 'spring.[liquibase,flyway]' 11 years ago
Dave Syer 5548b24c4c Add autoconfig support for Flyway migrations
Flyway starts up with its default settings if it is on the classpath.
You can also ask Boot to barf if the migration scripts are missing.

Fixes gh-730
11 years ago
Marcel Overdijk 68e33b25c1 Added liquibase autoconfiguration for database migrations
If Liquibase is on the classpath it will fire up on startup. Various
config options are available (as well as the option to disable it).
Liquibase uses a YAML format for changes (in classpath:db/changelog).
11 years ago
Dave Syer ed64640ea4 Switch from @Bean to protected method 11 years ago
Phillip Webb 4248665fcd Remove freemarkerConfiguration bean
Remove `freemarkerConfiguration` from the FreeMarkerAutoConfiguration
since it should not be needed for most applications.

The previous code also caused problems since it included a
@ConditionalOnBean annotation on a bean that was created in the same
configuration.
11 years ago
Phillip Webb 2fe256a8aa Polish 11 years ago
Dave Syer 0540cecbd4 Fix test in FreeMarker support 11 years ago
Dave Syer cb1b3481be Add support for FreeMarker in non-webapp
The existing freemarker support only works in a webapp. This
change adds a FreeMarker Configuration bean (in both web- and
non webapps) so it can be used to load a Template and render it
(e.g. with Spring's FreeMarkerTemplateUtils).

See gh-679
11 years ago
Artem Bilan ce3aafa7a9 Upgrade to Spring Integration 4.0
Closes #751
11 years ago
Phillip Webb 6025f45aa0 Polish 11 years ago
Phillip Webb fb13bf9016 Move TemplateAvailabilityProvider
Move TemplateAvailabilityProvider from the spring-boot project to
spring-boot-autoconfigure
11 years ago
Phillip Webb decee8d871 Polish templates code 11 years ago
Dave Syer 537b0c3ff3 Use enum for MessageCodesResolver format
Fixes gh-670
11 years ago
Marcel Overdijk 1cbef02236 Add messagecode resolver format based on application property 11 years ago
Stephane Nicoll e26e06d5dd Fix build
Two modules are still relying on the spring-boot test-jar but it was
not generated anymore. Adding the generation of test-jar again as
a workaround until we completely removes the use of it.
11 years ago
Dave Syer 030f00c36d Convert actuator-ui sample to FreeMarker
See gh-679
11 years ago
Dave Syer 50190a4de7 Add support for HikariDataSource
We still prefer Tomcat if it is available (that can change
if the community asks loudly enough). Hikari is supported
via the same spring.datasource.* properties as Tomcat (and
DBCP), with some modifications:

* The validation and timeout settings are not as fine-grained
in Hikari, so many of them will simply be ignored. The most
common options (url, username, password, driverClassName) all
work as expected.

* The Hikari team recommends using a vendor-specific DataSource
via spring.datasource.dataSourceClassName and supplying it with
Properties (spring.datasource.hikari.*).

Hikari prefers the JDBC4 isValid() API (encapsulates vendor-
specific queries) which is probably a good thing, but we
haven't provided any explicit support or testing for that yet.

Fixes gh-418
11 years ago
Dave Syer f46d281b22 Upgrade to Reactor 1.1
Fixes gh-706
11 years ago
Andy Wilkinson 7c91176186 Add FreeMarker support
This commit adds auto-configuration and a starter,
spring-boot-starter-freemarker, for using FreeMarker view templates in
a web application.

A new abstraction, TemplateAvailabilityProvider, has been introduced.
This decouples ErrorMvcAutoConfiguration from the various view
technologies that Spring Boot now supports, allowing it to determine
when a custom error template is provided without knowing the details of
each view technology.

Closes #679
11 years ago
Dave Syer ef4e83a879 Move ErrorController to autoconfig 11 years ago
Andy Wilkinson b6cd2c970c Use Jedis rather than Lettuce as preferred Redis client
Salvatore has indicated that Jedis is his Java Redis client of choice.
This commit updates the auto-configuration support, actuator and
Redis starter accordingly.

Completes #745
11 years ago
Dave Syer b20262c1a7 Backout couchbase changes 11 years ago
Dave Syer e433eb20a6 Align couchbase more with other data-* support 11 years ago
sopov.ivan 174b654faf minor test fixes
Reverting arguments in assertEquals where constant was placed on
the "actual" place. Replacing assertEquals with assertFalse, assertTrue
and assertNull where applicable.

Fixes gh-735
11 years ago
Dave Syer 477b199cd6 Add ApplicationEventPublisher explicitly to security publisher
For some reason the exception mappings are only created with the
publisher is initialized in the constructor of DefaultAuthenticationEventPublisher.
Changed SpringBootWebSecurityConfiguration to do that rather then
relying on the ApplicationEventPublisherAware behaviour to inject it.

Fixes gh-719
11 years ago
Dave Syer 6ac85c1759 Add username/password and MongoClientOptions to Mongo config
The username/password option stil lonly works for a single host (to
connect to a cluster I suspect you need to set the URI). Also added
a MongoClientOptions (if a bean of that type exists it will be
used to populate the options that aren't in the URI).

Fixed gh-536
11 years ago
Phillip Webb 5dabd7fb41 Rename MongoTemplateAutoConfiguration
Rename MongoTemplateAutoConfiguration to MongoDataAutoConfiguration
since it now configures more than just the template.
11 years ago
Phillip Webb a7f5cbf7d0 Polish mongo changes
Restore formatting and fixup doc comments.
11 years ago
Phillip Webb 2adf30950e Polish couchbase support
Polish couchbase support to:
- Extract properties into its own class
- Remove unnecessary inner configuration class
- Add since tags
- Format code and add `this.` references
11 years ago
Phillip Webb fba08e7811 Polish 11 years ago
Phillip Webb 1ae91a135c Polish MultipartConfigElement support
Polish MultipartConfigElement changes introduced in commit e8e59ea6
as follows:

- Fix javadoc formatting
- Fix tab/spaces formatting
- Fix asciidoc formatting
- Move creation of MultipartConfigElement into MultipartProperties
- Add @Since tags
- Restore random port in tests
11 years ago
sopov.ivan 10d82e28ff minor - correcting modifiers order 11 years ago
Dave Syer 94dd510b52 Merge GridFs with MongoTemplate configuration 11 years ago
Josh Long f36f2024e2 Update GridFsTemplateAutoConfiguration.java
improved documentation.
11 years ago
Josh Long 330c95d6ab Update GridFsTemplateAutoConfigurationTests.java
improved documentation
11 years ago
Josh Long 0d53b9d9fa adding initial GridFS integration. 11 years ago
Michael Nitschinger 78ce06ccc7 Add support for spring-data-couchbase
Fixes gh-124
11 years ago
Stephane Nicoll c4ffe721c7 Fix JmsTemplate default pubSubDomain setting
Prior to this commit, a JmsTemplate bean created automatically by Boot
had its "pubSubDomain" flag enabled. It's far more usual to fallback on
queue rather than topic.

This commit flips the default value of the configuration property.
11 years ago
Rob Winch ae7098ae1d Add RepositoryRestMvcAutoConfiguration
Fixes gh-626
11 years ago
Dave Syer 63f2d6ab15 Remove compiler warnings related to Batch upgrade 11 years ago
Dave Syer 3173646635 Fix another test from gh-708 11 years ago
Dave Syer d597cc3387 Fix test broken in gh-708 11 years ago
Roy Clarkson 6ad7257baf Add auto-configuration for @EnableHypermediaSupport
If Spring HATEOAS is on the class path, then @EnableHypermediaSupport
will be auto-configured with HAL support.
11 years ago
Josh Long e8e59ea657 MultipartConfigElement autoconfig support.
Fixes gh-708
11 years ago
Phillip Webb 64a835e91a Move master to 1.1.0.BUILD-SNAPSHOT 11 years ago
Spring Buildmaster d3954a1703 Next development version 11 years ago
Phillip Webb 4119ef5cf4 Use random ports for tests
Update remaining tests to use random ports.

Fixes gh-337
11 years ago
Phillip Webb fad5ce45db Polish 11 years ago
Dave Syer 3304dd1cc9 Add spring.datasource.separator (default ";")
Fixes gh-715
11 years ago
Dave Syer f7c16764e6 Add setter for security.user.role
Fixes gh-700
11 years ago
Marcel Overdijk f78f836fc0 Add fixedlocaleresolver based on application property
If the user sets spring.mvc.locale and doesn't provide a @Bean
of type LocaleResolver then a FixedLocaleResolver will be provided.

Fixes gh-697, fixes gh-669
11 years ago
Dave Syer 0b89402240 Add spring.thymeleaf.contentType (defaults to HTML)
User can specify the content type in external properties now, optionally
ommitting the charset (since that is duplicated). If charset is not
appended by user Spring will do it.

Fixes gh-671
11 years ago
Spring Buildmaster a5864ebcd0 Next development version 11 years ago
Phillip Webb 2bb0f744e0 Polish 11 years ago
Jean Detoeuf 5077b6cc65 Added ActiveMqCredentials (optional)
Fixes gh-618
11 years ago
Dave Syer 5ed49462c4 Add spring.messages.cacheSeconds to global config
Fixes gh-625
11 years ago
Dave Syer 97adb5c1b3 Ensure ddl-auto=none for non-embedded database
A more thorough check is needed to avoid the false assumption
that the DataSource is embedded just because an embedded database
is on the classpath. You really have to try and look in the connection
metadata, so that's what we now do.

Fixes gh-621, fixes gh-373
11 years ago
Spring Buildmaster 15e9dbe98b Next development version 11 years ago
Phillip Webb 1e68b7e0a9 Remove superfluous <packaging> tags from POMs 11 years ago
Phillip Webb 0af7f7e347 Add missing POM info 11 years ago
Phillip Webb 488b03387f Polish POM formatting 11 years ago
Phillip Webb 6f9bb233ad Revert "Next development version"
This reverts commit b67bb70ee3.
11 years ago
Spring Buildmaster b67bb70ee3 Next development version 11 years ago
Phillip Webb ac4cdd33c3 Revert "Next development version"
This reverts commit 1d0eea12eb.
Returning to 1.0.0.BUILD-SNAPSHOT for an updated release.
11 years ago
Spring Buildmaster 1d0eea12eb Next development version 11 years ago
Phillip Webb beaddb2362 Polish 11 years ago
Dave Syer 006d7b6931 Move MongoTemplateAutoConfiguration to mongo package 11 years ago
Phillip Webb 44d708ef7a Polish 11 years ago
Phillip Webb c11d94105a Log AutoConfigurationPackages warnings just once
Update AutoConfigurationPackages to log warnings on the first access,
rather than during setup. This works around the fact that the CLI
currently add multiple @EnableAutoConfiguration annotations.

Fixes gh-579
11 years ago
Dave Syer e059d0cd5f Re-order security auto configuration so the fallback can be applied
The management security autoconfiguration wanted to come last in the chain
but that won't suit the fallback that was already in place for gh-568. This
change re-orders the autoconfig so that @EnableWebSecurity is still added
if the user sets security.basic.enabled=false and includes the actuator
endpoints.

Fixes gh-568
11 years ago
Dave Syer 59124d07c4 Switch on @EnableTransactionManagement by default
Fixes gh-576
11 years ago
Dave Syer 809a5a711f Add a @EnableWebSecurity if it looks like the user needs one
If the user explicitly disables the basic security features and forgets to
@EnableWebSecurity, and yet still wants a bean of type
WebSecurityConfigurerAdapter, he is trying to use a custom
security setup and the app would fail in a confusing way without
this change.

Fixes gh-568
11 years ago
Dave Syer a821092bbd Log a warning if repository autscan is set to default package
Fixes gh-572
11 years ago
Stephane Nicoll 87321edf36 Support Tomcat uri encoding (with UTF-8 default)
Introduce an extra `server.tomcat.uri-encoding` property used to
configure the URI encoding for the embedded tomcat container.

Defaults to `UTF-8` instead of the usual tomcat default of `ISO-8859-1`.

Fixes gh-540
11 years ago
Phillip Webb d42bedf295 Rename @ConfigurationProperties attributes
Rename `name` to `prefix` and `path` to `locations`.
11 years ago
Dave Syer 770c115d88 Allow Batch configuration without DataSource
If the user provides a JobExplorer and a BatchConfigurer that
don't require a DataSource we can back off on configuring ours
(and anything else that needs a DataSource).

Fixes gh-561
11 years ago
Dave Syer 86054a9c53 Use reflection to setup Websocket SCI so it works in Tomcat 8
Annoyingly this is necessary if we want to support Tomcat 7 and 8
since the package name changed.

Fixes gh-554
11 years ago
Dave Syer 3496f3f9dc Add marker interface for non-embedded servlet container
ErrorPageFilter is itself an EmbeddedServletContainerFactory
but it runs in a non-embedded container. Any component that assumes
the presence of an EmbeddedServletContainerFactory implies we are
running embedded is therefore invalid. WebSocketAutoConfiguration
had that problem.

Fixes gh-551
11 years ago
Dave Syer 373e2c5156 Allow user to opt out of ContentNegotiatingViewResolver
The bean ID for the ContentNegotiatingViewResolver is now
"viewResolver" (it is the *one*). The conditions have been changed
so that a user only has to define a bean of the same name to switch
it off.

Fixes gh-546
11 years ago
Dave Syer 4637c2a8f7 Accept viewNames and excludedViewNames for ThymeleafViewResolver
(via spring.thymeleaf.*).

Fixes gh-548
11 years ago
Dave Syer e472e7ccca Use forward:/index.html for home page
Fixes gh-549
11 years ago
Phillip Webb 03667c7ddc Rename a few `setup` methods to `configure`
Fixes gh-537
11 years ago
Phillip Webb 3193913899 Polish 11 years ago
Chris Savory 7be2d97d49 Allow multiple MessageSources that are comma separated.
Fixes gh-532, Fixes gh-506
11 years ago
Phillip Webb 798229f530 Document rabbit.addresses property 11 years ago
Dave Syer 01137b6fd6 Add "addresses" to RabbitProperties
If user sets addresses it supercedes anything that was set in host
or port (same as in the native ConnectionFactory).

Fixes gh-524
11 years ago
Piotr Maj 2e74251d1b Add support for sorting json keys
Add `jsonSortKeys` property to HttpMapperProperties.

Fixes gh-498
11 years ago
Phillip Webb c5ee3c7eba Remove duplicate documentation
Remove README files that have been since been migrated to the reference
documentation. Also updated remaining markdown files to asciidoctor to
save having a mix of different formats.

Fixed gh-503
11 years ago
Phillip Webb fcea565433 Polish javadoc formatting 11 years ago
Phillip Webb 80ac1fb0cd Polish 11 years ago
Phillip Webb 12d2331f4d Fix failing JMS test
Fix test failure caused by URL -> Url rename in
commit 22e397cda2
11 years ago
Phillip Webb 22e397cda2 Polish 11 years ago
Dave Syer 3d43771136 Register an AuthenticationManager in security autoconfig
This is quite a big step, but I think it helps a lot. Since Spring
Boot always creates an AuthenticationManager if it doesn't find one
already registered, it makes sense to also make it into a @Bean.
Spring Security does not register its AuthenticationManager by
default though, so we have to do that for it if the user has created
one with an @Autowired AuthenticationManagerBuilder, but not registered
it as a @Bean.

Having the @Bean (marked @Primary to prevent issues with @Autowired)
makes it easier to reason about what Spring Boot has done for you, and
easier to default in simple use cases to the boot-created
AuthenticationManager. For example, if I want an OAuth2 Authorization
Server with password grant, it makes total sense for the
AuthenticationManager for users to be the same as the @Primary one.
Now it is easy to set that up (just @Autowire it).
11 years ago
Dave Syer 85a56a79e4 Tidy up implementation of DispatcherServletAutoConfiguration
also adds another test.
11 years ago