Commit Graph

1776 Commits

Author SHA1 Message Date
Mohamed Gazal 3623eeda0c Add Liquibase rollback file support
Add a `liquibase.rollback-file` property which can be used to write
a rollback file when migrations occur.

Fixes gh-1826
Closes gh-5535
2016-04-05 18:56:45 -07:00
Phillip Webb 0db1194007 Upgrade to Hibernate 5.1
Upgrade to Hibernate 5.1, whilst still retaining compatibility with
Hibernate 4.3. This commit introduces the following changes:

* Add SpringPhysicalNamingStrategy to provides lowercase/underscore
  table names support. This should be equivalent to the previous
  SpringNamingStrategy that was used with Hibernate 4. No
  ImplicitNamingStrategy is provided since the Hibernate 5 defaults
  appear to be roughly equivalent to the conventions used in Spring
  Boot 1.3
  spring.jpa.hibernate.naming.

* Migrate  `spring.jpa.hibernate.naming-strategy` to
  `spring.jpa.hibernate.naming.strategy` and provide additional
  properties for physical and implicit.

* Add `spring.jpa.hibernate.use-new-id-generator-mappings` property and
  default to `false` when on Hibernate 5 to retain back compatibility.

See gh-2763
2016-04-05 17:54:15 -07:00
Andy Wilkinson d27e280759 Merge branch '1.3.x' 2016-04-05 13:38:41 +01:00
Stephane Nicoll 520448cd9c Add support for publisher confirms/returns
Closes gh-3945
2016-04-05 14:25:18 +02:00
Andy Wilkinson ffe21175ca Upgrade to Logback 1.1.7
Closes gh-5568
2016-04-05 12:40:21 +01:00
Stephane Nicoll 05ef0818f8 Polish contribution
Closes gh-5511
2016-04-05 12:38:04 +02:00
Huang YunKun 6a2ff3f02a Upgrade elasticsearch to 2.2.0
Closes gh-5443
2016-04-05 12:38:04 +02:00
Andy Wilkinson 487f7310fd Polish contribution 2016-04-05 11:03:03 +01:00
Quinten De Swaef 34eb3695e4 Allow Tomcat's minimum threads to be configured via the environment
Closes gh-5572
2016-04-05 10:56:11 +01:00
Phillip Webb b398b3319c Rename @SpringApplicationTest -> @SpringBootTest
Rename @SpringApplicationTest to SpringBootTest and
@SpringApplicationContextLoader to @SpringBootContextLoader.

Fixes gh-5562
2016-04-04 22:36:58 -07:00
Phillip Webb 4d404b214c Migrate away from @SpringApplicationConfiguration
Refactor internal tests to no longer use @SpringApplicationConfiguration

See gh-5562
2016-04-04 22:36:57 -07:00
Phillip Webb adb42ed966 Polish 2016-04-04 22:36:57 -07:00
Andy Wilkinson 15cbef3df0 Update JpaBaseConfiguration to use constructor injection
This change was missed as part of the work done in 19d8c5e6.

See gh-5306
Closes gh-5543
2016-04-04 18:55:31 +01:00
Andy Wilkinson 611d441763 Polishing 2016-04-04 13:25:02 +01:00
Dave Syer 416ce1a6f4 Make FixedAuthoritiesExtractor more liberal in what it accepts
In particular it now accepts a list of maps containing
"authority" keys (which is what you get from a standard JSON
decoding of a Spring Security Authentication).

Fixes gh-5482
2016-04-04 12:20:39 +01:00
Andy Wilkinson f55066464d Merge branch '1.3.x' 2016-04-01 11:53:35 +01:00
Andy Wilkinson 33f0ea3480 Rework SpringApplicationTest to support web modes
Rework the new testing support so that @SpringApplicationTest can be
used for standard integration tests, web integration tests with a
mock Servlet environment and web integration tests with an embedded
servlet container. This means that it a replacement for 1.3's
@IntegrationTest and @WebIntegrationTest and allows all
SpringApplication testing to be configured using a common annotation.

The old @IntegrationTest and @WebIntegrationTest along with their
supporting classes have been reinstated to their previous form (while
remaining deprecated). This should ensure that they continue to work
in 1.4 exactly as they did in 1.3 giving users a smooth path to
@SpringApplicationTest.

See gh-5477
2016-03-31 21:35:10 -07:00
Phillip Webb 893a6c32f3 Upgrade to checkstyle 6.17
Fixes gh-5547
2016-03-31 13:14:53 -07:00
Johnny Lim a28dd9d9e6 Polish
Closes gh-5532
2016-03-30 08:43:23 +02:00
Phillip Webb 39140945b5 Polish 2016-03-29 21:45:11 -07:00
Stephane Nicoll 6dd84159f5 Restore JMX property to IntegrationJmxConfiguration
Closes gh-5309
2016-03-29 15:26:38 +02:00
Stephane Nicoll 54bea72554 Polish Jersey integration tests 2016-03-29 14:36:52 +02:00
Stephane Nicoll c752fac5c0 Expose load-on-startup for Jersey
This commit adds a `spring.jersey.filter.load-on-startup` property used to
customize the startup priority of the Jersey servlet.

Closes gh-5100
2016-03-29 14:18:18 +02:00
Stephane Nicoll 33967927db Polish contribution
Closes gh-5512
2016-03-29 13:04:28 +02:00
Rob Baily 971a7194d8 Add check for non empty list of factories
It was seeen that if a different plugin was used to package Spring Boot
that the project would load but no autoconfiguration actually took
place and many features were mysteriously not working.  Adding a check
to ensure that some factories are always loaded as this is expected.

Closes gh-5465
2016-03-29 12:58:16 +02:00
Stephane Nicoll 1e0873c86e Polish contribution
Closes gh-5498
2016-03-29 12:55:35 +02:00
Eddú Meléndez 4912b989a5 Add useAlwaysMessageFormat configuration key
Allow to configure the `useAlwaysMessageFormat` attribute of
`MessageSource` via configuration.

Closes gh-5483
2016-03-29 12:50:39 +02:00
Stephane Nicoll abd86e50e0 Merge branch '1.3.x' 2016-03-29 11:30:28 +02:00
Stephane Nicoll ae095b2c1b Disable JMX Integration support if necessary
This commit fixes `IntegrationAutoConfiguration` to actually rely on the
auto-configured `MBeanServer` rather than attempting to create it again.

If JMX support is disabled, no attempt to register integration-related
MBeans is made.

Closes gh-5309
2016-03-29 11:27:24 +02:00
Johnny Lim 51bbe5e37a Polish
Closes gh-5508
2016-03-28 11:47:02 +02:00
Phillip Webb a3bfc29e6e Fix warnings 2016-03-25 12:46:53 -07:00
Phillip Webb 609704a3bf Polish 2016-03-25 12:46:52 -07:00
Phillip Webb c68e5f12ff Formatting 2016-03-25 12:46:52 -07:00
Stephane Nicoll fd437797b6 Polish contribution
This commit polihes the original Neo4j contribution in several areas.

Rather than providing the packages to scan, this commit rearranges the
`EntityScan` and `EntityScanRegistrar` so that the logic can be shared
for other components. If no package is provided, scanning now defaults to
the "auto-configured" package(s) and a `@NodeEntityScan` annotation
allows to override that.

The configuration has also been updated to detect the driver based on the
`uri` property. If the embedded driver is available we use that by
default. If it is not available, we're trying to connect to a Neo4j
server running on localhost. It is possible to disable the embedded mode
or set the `uri` parameter explicitly to deviate from these defaults.

The sample no longer relies on the embedded driver for licensing reason:
rather it expects an instance running on localhost (like other
data-related samples) and gracefully ignore any connection error. A
README has been added in the sample to further explain the available
options;

Closes gh-5458
2016-03-25 11:39:49 +01:00
Michael Hunger 0658cc8aee Add Neo4j support
See gh-5458
2016-03-25 11:26:57 +01:00
Phillip Webb 4167469781 Attempt to work around couchbase CI failures 2016-03-23 23:29:42 -07:00
Phillip Webb e5f224118b Print AutoConfigureReport on test failures
Add a TestExecutionListener to print the auto-configuration report
when a test cannot load.

See gh-4901
2016-03-23 22:21:04 -07:00
Phillip Webb fb70a56c79 Support override enable auto-configuration
Provide a way for full auto-configuration to be disabled
programmatically. Primarily added to allow special test annotations to
take over partial auto-configuration but still load
@SpringBootApplication classes.

See gh-4901
2016-03-23 22:20:51 -07:00
Phillip Webb 47f801d535 Make @ImportAutoConfiguration a meta-annotation
Update `@ImportAutoConfiguration` so that it can be used as a
meta-annotation. Also relocate it from the `test` package.

Fixes gh-5473
2016-03-23 22:20:35 -07:00
Phillip Webb 0829a1bde8 Drop superfluous annotations
Update internal tests to drop annotations that can now
be inferred.

Fixes gh-5470
2016-03-23 22:19:36 -07:00
Phillip Webb 513dec718f Add TestExcludeFilter for component scanning
Add a new TypeFilter specifically for excluding candidate components.
The filter is applied to `@SpringBootApplication` and allows tests to
dynamically contribute exclude filters so that specific classes of
component can be excluded.

See gh-5295
See gh-4901
2016-03-23 22:18:46 -07:00
Phillip Webb 965dd33ec8 Introduce @SpringBootConfiguration annotation
Add a new @SpringBootConfiguration annotation that can be used to
indicate the primary application configuration. The new annotation is
primarily indented to allow test automatically code to find the main
configuration class.

See gh-5295
2016-03-23 22:18:43 -07:00
Phillip Webb c28f552883 Migrate SpringJUnit4ClassRunner to SpringRunner
Replace all existing SpringJUnit4ClassRunner references with the new
SpringRunner alias.

Fixes gh-5292
2016-03-23 22:18:18 -07:00
Phillip Webb 2f815a907a Migrate existing tests from deprecated package
Update the existing tests to use the relocated `spring-boot-test`
classes. Restructuring was achieved using the following command:

find . -type f -name '*.java' -exec sed -i '' \
-e s/org.springframework.boot.test.ConfigFileApplicationContextInitializer/\
org.springframework.boot.test.context.ConfigFileApplicationContextInitializer/g \
-e s/org.springframework.boot.test.EnvironmentTestUtils/\
org.springframework.boot.test.util.EnvironmentTestUtils/g \
-e s/org.springframework.boot.test.IntegrationTest/\
org.springframework.boot.test.context.IntegrationTest/g \
-e s/org.springframework.boot.test.IntegrationTestPropertiesListener/\
org.springframework.boot.test.context.IntegrationTestPropertiesListener/g \
-e s/org.springframework.boot.test.OutputCapture/\
org.springframework.boot.test.rule.OutputCapture/g \
-e s/org.springframework.boot.test.SpringApplicationConfiguration/\
org.springframework.boot.test.context.SpringApplicationConfiguration/g \
-e s/org.springframework.boot.test.SpringApplicationContextLoader/\
org.springframework.boot.test.context.SpringApplicationContextLoader/g \
-e s/org.springframework.boot.test.SpringBootMockServletContext/\
org.springframework.boot.test.mock.web.SpringBootMockServletContext/g \
-e s/org.springframework.boot.test.TestRestTemplate/\
org.springframework.boot.test.web.client.TestRestTemplate/g \
-e s/org.springframework.boot.test.WebIntegrationTest/\
org.springframework.boot.test.context.web.WebIntegrationTest/g {} \;

See gh-5293
2016-03-23 22:17:50 -07:00
Phillip Webb aef7f4bcb1 Restructure spring-boot-test packages
Create a new package structure for `spring-boot-test` and deprecate
existing classes.

Fixes gh-5293
2016-03-23 22:17:27 -07:00
Phillip Webb 47fb614bde Set "proxy target class" for transaction managers
Update `@EnableTransactionManagement` so that `proxyTargetClass` is
set to true. This ensures that @Transactional beans that aren't
interface based can still be proxied.

Fixes gh-5423
2016-03-23 21:52:09 -07:00
Andy Wilkinson 19d8c5e6f6 Complete the move to constructor injection in configuration classes
This is a follow-on from the work done in 5009933. Now that SPR-14015
has been fixed, constructor injection can also be used for parameterised
dependencies, including optional dependencies that are injected via
an ObjectProvider.

Closes gh-5306
2016-03-23 14:43:04 +00:00
Stephane Nicoll cb2ad7fb87 Prevent Thymeleaf to be configured with Thymeleaf 3
Spring Boot does not support Thymeleaf 3 yet. This commit prevents the
auto-configuration to activate if Thymeleaf 3 is available on the
classpath.

Closes gh-5371
2016-03-22 11:43:58 +01:00
Stephane Nicoll 93f392134a Polish 2016-03-22 11:35:02 +01:00
Phillip Webb 7942d9f787 Polish 2016-03-21 22:52:25 -07:00
Stephane Nicoll d8c972c27e Merge branch '1.3.x' 2016-03-21 11:56:21 +01:00
Stephane Nicoll b1b84a358d Fix Artemis embedded mode condition
This commit prevents the Artemis embedded mode to kick-in if the
`EmbeddedJMS` class it not in the classpath. The previous condition would
match if only `artemis-server` was on the classpath while
`artemis-jms-server` is actually required.

Closes gh-5452
2016-03-21 11:55:59 +01:00
Stephane Nicoll 96b7419916 Polish contribution
Closes gh-5455
2016-03-21 11:02:22 +01:00
Eddú Meléndez 2fc2ec457b Auto-configure Redis repositories
Closes gh-5448
2016-03-21 10:47:23 +01:00
Stephane Nicoll bca83bde5b Polish contribution
Closes gh-5417
2016-03-18 13:05:44 +01:00
Marten Deinum ec8b94f13c Support setting webAllowOthers for the H2 Web Console
This commit adds a configuration option for the webAllowOthers option
for the H2 WebServlet. It will only be added it the
spring.h2.console.webAllowOthers is set to true, else it will be
ignored.

Closes gh-5416
2016-03-18 12:45:39 +01:00
Stephane Nicoll 3d4a9d9c84 Polish contribution
The properties exposed by the ActiveMQ pooled connection factory are
quite specific and I felt it was arbitrary to expose some and not others.

However, the number of connections and the timeouts seem the most useful
so they have been kept and a `configuration` nested namespace can be
used to configure any additional settings.

The core properties have been renamed to be less "raw" and more compliant
with the structure of other properties. The documentation on fields has
also been aligned.

Closes gh-5372
2016-03-18 11:23:09 +01:00
n27 e41d42171b Improve ActiveMQ connection pool configuration
Closes gh-1598
2016-03-18 09:26:24 +01:00
Stephane Nicoll fa84b179a8 Allow to customize the Couchbase environment
Closes gh-5403
2016-03-18 09:08:41 +01:00
Stephane Nicoll caf11e4445 Add Couchbase cache support
This commit updates the cache auto-configuration to provide a
`CouchbaseCacheManager` if a `Bucket` has been configured.

The global customizer infrastructure allows to further tune the cache
manager if necessary.

Closes gh-5176
2016-03-18 07:52:56 +01:00
Stephane Nicoll 9c733128ac Use ConditionalOnSingleCandidate when appropriate
This commit updates various auto-configuration to use
`@ConditionalOnSingleCandidate` rather than assuming that at most one
bean of a given type will be available.

Closes gh-2784
2016-03-17 15:15:59 +01:00
Stephane Nicoll 25f00b9bb8 Polish contribution
Closes gh-5341
2016-03-17 13:25:35 +01:00
Gary Russell 08732fe4c8 Add Retry Config: Template and Listener
Also add requeue rejected to listener config and
timeouts to RabbitTemplate config.

Closes gh-5340
2016-03-17 13:01:33 +01:00
Stephane Nicoll 2526a54e31 Polish contribution
Closes gh-5337
2016-03-14 14:24:24 +01:00
Anand Shah f6a32a1d5a Add `@LocalServerPort`
Closes gh-5262
2016-03-14 14:24:24 +01:00
Stephane Nicoll e67f2e2983 Separate Couchbase setup from Spring Data
This commit separates the basic setup of Couchbase from Spring Data so
that a `Bucket` and `Cluster` bucket beans are exposed even if Spring
Data is not available.

A basic setup happens if `spring.couchbase.bootstrap-hosts` is specified,
configuring the `default` bucket with no authentication unless specified
otherwise.

If Spring Data is available, those beans are re-used by default to
configure the `CouchbaseTemplate` and other repository-related beans.

Closes gh-5347
2016-03-14 11:11:48 +01:00
Stephane Nicoll dddea70985 Collect and display build information
This commit updates the Maven plugin to generate a
`META-INF/boot/build.properties` file with various build-specific
settings (group, artifact, name, version and build time). Additionally,
the plugin can be configured to write an arbitrary number of additional
properties.

A new `BuildProperties` bean is automatically exposed when such a file is
present. If that bean is present, an `InfoContributor` is automatically
created to expose that information under the `build` key.

As for the git contributor, it is possible to only display the core
settings or everything using the `management.info.build.mode` property.

See gh-2559
2016-03-10 17:21:31 +01:00
Stephane Nicoll 3e6b584953 Add Date as a support property type
Rather than exposing a raw String with the epoch time, GitProperties
now exposes the actual `java.util.Date`. `InfoProperties` has been
improved to return such data type when the raw value is an epoch time.
2016-03-10 14:42:48 +01:00
Stephane Nicoll b906b18655 Initiate GitProperties
This commit polish the new info contributor infrastructure by migrating
`GitInfo` to `GitProperties`. `InfoProperties` provides an abstraction
that exposes unstructured data in an immutable way.

The `GitInfoContributor` now accepts a "mode" that determines if all data
should be exposed or only a sub-set of known keys.

Closes gh-2644
2016-03-09 16:37:44 +01:00
Phillip Webb b260c20df0 Support JsonSerializer/JsonDeserializer Beans
Add a `@JsonComponent` annotation that can be used to indicate that a
Bean is a JsonSerializer and/or JsonDeserializer that should be
registered with Jackson.

Support is provide via a new `JsonComponentModule` which is
auto-configured in `JacksonAutoConfiguration`.

Also add `JsonObjectSerializer` and `JsonObjectDeserializer` classes
which provided as a convenient base for serializers that work with
Objects.

Fixes gh-3898
2016-03-08 17:33:00 -08:00
Phillip Webb a3f3de223f Polish 2016-03-08 11:20:41 -08:00
Stephane Nicoll 9bbde5b340 Properly guard validation support
Prevent the validation support to kick in if the Validation API is not
available.

Closes gh-5353
2016-03-08 08:57:47 +01:00
Andy Wilkinson 86d87f6b8a Deprecate support for Velocity
Support for Velocity has been deprecated in Spring Framework 4.3 with
the plan being to remove it in 5.0. This commit deprecates Spring
Boot's support in 1.4, with the plan being to remove it in 2.0.

Closes gh-5276
2016-03-07 13:48:17 +00:00
Stephane Nicoll ad53f09ed4 Improve Couchbase repository support
Previously, if Couchbase was available on the classpath but not
configured, Spring Boot would attempt to scan the project for
repositories anyway.

This commit makes sure that it only happens if an infrastructure
bean required is present. The tests have also been rewritten to better
reflect what would happen in practice.

Closes gh-5349
2016-03-07 13:19:22 +01:00
Stephane Nicoll d6bc3f0bc6 Fix build
Assert using epoch time
2016-03-04 17:43:15 +01:00
Stephane Nicoll 76edaa7e1e Fix build
Add TimeZone in date assertion
2016-03-04 17:30:00 +01:00
Stephane Nicoll f11fa0c309 Use `java.util.Date` rather than a raw String
This commit updates `GitInfo` to use a proper `java.util.Date` rather
than a raw String. Because the Maven and Gradle plugin do not agree on a
format, `ProjectInfoAutoConfiguration` now registers a `Converter` that
is taking care of translating the raw `String` to a `Date`.

See gh-2484
2016-03-04 17:14:34 +01:00
Andy Wilkinson 5009933788 Move to constructor injection in simple configuration classes
This commit updates "simple" configuration classes to use constructor
injection. Simple means that there are no optional dependencies
(@Autowired(required=false) is not used), and none of the dependencies
use generics.

Configuration classes that are not simple will be updated in a second
pass once https://jira.spring.io/browse/SPR-14015 has been fixed.

See gh-5306
2016-03-04 12:27:29 +00:00
Stephane Nicoll 398aed7fdb Missing entry for ProjectInfoAutoConfiguration 2016-03-04 13:26:15 +01:00
Phillip Webb 73cbb2f40a Polish 2016-03-03 09:14:24 -08:00
Stephane Nicoll d04155fcae Polish contribution
Closes gh-5303
2016-03-03 18:09:05 +01:00
Gary Russell c0cb813a01 Add Cache Properties for RabbitMQ
Closes gh-3502
2016-03-03 16:46:08 +01:00
Stephane Nicoll 0f820afa86 Auto-configure GitInfo
This commit moves `GitInfo` to a general "project info" area that will be
further improved with others project related information.

Deprecate `spring.git.properties` in favour of `spring.info.git.location`

Closes gh-2484
2016-03-03 14:31:00 +01:00
Johnny Lim a6c83787ef Polish
Closes gh-5318
2016-03-03 08:33:21 +01:00
Andy Wilkinson ef5087c5ee Upgrade to Jackson 2.7.2
Closes gh-5081
2016-03-02 07:25:55 +00:00
Andy Wilkinson 355860fd09 Remove @Autowired from constructors where class has single constructor
Closes gh-5226
2016-03-01 16:03:07 +00:00
Stephane Nicoll 813d86e5e0 Auto-configure Rabbit MessageConverter
If a `MessageConverter` bean is available, we now associate it to the
created `RabbitTemplate` and `RabbitListenerContainerFactory`. That way,
registering a custom `MessageConverter` is all that's needed.

The Rabbit auto-configuration is now using the new `ObjectProvider` that
offers a nicer API to detect if a primary candidate is available for
optional collaborators.

Closes gh-5088
2016-02-29 19:32:30 +01:00
Stephane Nicoll 360caf3d97 Polish 2016-02-29 19:24:18 +01:00
Stephane Nicoll bfa9ae13e7 Polish 2016-02-29 17:59:02 +01:00
Stephane Nicoll d13b9a98c5 Auto-configure JMS MessageConverter
If a `MessageConverter` bean is available, we now associate it to the
created `JmsTemplate` and `JmsListenerContainerFactory`. That way,
registering a custom `MessageConverter` is all that's needed.

The JMS auto-configuration is now using the new `ObjectProvider` that
offers a nicer API to detect if a primary candidate is available for
optional collaborators.

Closes gh-4282
2016-02-29 17:33:34 +01:00
Stephane Nicoll d9f4d6ce91 Allow custom CacheResolver
Previously, if a bean of type `CacheResolver` was present in the context
the whole cache auto-configuration would back off. If said
`CacheResolver` hasn't been defined via the `CachingConfigurer`
infrastructure, the application context would fail with a rather
unpleasant error message.

It can be quite common to define custom `CacheResolver` beans as the cache
annotations allow to defines custom cache resolvers per operation. This
commit makes sure that the cache auto-configuration will back-off only if
the `CacheResolver` is named `cacheResolver`.

Closes gh-5201
2016-02-29 15:48:46 +01:00
Stephane Nicoll 6741f05af1 Polish contribution
Closes gh-4903
2016-02-29 14:07:01 +01:00
Eddú Meléndez 98cc68364a Add Caffeine cache support
See gh-4899
2016-02-29 14:07:01 +01:00
Spring Buildmaster 225d877ab9 Next Development Version 2016-02-26 01:06:16 -08:00
Stephane Nicoll ebf82e4c20 Fix hazelcast schema location
Closes gh-5237
2016-02-26 09:11:37 +01:00
Phillip Webb 023a09bcf6 Merge branch '1.3.x' 2016-02-25 22:13:32 -08:00
Phillip Webb 936a96746a Fix missing Javadoc @param 2016-02-25 22:13:03 -08:00
Phillip Webb 17c9fc585f Polish 2016-02-25 21:32:09 -08:00
Phillip Webb c93ea54ea3 Merge branch '1.3.x' 2016-02-25 21:26:13 -08:00
Phillip Webb 4fd778fed8 Polish CacheManagerCustomizers 2016-02-25 20:05:16 -08:00