Previously, if a user specifies a path to a schema or data DDL that does
not exist, the application will start up fine and the missing DDL would
not be reported.
This commit validates that user-defined resources actually exist and
throw a new `ResourceNotFoundException` if they don't.
Closes gh-7088
Allow support for custom Lyout implementations with both the Maven
and Gradle plugin. Implementations of `LayoutFactory` can now be
specified to allow customization of the layout. In addition a
layout may now implement `CustomLoaderLayout` if it wishes to
write custom loader classes.
See gh-7263
This commit deprecates `server.max-http-post-size` and introduces a
dedicated property for each supported container. In particular, Undertow
can now define a max size higher than 2GB.
Closes gh-7362
This commit auto-configures `MethodValidationPostProcessor` if necessary
when a JSR-303 validator implementation is detected on the classpath.
Closes gh-6228
We use some internal Mockito classes and some breaking API changes
have been made to them in Mockito 2. This commit introduces a utility
class, SpringBootMockUtil, to shield our code from these differences.
Mockito 1 is called directly and Mockito 2 is called via reflection.
To allow these changes to be tested, FilteredClassPathRunner has been
enhanced to also support overriding a dependency on the class path.
As a result it has been renamed to ModifiedClassPathRunner. The new
ClassPathOverrides annotation can be used to provide the Maven
coordinates of one or more dependencies that should be resolved and
added to the class path. Such additions are added to the start of
the class path so that they override any existing dependency that
contains the same classes.
Closes gh-6520
This commit adds an extra property to the `server.tomcat.accesslog` to
control the `reqestAttributesEnabled` flag. This flag sets request
attributes for IP address, Hostname, protocol and port used for the
request.
Closes gh-7367
Add `content-security-policy` and `content-security-policy-mode`
`security.header` properties and update auto-configuration to apply
them when specified.
Fixes gh-7373
Closes gh-7357
Add Actuator and Reference documentation for the `/logger` endpoint.
This documentation includes information on listing, reading, and
modifying the configuration of loggers.
Closes gh-7390
See gh-7086
This commit improves `TomcatEmbeddedServletContainerFactory` so that tld
skip patterns can be set or added to an existing set. An additional
`server.tomcat.additional-tld-skip-patterns` is now being exposed to
easily add patterns via configuration.
Closes gh-5010
Spring Boot Actuator hypermedia support has been disabled by default via
c7c685f, but its documentation wasn't updated.
This commit updates the documentation related to the change.
See gh-7215
Previously, the algorithm that computes the String representation of a
class reference and a property type was shared. This lead to generic
information for group's `type` and `sourceType` property.
This commit separates that logic in two: `getQualifiedName` is now
responsible to generate a fully qualified class name while the existing
`getType` is solely responsible to generate a type representation for the
property. Only the latter has generic information.
Closes gh-7236
To be compatible with Gradle's plugin portal, plugins must have an
ID that uses a reverse domain name. This means that spring-boot is
not compatible.
This commit introduces a new ID, org.springframework.boot, and
deprecates the old ID.
Closes gh-6997
The cache abstraction is a core feature of the Spring Framework. Basic
features such as `@EnableCaching` are therefore available by default with
no extra dependencies necessary.
However, the actual cache adapters for JCache, Ehcache 2.x, Caffeine and
Guava are located in a separated module, `spring-context-support`. Spring
Boot provides that artifact via the `spring-boot-starter-cache` starter.
It is quite easy to "only" add the cache library dependencies and forget
about this extra dependencies since `@EnableCaching` is available by
default. This commit clarifies the role of the starer in each section so
that it is more obvious. We're already explaining this at the beginning
of the section but it seems that's not enough.
Closes gh-7071
Previously, an URI and individual client attributes can be set to
configure the mongo client. In such a scenario, the URI is ignored.
This commit changes the URI to be "null" and the creation of the client
to fail if both the uri and client attributes are set. If no client
attributes are set, the uri is used as before.
Closes gh-6739
Add an explicit note that states that "spring.datasource.url" (or more
specifically "spring.datasource.class-name" that is inferred from the
former) is necessary to connect to a database. If the class-name isn't
specified, Spring Boot will attempt to auto-configure an embedded
database.
Closes gh-6907
This commit improves the startup error message so that it does not
reference `--debug` anymore. Such command-line switch only works when
the application is started using `java -jar`.
The error message now refers directly to a section of the documentation
that provides more details and links to more useful examples.
Closes gh-6593
Breaking API changes in Gradle 3.0 make it impossible to support
it reliably alongside Gradle 1 and 2 without mainintaining multiple
versions of our Gradle plugin. This commit updates the documentation
to note that Gradle 3 is not supported.
Closes gh-6880
This commit adds a new `spring.thymeleaf.check-template` property which
is only used for Thymeleaf 3.0+.
Since thymeleaf/thymeleaf#419, the Thymeleaf template resolver
implementations can implement the `setCheckExistence` method - this
enables the template existence verification at **resolution** time,
which means the resolver can return null as a `TemplateResolution`
and let other template resolvers in the chain try.
This new property is set to `true` by default and can be disabled if the
application only has a single resolver and the template existence check
is considered as a performance penalty with the configured resolver.
Fixes gh-6500
This commit adds the `spring.http.multipart.resolve-lazily`
property, in order to configure whether the multipart request
should be resolved lazily, as the parameters are accessed.
When extending `WebMvcConfigurerAdapter`, developers should always
declare those as `@Configuration` classes rather than `@Bean`s, which
can lead to dependency issues as described in #6853.
Fixes gh-6853
This commit adds `JdbcTemplateAutoConfiguration` to the list of auto-
configurations that are applied with `DataJpaTest`. This effectively
allows to inject a `JdbcTemplate` in any `@DataJpaTest` test.
Closes gh-6802
Rework commit 4a69755b to remove the need for the ApplicationInfo class.
The updated code now uses the auto-configuration class to compute a
default persistence unit root location
Closes gh-6635
Due to the layout format change in 1.4, Spring Framework is no longer
able to compute a default persistence unit root URL. If a Spring Boot 1.4
application has JPA but does not have any entity, the application started
from a fat jar now fails with a quite cryptic exception.
This commit introduces `ApplicationInfo` as a general replacement for
the `ApplicationArguments` and `Banner` singleton beans that
`SpringApplication` registers on startup. `ApplicationInfo` also defines
the detected "main" `Class` that can be used to compute a last resort
URL that makes sense.
If such bean is available, `EntityManagerFactoryBuilder` now sets the
default persistence unit root location, preventing Spring Framework to
attempt to resolve an unknown location. Note that in our case the
persistence unit root location is actually useless: given the way the
persistence unit is created, nothing actually uses it but Hibernate, as a
compliant JPA provider, has to make sure this setting is set to a valid
URL nevertheless.
Closes gh-6635
As of Spring Boot 1.4, IDEs are supposed to provide auto-completion for
hints and enum values. This commit removes the hard-coded copy of
allowed values for enum-based properties. This was mostly the case
already and this commit fixes the few ones remaining.
Closes gh-6654
This commit restores the support of "spring.datasource.type". If this
property is set to an unsupported `DataSource` implementation, we now
properly create it again, rather than ignoring it because its value did
not match any value we support.
Since Spring Boot 1.4 now redirects `DataSource` implementation settings
to dedicated namespaces, the documentation has been updated to explicitly
mention how one can create such arrangement for an unsupported
implementation.
As a convenience, `DataSourceProperties` can initialize a
`DataSourceBuilder` based on its internal state, making it very easy for
anyone to create a `DataSource` from a `DataSourceProperties` instance.
Closes gh-6695
Update spring-boot-docs so that an empty jar file is produced. The
code is only needed for documentation includes and if included in the
deployed jar seems to prevent promotion to Maven Central.
Fixes gh-6495
Switch `@AutoConfigureJsonTesters` to use regular `@Autowired` injection
for JSON testers. Prior to this commit JSON Tester fields were
initialized directly which caused IDE issues and was also a little
confusing.
Fixes gh-6451
Previously, an entry had to be added to spring.factories using the
name of one of the @AutoConfigure… meta-annotations on the @…Test
annotation as the key. This indirection was unnecessarily complicated.
This commit simplifies things by allowing the name of the @…Test
annotation itself to be used as the key.
Closes gh-6335
This commit adds a new property, server.tomcat.redirect-context-root,
that can be used to configure the Tomcat Context’s
mapperContextRootRedirectEnabled property. The default is to not apply
any configuration and, therefore, to use Tomcat’s default of true.
Closes gh-6248
Previously, if an exception was resolved by a `HandlerExceptionResolver`
nothing the log indicated a failure to process the query.
This commit adds a new property `spring.mvc.log-resolved-exception` that
enables warning logs for supported `HandlerExceptionResolver` instances.
When Devtools is enabled, this flag is enabled by default.
Closes gh-2176
This commit polishes b0fbc7e, throwing an exception when an attempt is
made to configure management-specific SSL without also configuring a
custom management port. The testing of management-specific SSL
configuration has also been improved.
See gh-6057
Closes gh-4810
The upgrade to Hibernate 5.2.0.Final has provide to be too
problematic to live with. It requires Java 8, is incompatible with
a number of other projects in the Hibernate ecosystem, and it's
unclear for how long it will be maintained. We'd previously used
Hibernate 5.1.0.Final but its maintenance is also unclear with
Hibernate 5.1.1.Final being more than 3 months overdue.
This commit drops back to Hibernate 5.0.9.Final. This has a few
advantages:
- It's Java 7 compatible
- It's had some time to mature and should be reasonably free of
regressions for those moving from 4.3.x
- It's used in both Wildfly and JBoss EAP so there's a fair chance
that it will continue to be maintained.
Closes gh-6198
This commit changes the default version of Tomcat to 8.5.3 while
also retaining support for Tomcat 8.0 and 7.0. The main difference
in 8.5 is that the ServerSocketFactory abstraction that allowed the
TrustStore and KeyStore to be configured programatically no longer
exists. This logic has been replaced with the use of a custom URL
protocol (springbootssl) that provides access to the key store and
trust store of an SslStoreProvider. In addition to working with 8.5,
this approach has the advantage of also working with 8.0 and 7.0.
Closes gh-6164
Previously, when `spring.mvc.locale` was specified, that locale was used
regardless of the client's preferences. This commit adds an extra
`spring.mvc.locale-resolver` property that can control how the locale is
resolved. The default is `ACCEPT_HEADER` but can be set to `FIXED` to
restore the previous behaviour.
Closes gh-6083
This commit adds auto-configuration support for Jest, an HTTP client for
Elasticsearch. If Jest is present, a `JestClient` targeting a local
elasticsearch instance is auto-configured. Several properties from the
`spring.jest.*` namespace allows to tune the client.
Closes gh-6032
Add `WebMvcRegistrations` which can be used to provide custom
instances of `RequestMappingHandlerMapping`,
`RequestMappingHandlerAdapter` and `ExceptionHandlerExceptionResolver`.
Those instances are then used and processed by the Boot MVC
configuration.
Prior to this commit, developers could provide their custom instances
of MVC infrstructure components such as `RequestMappingHandlerMapping`
and `RequestMappingHandlerAdapter` only by using advanced configuration
strategies. Those advanced configurations involved subclassing
`WebMvcConfigurationSupport` which effectively turns off MVC
auto-configuration in Boot.
Fixes gh-5004
Closes gh-6100
As `@DataJpaTest` is meta-annotated with `@Transactional`, all data jpa
tests are transactional and rollback at the end of each test. It is
possible to tune that in many ways, including disabling the transaction
per test or per test class.
This commit improves the doc to explain those concepts.
Closes gh-5993
"Starter POM" is a confusing term as it implies the starter may be a
POM while it's actually a jar artifact like any other dependency. To
reduce the confusion (especially in the way such starter should be
declared in the build), the term Starter POM has been renamed to Starter.
Closes gh-5966