Commit Graph

446 Commits

Author SHA1 Message Date
Stephane Nicoll f561d9d9d8 Polish auto-configuration for Spring Web Services
Closes gh-5645
2016-04-15 11:01:15 +02:00
Stephane Nicoll e4106e592a Polish doc
Closes gh-5675
2016-04-15 08:58:18 +02:00
Phillip Webb 99ea724c71 Polish docs 2016-04-12 22:45:43 -07:00
Phillip Webb 296bbbc7bd Polish docs 2016-04-12 21:24:44 -07:00
Phillip Webb 2d71b08eef Fix copy/paste error in documentation 2016-04-12 20:06:35 -07:00
Johnny Lim 030096c490 Polish
Closes gh-5661
2016-04-12 07:41:09 +02:00
Andy Wilkinson 5677b222d2 Document using @TestConfiguration to customize app's primary config
Closes gh-5566
2016-04-11 21:15:06 +01:00
Michael J. Simons aaed87d176 Register printed banner in ApplicationContext
Update SpringApplication to store the banner that was actually printed
as a bean named `springBootBanner`.

Closes gh-5636
2016-04-11 10:54:22 -07:00
Phillip Webb a39d351eed Polish profile negation in YAML sub-documents
Closes gh-4953
2016-04-10 23:23:59 -07:00
Matt Benson bd010494c9 Support profile negation in YAML sub-documents
See gh-4953
2016-04-10 23:22:31 -07:00
Stephane Nicoll 99dae09f84 Improve caching documentation
Add a note regarding the use of `@EnableCaching(proxyTargetClass=true)`
for beans that are not interface based.

Closes gh-5527
2016-04-08 13:01:50 +02:00
Phillip Webb d058ddbe3b Add image banner documentation
Closes gh-4647
2016-04-07 23:21:18 -07:00
Phillip Webb 75c76838b5 Add Narayana reference documentation
Closes gh-5552
2016-04-06 19:16:34 -07:00
Phillip Webb ec33c59f6b Polish 2016-04-06 18:15:12 -07:00
Johnny Lim a55315b5b5 Polish
Closes gh-5614
2016-04-06 10:25:45 +02:00
Stephane Nicoll 05ef0818f8 Polish contribution
Closes gh-5511
2016-04-05 12:38:04 +02: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
Andy Wilkinson eb3180d581 Provide test auto-configuration for Spring REST Docs
This commit introduces a new annotation, @AutoConfigureRestDocs,
which can be used to enable auto-configuration of Spring REST Docs.
The auto-configuration removes the need to use Spring REST Docs' JUnit
rule and will automatically configure MockMvc. Combined with the new
auto-configuration for MockMvc it allows a test class to be free of
boilerplate configuration:

@RunWith(SpringRunner.class)
@WebMvcTest
@AutoConfigureRestDocs(outputDir = "target/generated-snippets",
        uriScheme = "https", uriHost = "api.example.com",
        uriPort = 443)
public class ExampleDocumentationTests {

    @Autowired
    private MockMvc mvc;

    @Test
    public void documentIndex() {
        // …
    }

}

For more advanced customization a RestDocsMockMvcConfigurationCustomizer
bean can be used.

If a RestDocumentationResultHandler is found in the context, it will
be passed to the ConfigurableMockMvcBuilder's alwaysDo method as part
of its customization.

Closes gh-5563
2016-04-04 17:19:51 +01:00
Johnny Lim f88c583570 Polish
Closes gh-5553
2016-04-01 17:11:17 +02:00
Phillip Webb c167e4fd0e Rework SpringApplicationTest documentation
Closes gh-5477
2016-03-31 21:37:28 -07:00
Johnny Lim a28dd9d9e6 Polish
Closes gh-5532
2016-03-30 08:43:23 +02:00
Stephane Nicoll a66045fa98 Polish contribution
Closes gh-5521
2016-03-29 15:10:50 +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 87b963b396 Merge branch '1.3.x' 2016-03-29 10:57:02 +02:00
Stephane Nicoll 3363415712 Polish documentation
Add a reference ot underscore notation

Closes gh-5268
2016-03-29 10:56:46 +02:00
Johnny Lim 51bbe5e37a Polish
Closes gh-5508
2016-03-28 11:47:02 +02: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
Stephane Nicoll e8766f21a5 Fix typo 2016-03-24 14:52:10 +01:00
Phillip Webb 88f3fa4f78 Document test improvements in 1.4
Closes gh-4901
2016-03-23 22:22:23 -07: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 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 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 f4bb9e3ba7 Polish doc
Closes gh-5404
2016-03-17 12:53:32 +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 d22265b13e Allow to disable debug property
Previously, adding `debug=false` in the environment had no effect as the
mere presence of the property was used to enable the debug mode. This
commit makes sure to also check the value and ignore the property if it
is set to `false`.

The documentation has also been updated to refer to the `trace` property.

Closes gh-5374
2016-03-11 11:27:39 +01:00
Stephane Nicoll 8cb602f2d6 Polish doc
Closes gh-5375
2016-03-11 11:01:29 +01:00
Stephane Nicoll 58e8e10abb Fix typo
Closes gh-5343
2016-03-09 17:06:19 +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
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
Andy Wilkinson bbd7840785 Allow LoggingSystem to be disabled
In certain environments, such as Jetty configured with centralized
logging, Spring Boot's logging system can be problematic.

This commit adds support for using the existing LoggingSystem system
property, configured with a value of none, to disable the logging
system and rely on the standard logging configuration mechanism for
whatever logging framework is in use.

Closes gh-3571
2016-03-07 11:16:26 +00:00
Johnny Lim 122270c990 Polish
Closes gh-5345
2016-03-06 09:21:00 +01:00
Johnny Lim a6c83787ef Polish
Closes gh-5318
2016-03-03 08:33:21 +01: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 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
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
Stephane Nicoll 416b689359 Enable prefix by default on RedisCacheManager
An overhaul of the `RedisCacheManager` is expected in Hopper (to be
consumed by Spring Boot 1.4). One of those changes is to make sure every
key have a decent prefix by default.

This commit enables the use of prefix as it is disabled by default.

Closes gh-5175
2016-02-25 13:51:59 +01:00
Stephane Nicoll 0e43f4204f Merge branch '1.3.x' 2016-02-24 14:09:07 +01:00
Stephane Nicoll 5febd497da Support customization of CacheManager
This commit allows to customize the auto-configured `CacheManager` by
exposing a bean of type `CacheManagerCustomizer`. The implementation may
reference the type of a `CacheManager` to determine in which case it has
to be invoked.

Several implementations can be provided and ordered using the regular
`Ordered` interface and `@Order` annotation.

Closes gh-5039
2016-02-24 14:00:38 +01:00
Andy Wilkinson 36cdc81ef4 Merge branch '1.3.x' 2016-02-24 11:39:10 +00:00
Andy Wilkinson aa17599675 Clarify handling of files specified in spring.config.location
Closes gh-5147
2016-02-24 11:39:02 +00:00
Stephane Nicoll 2da9f6d91c Merge branch '1.3.x' 2016-02-23 14:43:56 +01:00
Stephane Nicoll c4205d04b3 Rework ListenerContainerFactory configurers
Rework commit b726974 to avoid exposing setters that would permit anyone
to change Spring Boot's defaults. Also, since these are configurers of a
specific instance, they should be named accordingly.

Closes gh-5138
2016-02-23 14:43:33 +01:00
Stephane Nicoll 90f0fc6ce3 Harmonize JTA properties
Previously, both Atomikos and Bitronix were bound on the `spring.jta`
namespace which makes very hard to figure out which property belong to
which implementation. Besides, `AtomikosProperties` only exposed public
setter which does not generate any useful meta-data.

This commit moves the external configuration for Atomikos and Bitronix to
`spring.jta.atomikos.properties` and `spring.jta.bitronix.properties`
respectively. It also improves the meta-data support for those two
namespaces.

Closes gh-5165
2016-02-16 16:44:50 +01:00
Stephane Nicoll 81fdc99fb0 Polish doc
See gh-3498
2016-02-16 13:45:48 +01:00
Stephane Nicoll 52950717e0 Polish 2016-02-16 09:34:26 +01:00
Stephane Nicoll da3b49e024 Polish contribution
Closes gh-3499
2016-02-16 09:31:50 +01:00
Stephane Nicoll b205e02e33 Upgrade to Spring Data Hopper M1
Closes gh-5120
2016-02-15 14:57:08 +01:00
Stephane Nicoll 85cc885fd1 Merge branch '1.3.x' 2016-02-12 16:26:41 +01:00
Stephane Nicoll b726974bca Allow to easily customize ListenerContainerFactory
Previously, if one wants to create a custom `JmsListenerContainerFactory`
or `RabbitListenerContainerFactory`, a bunch of code from the auto-
configuration must be duplicated.

This commit introduces two services to configure such factory for JMS
and AMQP with the same sensible defaults that were applied by the
auto-configufrations.

Closes gh-5138
2016-02-12 16:16:44 +01:00
Stephane Nicoll 187d26ae10 Merge branch '1.3.x' 2016-02-11 17:00:16 +01:00
Stephane Nicoll abf9d66edf Document how to configure access logging
Also, the section on `server.*` configuration was poor so this commit
also improves it.

Closes gh-4989
2016-02-11 16:59:47 +01:00
Kazuki Shimizu 4e177eeed7 Auto-configure ResourceUrlEncodingFilter when using FreeMarker
Closes gh-5126
2016-02-11 11:33:57 +00:00
Stephane Nicoll ebffa493e4 Harmonize ConfigurationProperties bean name
When `@EnableConfigurationProperties` is defined, Spring Boot
automatically registers a bean in the context for each class specified
on the annotation. Previously, the name of the bean only included the
prefix which leads to conflict if two different classes use the same
prefix.

This commit changes the bean name structure to be <prefix>-<fqn> where
prefix is the prefix used on the annotation and <fqn> the fully qualified
name of the target class.

Closes gh-4395
2016-02-09 17:19:11 +01:00
Stephane Nicoll a27176807f Polish contribution
Closes gh-4188
2016-02-08 15:44:09 +01:00
Stephane Nicoll 34d87df425 Clarify use of the `spring.datasource` prefix
Previously, Spring Boot mapped both `DataSourceProperties` and the actual
`DataSource` implementation to the same prefix. This results in a huge
amount of keys in the `spring.datasource` namespace  with no way to
identify those that are valid for the pooled data source in use.

This commit maps the four pooled data sources we support in four isolated
namespace, keeping `spring.datasource` only for the common settings.

These are `spring.datasource.tomcat`, `spring.datasource.hikari`,
`spring.datasource.dbcp` and `spring.datasource.dbcp2` for the Tomcat,
Hikari, Commons DBCP and Commons DBCP2 implementations respectively.

Closes gh-2183
2016-02-03 11:05:23 +01:00
Johnny Lim 46540de694 Fix typos
Closes gh-5067
2016-02-02 11:19:07 +01:00
Stephane Nicoll f5edd53d86 Merge branch '1.3.x' 2016-02-02 08:52:01 +01:00
Stephane Nicoll 6ea74501e7 Clarify registration of ApplicationListener
Spring Boot fires event very early in the application lifecycle and we
should make crystal clear that a regular `@Bean` registration cannot be
used to register a listener on them.

Closes gh-5061
2016-02-02 08:50:32 +01:00
Stephane Nicoll b02073b455 Polish 2016-01-27 17:12:09 +01:00
Stephane Nicoll e293008c3f Rename redis starter to spring-boot-starter-data-redis
Closes gh-1033
2016-01-26 08:31:34 +01:00
Stephane Nicoll bead239448 Remove support for Log4j
Apache Log4j 1.x is EOL and has now been replaced by log4j 2. This commit
removes the deprecated support for Log4j 1.x

See gh-4905
2016-01-25 14:06:06 +01:00
Johnny Lim 9a31e02806 Polish
Closes gh-5013
2016-01-24 19:13:01 +01:00
Stephane Nicoll ea5195c8a6 Better document how DataSource is bound to the env
Closes gh-4971
2016-01-21 11:13:12 +01:00
Andy Wilkinson 5e5542f09c Describe the ordering of spring.config.location in the documentation
Closes gh-4964
2016-01-20 12:13:57 +00:00
Kazuki Shimizu 908c9562e5 Fix invalid port number in doc
Closes gh-4867
2016-01-03 13:43:46 +01:00
Stephane Nicoll a87a1f053f Polish documentation
Clarify that "spring.config.*" properties doesn't work in configuration
files.

Closes gh-4838
2015-12-25 08:21:09 +01:00
Phillip Webb 506ee897f3 Document how to configure root logging level
Fixes gh-2872
2015-12-17 10:55:46 +00:00
Phillip Webb 5e84bfd91b Merge branch '1.2.x' 2015-12-16 18:45:42 +00:00
Phillip Webb ce2a68276c Add ServletContext initialization documentation
Update the documentation to include a section about ServletContext
initialization with embedded servlet containers. This update is to
primarily highlight that `WebApplicationInitializers` and Servlet 3.0+
`ServletContainerInitializers` are not called.

Fixes gh-4643
2015-12-16 18:41:46 +00:00
Andy Wilkinson 08720b4612 Document need to avoid Logback placeholder format in logging properties
Closes gh-4731
2015-12-15 14:28:44 +00:00
Phillip Webb 0489a3b4de Polish 2015-12-10 19:43:29 +00:00
Stephane Nicoll 2d003a698f Revert 5464c65
See gh-4709
2015-12-09 10:59:27 +01:00
Stephane Nicoll 5464c65ca8 Polish contribution
Use the same value as we do.
2015-12-09 09:57:04 +01:00
Johnny Lim 12a921c200 Polish docs
Closes gh-4709
2015-12-09 09:49:42 +01:00
Yunkun Huang 3f9a2aa145 Document randomPort attribute on WebIntegrationTest
Closes gh-4548
2015-12-03 11:17:31 +00:00
Vedran Pavic 884cae6f8d Add support for using ${application.title} in startup banners
This commit introduces a new property, application.title, that can
be used in a banner. Its value is resolved from the application
manifest's Implementation-Title attribute.

Closes gh-4603
2015-12-02 10:09:42 +00:00
Andy Wilkinson f25a5e3b77 Improve documentation of color-coded console output
This commit documents the color converter, the explicit colors and
styles that is supports, and the implicit colors used for each log
level.

 Closes gh-4592
2015-12-01 16:28:09 +00:00
Stephane Nicoll 5cdd874d55 Document `@AutoconfigureOrder`
Closes gh-4546
2015-11-30 11:18:34 +01:00
Stephane Nicoll 43b8e65eee Add dedicated section for `spring.main.banner-mode`
One of the options of the new `banner-mode` property is `off`. YAML maps
`off` to `false` and since we are exposing the method from the
`SpringApplication` public class we can't change the signature to accept
a `String` and do the conversion ourselves.

This commit adds a dedicated section in the guide to warn users about
that particular situation. Adding quotes around the value prevents the
conversion.

Closes gh-4600
2015-11-27 14:04:58 +01:00
Stephane Nicoll 77190f126a Create dedicated section for property conversion
See gh-4604
2015-11-27 11:42:23 +01:00