Previously, Spring Session would be auto-configured by the mere presence
of Spring Session in the classpath. This was fragile as determining a
store type according to the environment could easily change when the
classpath of the project changes.
This commit makes the store-type property mandatory. If it is not set,
Spring Session is no longer auto-configured.
Closes gh-5838
This commit improves the `InfoContributor` infrastructure as follows:
* `InfoEndpoint` no longer breaks its public API and returns a Map as
before
* `Info` is now immutable
* All properties of the build are now displayed. Since we control the
generation of that file, there is no longer a mode to restrict what's
shown
* Build info is now generated in `META-INF/build-info.properties` by
default
Closes gh-5734
ErrorMvcAutoConfiguration creates a BeanNameViewResolver bean in case
the user has used @EnabledWebMvc and disabled WebMvcAutoConfiguration.
If the user hasn’t used @EnabledWebMvc, WebMvcAutoConfiguration will
creates its BeanNameViewResolver and override the one that’s already
been defined by ErrorMvcAutoConfiguration.
This commit makes WebMvcAutoConfiguration’s BeanNameViewResolver
definition conditional on there being no existing BeanNameViewResolver
bean definition.
Closes gh-5354
to stop it from being included in the enclosing @Configuration.
That way, if the app is not a web app, then there really is a
client_credentials OAuth2 resource (as claimed in the user guide).
Fixes gh-5735
A recent Spring Framework change in `CharacterEncodingFilter` allows to
configure the force flag separately for requests and responses. This
commit enables the flag only for requests which should provide a better
default with binary content.
Closes gh-5459
Previously, the auto-configured
`OAuth2ClientAuthenticationProcessingFilter` instance had no
`ApplicationEventPublisher`. As a result, no event was fired. This commit
makes sure to associate the event publisher instance.
Closes gh-5853
Add additional @ConditionalOnMissingBean guards to session
configurations to ensure that the first wins. Also reorder imports
to prefer Redis over JDBC.
See gh-5158
This implementation was inspired in large part by the cache
auto-configuration. In addition to the originally supported Redis, now
Hazelcast, an in-memory map, as well as a no-op option are supported. It
should be easy to extend this to include additional data stores in the
future.
Closes gh-3811
`JedisConnectionFactory` needs `commons-pool2` for quite some time now
and our auto-configuration had a special case to handle redis if
`commons-pool2` isn't available.
This commit removes that code as using it would lead to a failure anyway.
Closes gh-5718
Allow convention based status error pages. Static HTML or templates
can be used by placing the appropriately named file under a `/error`
folder. For example:
/src/main/resource/templates/error/404.ftl
or /src/main/resource/public/error/404.html
Pages can also be named after the status series (5xx or 4xx).
Fixes gh-2691
Create ErrorPageRegistry and ErrorPageRegistrar interfaces that allow
error page registration to be a first class concern.
Prior to this commit ErrorPageFilter needed to implement
ConfigurableEmbeddedServletContainer in order to receive ErrorPage
registrations.
Closes gh-5789
Reorganize web related classes for better separation of concerns.
Mainly this involves moving classes from `o.s.b.context.embedded`
that aren't directly tied to embedded servlet containers to
`o.s.b.web` and relocating everything from `o.s.b.context.web`.
See gh-5822
Move the @LocalServerPort to org.springframework.boot.context.embedded
since it's only really useful when working with embedded servlet
containers.
See gh-5822
Rabbit client 3.6.* uses TLSv1.1 as the default algorithm which
many brokers are deisabling these days. Spring AMQP supports
changing the algorithm by name, so this is just a pass thru for
that.
It sometimes has to catch an exception from the security filter so
it needs to be before, and somehow this hasn't been a problem up to
now, but probably only by some fluke.
Fixes gh-5792
Previously, spring.thymeleaf.cache was only applied to auto-configured
TemplateResolver. This commit also applies the propery to the
auto-configured ThymeleafViewResolver.
Closes gh-5395
Update UserInfoTokenServices.getPrincipal() so that it can be overridden
by subclasses to allow a custom authenticated principal to be returned
from the authorized request parameters.
Fixes gh-5053
Add support for Jetty `acceptors` and `selectors` configuration, either
directly on the `JettyEmbeddedServletContainerFactory` or via
`server.jetty.acceptors`/`server.jetty.selectors` server properties.
Fixes gh-5380
Closes gh-5649
Our Windows build is failing currently because the couchbase server does
not handle a socket connection within a second (the default). This commit
adds a property to customize this option and set it to 10 sec in the
sample.
While investigating this issue, it turns out that while
`CouchbaseConfiguration` is public, it is not really possible to extend
it in user's configuration. This commit fixes this problem and add a test
that demonstrates how it can be used.
Closes gh-5657
Update ServerProperties so that `null` values are not applied when
customizing the EmbeddedServletContainerFactory. Primarily changed to
stop `server.undertow.accesslog.enabled` from being blindly applied.
Fixes gh-5515
When @ConditionalOnBean or @ConditionalOnMissingBean are used on a
@Bean method, they will, in the absence of any other configuration,
attempt to deduce the bean's type by examining the method's return
type. This deduction can fail. See gh-4841, gh-4934, and gh-5624
for some examples of possible failure causes. Previously, this
failure was only logged as a debug message leaving the user with a
misleading message suggesting that the @ConditionalOnBean or
@ConditionalOnMissingBean annotation was not configured correctly.
This commit improves the diagnostics by mention the possibility of
type deduction in the exception message and including the exception
that caused deduction to fail as the cause.
Closes gh-4934
The Mustache support should still be usable outside a web application
because the properties only use web stuff in that context and don't
have any field or method signatures that depend on web.
Fixes gh-5626
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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