Merge branch '2.1.x'

pull/16342/head
Phillip Webb 6 years ago
commit 2376f973f4

@ -153,7 +153,7 @@ provision a new environment. To use the installer:
* Select "`Eclipse IDE for Java Developers`" under "`Eclipse.org`" as the product to
install and click "`next`".
* For the "`Project`" click on "`+`" to add a new setup file. Select "`Github Projects`"
and browser for `<checkout>/eclipse/spring-boot-project.setup` from your locally cloned
and browse for `<checkout>/eclipse/spring-boot-project.setup` from your locally cloned
copy of the source code. Click "`OK`" to add the setup file to the list.
* Double-click on "`Spring Boot`" from the project list to add it to the list that will
be provisioned then click "`Next`".
@ -166,12 +166,20 @@ Once complete you should find that a local workspace has been provisioned comple
all required Eclipse plugins. Projects will be grouped into working-sets to make the code
easier to navigate.
If you want to work on the `spring-boot-gradle-plugin` you should remove the imported Maven
project and reimport it as a Gradle project.
TIP: If you see import errors with `com.sun` packages make sure you have setup a valid
`JavaSE-1.8` environment. From preferences select "`Java`", "`Installed JREs`",
"`Execution Environments`" and make sure "`JavaSE-1.8`" points to a Java 1.8
install (we use AdoptOpenJDK on our CI).
==== Manual Installation with M2Eclipse
If you prefer to install Eclipse yourself you should use the
https://eclipse.org/m2e/[M2Eclipse] eclipse plugin. If you don't already have m2eclipse
installed it is available from the "Eclipse marketplace".
installed it is available from the "`Eclipse marketplace`".
Spring Boot includes project specific source formatting settings, in order to have these
work with m2eclipse, we provide an additional Eclipse plugin that you can install:

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<setup:Project
xmi:version="2.0"
xmlns:xmi="https://www.omg.org/XMI"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jdt="https://www.eclipse.org/oomph/setup/jdt/1.0"
xmlns:maven="https://www.eclipse.org/oomph/setup/maven/1.0"
xmlns:predicates="https://www.eclipse.org/oomph/predicates/1.0"
xmlns:setup="https://www.eclipse.org/oomph/setup/1.0"
xmlns:setup.p2="https://www.eclipse.org/oomph/setup/p2/1.0"
xmlns:setup.workingsets="https://www.eclipse.org/oomph/setup/workingsets/1.0"
xmlns:workingsets="https://www.eclipse.org/oomph/workingsets/1.0"
xsi:schemaLocation="https://www.eclipse.org/oomph/setup/jdt/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/JDT.ecore https://www.eclipse.org/oomph/setup/maven/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Maven.ecore https://www.eclipse.org/oomph/predicates/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Predicates.ecore https://www.eclipse.org/oomph/setup/workingsets/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/SetupWorkingSets.ecore https://www.eclipse.org/oomph/workingsets/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/WorkingSets.ecore"
name="spring.boot"
label="Spring Boot">
xmlns:jdt="http://www.eclipse.org/oomph/setup/jdt/1.0"
xmlns:maven="http://www.eclipse.org/oomph/setup/maven/1.0"
xmlns:predicates="http://www.eclipse.org/oomph/predicates/1.0"
xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
xmlns:setup.p2="http://www.eclipse.org/oomph/setup/p2/1.0"
xmlns:setup.workingsets="http://www.eclipse.org/oomph/setup/workingsets/1.0"
xmlns:workingsets="http://www.eclipse.org/oomph/workingsets/1.0"
xsi:schemaLocation="http://www.eclipse.org/oomph/setup/jdt/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/JDT.ecore http://www.eclipse.org/oomph/setup/maven/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Maven.ecore http://www.eclipse.org/oomph/predicates/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Predicates.ecore http://www.eclipse.org/oomph/setup/workingsets/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/SetupWorkingSets.ecore http://www.eclipse.org/oomph/workingsets/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/WorkingSets.ecore"
name="spring.boot.2.2.x"
label="Spring Boot 2.2.x">
<setupTask
xsi:type="setup:VariableTask"
type="FOLDER"
@ -54,8 +54,6 @@
</setupTask>
<setupTask
xsi:type="setup.p2:P2Task">
<requirement
name="epp.package.java"/>
<requirement
name="org.eclipse.platform.feature.group"/>
<requirement
@ -78,18 +76,10 @@
name="org.sonatype.m2e.buildhelper.feature.feature.group"/>
<requirement
name="org.springframework.ide.eclipse.boot.feature.feature.group"/>
<repository
url="https://download.eclipse.org/technology/epp/packages/oxygen/R/"/>
<repository
url="https://download.eclipse.org/releases/oxygen/"/>
<repository
url="https://dl.bintray.com/spring/javaformat-eclipse/"/>
<repository
url="https://download.eclipse.org/egit/github/updates/"/>
<repository
url="https://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-buildhelper/0.15.0/N/0.15.0.201207090124/"/>
<repository
url="https://dist.springsource.com/release/TOOLS/update/e4.7"/>
url="https://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-buildhelper/0.15.0/N/0.15.0.201405280027/"/>
<description>
Install the tools needed in the IDE to work with the
source code for ${scope.project.label}

@ -24,7 +24,7 @@
</property>
</activation>
<properties>
<spring-javaformat.version>0.0.7</spring-javaformat.version>
<spring-javaformat.version>0.0.8</spring-javaformat.version>
</properties>
<build>
<plugins>

@ -50,14 +50,16 @@ public class AuditAutoConfiguration {
}
@Bean
@ConditionalOnClass(name = "org.springframework.security.authentication.event.AbstractAuthenticationEvent")
@ConditionalOnClass(
name = "org.springframework.security.authentication.event.AbstractAuthenticationEvent")
@ConditionalOnMissingBean(AbstractAuthenticationAuditListener.class)
public AuthenticationAuditListener authenticationAuditListener() throws Exception {
return new AuthenticationAuditListener();
}
@Bean
@ConditionalOnClass(name = "org.springframework.security.access.event.AbstractAuthorizationEvent")
@ConditionalOnClass(
name = "org.springframework.security.access.event.AbstractAuthorizationEvent")
@ConditionalOnMissingBean(AbstractAuthorizationAuditListener.class)
public AuthorizationAuditListener authorizationAuditListener() throws Exception {
return new AuthorizationAuditListener();

@ -76,7 +76,8 @@ import org.springframework.web.server.WebFilter;
* @since 2.0.0
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(prefix = "management.cloudfoundry", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.cloudfoundry", name = "enabled",
matchIfMissing = true)
@AutoConfigureAfter({ HealthEndpointAutoConfiguration.class,
InfoEndpointAutoConfiguration.class })
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)

@ -76,7 +76,8 @@ import org.springframework.web.servlet.DispatcherServlet;
* @since 2.0.0
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(prefix = "management.cloudfoundry", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.cloudfoundry", name = "enabled",
matchIfMissing = true)
@AutoConfigureAfter({ ServletManagementContextAutoConfiguration.class,
HealthEndpointAutoConfiguration.class, InfoEndpointAutoConfiguration.class })
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -30,7 +30,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @author Andy Wilkinson
* @since 2.0.0
*/
@ConfigurationProperties(prefix = "management.health.elasticsearch", ignoreUnknownFields = false)
@ConfigurationProperties(prefix = "management.health.elasticsearch",
ignoreUnknownFields = false)
public class ElasticsearchHealthIndicatorProperties {
/**

@ -42,8 +42,8 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
*/
@Configuration(proxyBeanMethods = false)
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnClass(value = { Log4j2Metrics.class,
LogManager.class }, name = "org.apache.logging.log4j.core.LoggerContext")
@ConditionalOnClass(value = { Log4j2Metrics.class, LogManager.class },
name = "org.apache.logging.log4j.core.LoggerContext")
@ConditionalOnBean(MeterRegistry.class)
@Conditional(Log4JCoreLoggerContextCondition.class)
public class Log4J2MetricsAutoConfiguration {

@ -48,7 +48,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(AppOpticsMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.appoptics", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.appoptics", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(AppOpticsProperties.class)
public class AppOpticsMetricsExportAutoConfiguration {

@ -47,7 +47,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(AtlasMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.atlas", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.atlas", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(AtlasProperties.class)
public class AtlasMetricsExportAutoConfiguration {

@ -48,7 +48,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(DatadogMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.datadog", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.datadog", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(DatadogProperties.class)
public class DatadogMetricsExportAutoConfiguration {

@ -48,7 +48,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(DynatraceMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.dynatrace", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.dynatrace", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(DynatraceProperties.class)
public class DynatraceMetricsExportAutoConfiguration {

@ -48,7 +48,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(ElasticMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.elastic", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.elastic", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(ElasticProperties.class)
public class ElasticMetricsExportAutoConfiguration {

@ -46,7 +46,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(GangliaMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.ganglia", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.ganglia", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(GangliaProperties.class)
public class GangliaMetricsExportAutoConfiguration {

@ -46,7 +46,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(GraphiteMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.graphite", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.graphite", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(GraphiteProperties.class)
public class GraphiteMetricsExportAutoConfiguration {

@ -48,7 +48,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(HumioMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.humio", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.humio", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(HumioProperties.class)
public class HumioMetricsExportAutoConfiguration {

@ -48,7 +48,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(InfluxMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.influx", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.influx", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(InfluxProperties.class)
public class InfluxMetricsExportAutoConfiguration {

@ -46,7 +46,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(JmxMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.jmx", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.jmx", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(JmxProperties.class)
public class JmxMetricsExportAutoConfiguration {

@ -48,7 +48,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(KairosMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.kairos", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.kairos", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(KairosProperties.class)
public class KairosMetricsExportAutoConfiguration {

@ -49,7 +49,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(NewRelicMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.newrelic", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.newrelic", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(NewRelicProperties.class)
public class NewRelicMetricsExportAutoConfiguration {

@ -62,7 +62,8 @@ import org.springframework.core.env.Environment;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(PrometheusMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.prometheus", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.prometheus", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(PrometheusProperties.class)
public class PrometheusMetricsExportAutoConfiguration {
@ -106,7 +107,8 @@ public class PrometheusMetricsExportAutoConfiguration {
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(PushGateway.class)
@ConditionalOnProperty(prefix = "management.metrics.export.prometheus.pushgateway", name = "enabled")
@ConditionalOnProperty(prefix = "management.metrics.export.prometheus.pushgateway",
name = "enabled")
public static class PrometheusPushGatewayConfiguration {
private static final Log logger = LogFactory

@ -47,7 +47,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(SignalFxMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.signalfx", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.signalfx", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(SignalFxProperties.class)
public class SignalFxMetricsExportAutoConfiguration {

@ -47,7 +47,8 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnBean(Clock.class)
@EnableConfigurationProperties(SimpleProperties.class)
@ConditionalOnMissingBean(MeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.simple", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.simple", name = "enabled",
havingValue = "true", matchIfMissing = true)
public class SimpleMetricsExportAutoConfiguration {
@Bean

@ -47,7 +47,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(StatsdMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.statsd", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.statsd", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(StatsdProperties.class)
public class StatsdMetricsExportAutoConfiguration {

@ -48,7 +48,8 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(WavefrontMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.wavefront", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.metrics.export.wavefront", name = "enabled",
havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(WavefrontProperties.class)
public class WavefrontMetricsExportAutoConfiguration {

@ -38,7 +38,8 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnWebApplication
@ConditionalOnProperty(prefix = "management.trace.http", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.trace.http", name = "enabled",
matchIfMissing = true)
@EnableConfigurationProperties(HttpTraceProperties.class)
public class HttpTraceAutoConfiguration {

@ -96,7 +96,8 @@ class ServletManagementChildContextConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ EnableWebSecurity.class, Filter.class })
@ConditionalOnBean(name = BeanIds.SPRING_SECURITY_FILTER_CHAIN, search = SearchStrategy.ANCESTORS)
@ConditionalOnBean(name = BeanIds.SPRING_SECURITY_FILTER_CHAIN,
search = SearchStrategy.ANCESTORS)
static class ServletManagementContextSecurityConfiguration {
@Bean

@ -55,7 +55,8 @@ public class ServletManagementContextAutoConfiguration {
// Put Servlets and Filters in their own nested class so they don't force early
// instantiation of ManagementServerProperties.
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(prefix = "management.server", name = "add-application-context-header", havingValue = "true")
@ConditionalOnProperty(prefix = "management.server",
name = "add-application-context-header", havingValue = "true")
protected static class ApplicationContextFilterConfiguration {
@Bean

@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -74,7 +74,8 @@ public class SpringApplicationHierarchyTests {
Neo4jDataAutoConfiguration.class, Neo4jRepositoriesAutoConfiguration.class,
RedisAutoConfiguration.class, RedisRepositoriesAutoConfiguration.class,
FlywayAutoConfiguration.class, JestAutoConfiguration.class,
MetricsAutoConfiguration.class }, excludeName = {
MetricsAutoConfiguration.class },
excludeName = {
"org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration" })
public static class Child {
@ -87,7 +88,8 @@ public class SpringApplicationHierarchyTests {
Neo4jDataAutoConfiguration.class, Neo4jRepositoriesAutoConfiguration.class,
RedisAutoConfiguration.class, RedisRepositoriesAutoConfiguration.class,
FlywayAutoConfiguration.class, JestAutoConfiguration.class,
MetricsAutoConfiguration.class }, excludeName = {
MetricsAutoConfiguration.class },
excludeName = {
"org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration" })
public static class Parent {

@ -171,12 +171,14 @@ public class ConditionalOnEnabledEndpointTests {
}
@EndpointExtension(endpoint = FooEndpointEnabledByDefaultTrue.class, filter = TestFilter.class)
@EndpointExtension(endpoint = FooEndpointEnabledByDefaultTrue.class,
filter = TestFilter.class)
static class FooEndpointExtensionEnabledByDefaultTrue {
}
@EndpointExtension(endpoint = FooEndpointEnabledByDefaultFalse.class, filter = TestFilter.class)
@EndpointExtension(endpoint = FooEndpointEnabledByDefaultFalse.class,
filter = TestFilter.class)
static class FooEndpointExtensionEnabledByDefaultFalse {
}

@ -55,7 +55,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*
* @author Andy Wilkinson
*/
@TestPropertySource(properties = "spring.config.location=classpath:/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/")
@TestPropertySource(
properties = "spring.config.location=classpath:/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/")
public class EnvironmentEndpointDocumentationTests
extends MockMvcEndpointDocumentationTests {

@ -34,7 +34,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*
* @author Andy Wilkinson
*/
@TestPropertySource(properties = "logging.file.name=src/test/resources/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/sample.log")
@TestPropertySource(
properties = "logging.file.name=src/test/resources/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/sample.log")
public class LogFileWebEndpointDocumentationTests
extends MockMvcEndpointDocumentationTests {

@ -61,7 +61,8 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r
*
* @author Andy Wilkinson
*/
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = "spring.main.web-application-type=reactive")
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = "spring.main.web-application-type=reactive")
@RunWith(SpringRunner.class)
public class MappingsEndpointReactiveDocumentationTests
extends AbstractEndpointDocumentationTests {
@ -204,8 +205,10 @@ public class MappingsEndpointReactiveDocumentationTests
@RestController
private static class ExampleController {
@PostMapping(path = "/", consumes = { MediaType.APPLICATION_JSON_VALUE,
"!application/xml" }, produces = MediaType.TEXT_PLAIN_VALUE, headers = "X-Custom=Foo", params = "a!=alpha")
@PostMapping(path = "/",
consumes = { MediaType.APPLICATION_JSON_VALUE, "!application/xml" },
produces = MediaType.TEXT_PLAIN_VALUE, headers = "X-Custom=Foo",
params = "a!=alpha")
public String example() {
return "Hello World";
}

@ -232,8 +232,10 @@ public class MappingsEndpointServletDocumentationTests
@RestController
private static class ExampleController {
@PostMapping(path = "/", consumes = { MediaType.APPLICATION_JSON_VALUE,
"!application/xml" }, produces = MediaType.TEXT_PLAIN_VALUE, headers = "X-Custom=Foo", params = "a!=alpha")
@PostMapping(path = "/",
consumes = { MediaType.APPLICATION_JSON_VALUE, "!application/xml" },
produces = MediaType.TEXT_PLAIN_VALUE, headers = "X-Custom=Foo",
params = "a!=alpha")
public String example() {
return "Hello World";
}

@ -53,7 +53,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*
* @author Andy Wilkinson
*/
@TestPropertySource(properties = "spring.jackson.serialization.write-dates-as-timestamps=false")
@TestPropertySource(
properties = "spring.jackson.serialization.write-dates-as-timestamps=false")
public class SessionsEndpointDocumentationTests
extends MockMvcEndpointDocumentationTests {

@ -58,7 +58,8 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = "management.endpoints.web.exposure.include=jolokia")
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = "management.endpoints.web.exposure.include=jolokia")
@DirtiesContext
public class JolokiaEndpointAutoConfigurationIntegrationTests {

@ -83,7 +83,9 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat
*
* @author Jon Schneider
*/
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = MetricsIntegrationTests.MetricsApp.class, properties = "management.metrics.use-global-registry=false")
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
classes = MetricsIntegrationTests.MetricsApp.class,
properties = "management.metrics.use-global-registry=false")
@RunWith(SpringRunner.class)
public class MetricsIntegrationTests {

@ -482,7 +482,8 @@ public class EndpointDiscovererTests {
}
@EndpointExtension(endpoint = SpecializedTestEndpoint.class, filter = SpecializedEndpointFilter.class)
@EndpointExtension(endpoint = SpecializedTestEndpoint.class,
filter = SpecializedEndpointFilter.class)
public static class SpecializedExtension {
@ReadOperation

@ -470,8 +470,8 @@ public class JmxEndpointDiscovererTests {
@ReadOperation
@ManagedOperation(description = "Get something based on a timeUnit")
@ManagedOperationParameters({
@ManagedOperationParameter(name = "unitMs", description = "Number of milliseconds") })
@ManagedOperationParameters({ @ManagedOperationParameter(name = "unitMs",
description = "Number of milliseconds") })
public String getSomething(Long timeUnit) {
return null;
}
@ -487,8 +487,8 @@ public class JmxEndpointDiscovererTests {
@DeleteOperation
@ManagedOperation(description = "Delete something based on a timeUnit")
@ManagedOperationParameters({
@ManagedOperationParameter(name = "unitMs", description = "Number of milliseconds") })
@ManagedOperationParameters({ @ManagedOperationParameter(name = "unitMs",
description = "Number of milliseconds") })
public void deleteSomething(Long timeUnit) {
}

@ -162,8 +162,8 @@ public class LongTaskTimingHandlerInterceptorTests {
private CyclicBarrier callableBarrier;
@Timed
@Timed(value = "my.long.request", extraTags = { "region",
"test" }, longTask = true)
@Timed(value = "my.long.request", extraTags = { "region", "test" },
longTask = true)
@GetMapping("/callable/{id}")
public Callable<String> asyncCallable(@PathVariable Long id) throws Exception {
this.callableBarrier.await();

@ -396,8 +396,8 @@ public class WebMvcMetricsFilterTests {
}
@Timed
@Timed(value = "my.long.request", extraTags = { "region",
"test" }, longTask = true)
@Timed(value = "my.long.request", extraTags = { "region", "test" },
longTask = true)
@GetMapping("/callable/{id}")
public Callable<String> asyncCallable(@PathVariable Long id) throws Exception {
this.callableBarrier.await();

@ -55,7 +55,8 @@ import org.springframework.core.annotation.AliasFor;
@EnableAutoConfiguration
@ComponentScan(excludeFilters = {
@Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class),
@Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class) })
@Filter(type = FilterType.CUSTOM,
classes = AutoConfigurationExcludeFilter.class) })
@ConfigurationPropertiesScan
public @interface SpringBootApplication {

@ -41,7 +41,8 @@ import org.springframework.jmx.export.MBeanExporter;
*/
@Configuration(proxyBeanMethods = false)
@AutoConfigureAfter(JmxAutoConfiguration.class)
@ConditionalOnProperty(prefix = "spring.application.admin", value = "enabled", havingValue = "true", matchIfMissing = false)
@ConditionalOnProperty(prefix = "spring.application.admin", value = "enabled",
havingValue = "true", matchIfMissing = false)
public class SpringApplicationAdminJmxAutoConfiguration {
/**

@ -75,7 +75,8 @@ class RabbitAnnotationDrivenConfiguration {
@Bean(name = "rabbitListenerContainerFactory")
@ConditionalOnMissingBean(name = "rabbitListenerContainerFactory")
@ConditionalOnProperty(prefix = "spring.rabbitmq.listener", name = "type", havingValue = "simple", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.rabbitmq.listener", name = "type",
havingValue = "simple", matchIfMissing = true)
public SimpleRabbitListenerContainerFactory simpleRabbitListenerContainerFactory(
SimpleRabbitListenerContainerFactoryConfigurer configurer,
ConnectionFactory connectionFactory) {
@ -98,7 +99,8 @@ class RabbitAnnotationDrivenConfiguration {
@Bean(name = "rabbitListenerContainerFactory")
@ConditionalOnMissingBean(name = "rabbitListenerContainerFactory")
@ConditionalOnProperty(prefix = "spring.rabbitmq.listener", name = "type", havingValue = "direct")
@ConditionalOnProperty(prefix = "spring.rabbitmq.listener", name = "type",
havingValue = "direct")
public DirectRabbitListenerContainerFactory directRabbitListenerContainerFactory(
DirectRabbitListenerContainerFactoryConfigurer configurer,
ConnectionFactory connectionFactory) {
@ -109,7 +111,8 @@ class RabbitAnnotationDrivenConfiguration {
@Configuration(proxyBeanMethods = false)
@EnableRabbit
@ConditionalOnMissingBean(name = RabbitListenerConfigUtils.RABBIT_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME)
@ConditionalOnMissingBean(
name = RabbitListenerConfigUtils.RABBIT_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME)
protected static class EnableRabbitConfiguration {
}

@ -194,7 +194,8 @@ public class RabbitAutoConfiguration {
@Bean
@ConditionalOnSingleCandidate(ConnectionFactory.class)
@ConditionalOnProperty(prefix = "spring.rabbitmq", name = "dynamic", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.rabbitmq", name = "dynamic",
matchIfMissing = true)
@ConditionalOnMissingBean
public AmqpAdmin amqpAdmin(ConnectionFactory connectionFactory) {
return new RabbitAdmin(connectionFactory);

@ -42,19 +42,22 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ EnableAspectJAutoProxy.class, Aspect.class, Advice.class,
AnnotatedElement.class })
@ConditionalOnProperty(prefix = "spring.aop", name = "auto", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.aop", name = "auto", havingValue = "true",
matchIfMissing = true)
public class AopAutoConfiguration {
@Configuration(proxyBeanMethods = false)
@EnableAspectJAutoProxy(proxyTargetClass = false)
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "false", matchIfMissing = false)
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class",
havingValue = "false", matchIfMissing = false)
public static class JdkDynamicAutoProxyConfiguration {
}
@Configuration(proxyBeanMethods = false)
@EnableAspectJAutoProxy(proxyTargetClass = true)
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class",
havingValue = "true", matchIfMissing = true)
public static class CglibAutoProxyConfiguration {
}

@ -83,7 +83,8 @@ public class BatchAutoConfiguration {
@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty(prefix = "spring.batch.job", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.batch.job", name = "enabled",
havingValue = "true", matchIfMissing = true)
public JobLauncherCommandLineRunner jobLauncherCommandLineRunner(
JobLauncher jobLauncher, JobExplorer jobExplorer,
JobRepository jobRepository) {

@ -50,7 +50,8 @@ import org.springframework.util.StringUtils;
* @author Eddú Meléndez
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnMissingBean(name = AbstractApplicationContext.MESSAGE_SOURCE_BEAN_NAME, search = SearchStrategy.CURRENT)
@ConditionalOnMissingBean(name = AbstractApplicationContext.MESSAGE_SOURCE_BEAN_NAME,
search = SearchStrategy.CURRENT)
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE)
@Conditional(ResourceBundleCondition.class)
@EnableConfigurationProperties

@ -44,7 +44,8 @@ import org.springframework.context.annotation.Import;
public class CouchbaseAutoConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnMissingBean(value = CouchbaseConfiguration.class, type = "org.springframework.data.couchbase.config.CouchbaseConfigurer")
@ConditionalOnMissingBean(value = CouchbaseConfiguration.class,
type = "org.springframework.data.couchbase.config.CouchbaseConfigurer")
@Import(CouchbaseConfiguration.class)
static class DefaultCouchbaseConfiguration {
@ -69,7 +70,8 @@ public class CouchbaseAutoConfiguration {
}
@ConditionalOnBean(type = "org.springframework.data.couchbase.config.CouchbaseConfigurer")
@ConditionalOnBean(
type = "org.springframework.data.couchbase.config.CouchbaseConfigurer")
static class CouchbaseConfigurerAvailable {
}

@ -40,7 +40,8 @@ public class PersistenceExceptionTranslationAutoConfiguration {
@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty(prefix = "spring.dao.exceptiontranslation", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.dao.exceptiontranslation", name = "enabled",
matchIfMissing = true)
public static PersistenceExceptionTranslationPostProcessor persistenceExceptionTranslationPostProcessor(
Environment environment) {
PersistenceExceptionTranslationPostProcessor postProcessor = new PersistenceExceptionTranslationPostProcessor();

@ -40,7 +40,8 @@ import org.springframework.data.elasticsearch.client.TransportClientFactoryBean;
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ Client.class, TransportClientFactoryBean.class })
@ConditionalOnProperty(prefix = "spring.data.elasticsearch", name = "cluster-nodes", matchIfMissing = false)
@ConditionalOnProperty(prefix = "spring.data.elasticsearch", name = "cluster-nodes",
matchIfMissing = false)
@EnableConfigurationProperties(ElasticsearchProperties.class)
public class ElasticsearchAutoConfiguration {

@ -39,7 +39,8 @@ import org.springframework.data.elasticsearch.repository.support.ElasticsearchRe
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ Client.class, ElasticsearchRepository.class })
@ConditionalOnProperty(prefix = "spring.data.elasticsearch.repositories", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.data.elasticsearch.repositories",
name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnMissingBean(ElasticsearchRepositoryFactoryBean.class)
@Import(ElasticsearchRepositoriesRegistrar.class)
public class ElasticsearchRepositoriesAutoConfiguration {

@ -47,7 +47,8 @@ import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
@ConditionalOnBean(NamedParameterJdbcOperations.class)
@ConditionalOnClass({ NamedParameterJdbcOperations.class,
AbstractJdbcConfiguration.class })
@ConditionalOnProperty(prefix = "spring.data.jdbc.repositories", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.data.jdbc.repositories", name = "enabled",
havingValue = "true", matchIfMissing = true)
@AutoConfigureAfter(JdbcTemplateAutoConfiguration.class)
public class JdbcRepositoriesAutoConfiguration {

@ -64,7 +64,8 @@ import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean;
@ConditionalOnClass(JpaRepository.class)
@ConditionalOnMissingBean({ JpaRepositoryFactoryBean.class,
JpaRepositoryConfigExtension.class })
@ConditionalOnProperty(prefix = "spring.data.jpa.repositories", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.data.jpa.repositories", name = "enabled",
havingValue = "true", matchIfMissing = true)
@Import(JpaRepositoriesAutoConfigureRegistrar.class)
@AutoConfigureAfter({ HibernateJpaAutoConfiguration.class,
TaskExecutionAutoConfiguration.class })
@ -98,12 +99,14 @@ public class JpaRepositoriesAutoConfiguration {
super(ConfigurationPhase.REGISTER_BEAN);
}
@ConditionalOnProperty(prefix = "spring.data.jpa.repositories", name = "bootstrap-mode", havingValue = "deferred", matchIfMissing = false)
@ConditionalOnProperty(prefix = "spring.data.jpa.repositories",
name = "bootstrap-mode", havingValue = "deferred", matchIfMissing = false)
static class DeferredBootstrapMode {
}
@ConditionalOnProperty(prefix = "spring.data.jpa.repositories", name = "bootstrap-mode", havingValue = "lazy", matchIfMissing = false)
@ConditionalOnProperty(prefix = "spring.data.jpa.repositories",
name = "bootstrap-mode", havingValue = "lazy", matchIfMissing = false)
static class LazyBootstrapMode {
}

@ -35,7 +35,8 @@ import org.springframework.data.ldap.repository.support.LdapRepositoryFactoryBea
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ LdapContext.class, LdapRepository.class })
@ConditionalOnProperty(prefix = "spring.data.ldap.repositories", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.data.ldap.repositories", name = "enabled",
havingValue = "true", matchIfMissing = true)
@ConditionalOnMissingBean(LdapRepositoryFactoryBean.class)
@Import(LdapRepositoriesRegistrar.class)
public class LdapRepositoriesAutoConfiguration {

@ -52,7 +52,8 @@ class Neo4jBookmarkManagementConfiguration {
@Bean(BOOKMARK_MANAGER_BEAN_NAME)
@ConditionalOnWebApplication
@Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.INTERFACES)
@Scope(value = WebApplicationContext.SCOPE_REQUEST,
proxyMode = ScopedProxyMode.INTERFACES)
public BookmarkManager requestScopedBookmarkManager() {
return new CaffeineBookmarkManager();
}

@ -109,7 +109,8 @@ public class Neo4jDataAutoConfiguration {
@ConditionalOnWebApplication(type = Type.SERVLET)
@ConditionalOnClass({ WebMvcConfigurer.class, OpenSessionInViewInterceptor.class })
@ConditionalOnMissingBean(OpenSessionInViewInterceptor.class)
@ConditionalOnProperty(prefix = "spring.data.neo4j", name = "open-in-view", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.data.neo4j", name = "open-in-view",
havingValue = "true", matchIfMissing = true)
protected static class Neo4jWebConfiguration {
private static final Log logger = LogFactory.getLog(Neo4jWebConfiguration.class);

@ -52,7 +52,8 @@ import org.springframework.data.neo4j.repository.support.Neo4jRepositoryFactoryB
@ConditionalOnClass({ Neo4jSession.class, Neo4jRepository.class })
@ConditionalOnMissingBean({ Neo4jRepositoryFactoryBean.class,
Neo4jRepositoryConfigurationExtension.class })
@ConditionalOnProperty(prefix = "spring.data.neo4j.repositories", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.data.neo4j.repositories", name = "enabled",
havingValue = "true", matchIfMissing = true)
@Import(Neo4jRepositoriesAutoConfigureRegistrar.class)
@AutoConfigureAfter(Neo4jDataAutoConfiguration.class)
public class Neo4jRepositoriesAutoConfiguration {

@ -40,7 +40,8 @@ import org.springframework.data.redis.repository.support.RedisRepositoryFactoryB
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(EnableRedisRepositories.class)
@ConditionalOnBean(RedisConnectionFactory.class)
@ConditionalOnProperty(prefix = "spring.data.redis.repositories", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.data.redis.repositories", name = "enabled",
havingValue = "true", matchIfMissing = true)
@ConditionalOnMissingBean(RedisRepositoryFactoryBean.class)
@Import(RedisRepositoriesAutoConfigureRegistrar.class)
@AutoConfigureAfter(RedisAutoConfiguration.class)

@ -46,7 +46,8 @@ import org.springframework.data.solr.repository.support.SolrRepositoryFactoryBea
@ConditionalOnClass({ SolrClient.class, SolrRepository.class })
@ConditionalOnMissingBean({ SolrRepositoryFactoryBean.class,
SolrRepositoryConfigExtension.class })
@ConditionalOnProperty(prefix = "spring.data.solr.repositories", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.data.solr.repositories", name = "enabled",
havingValue = "true", matchIfMissing = true)
@Import(SolrRepositoriesRegistrar.class)
public class SolrRepositoriesAutoConfiguration {

@ -39,7 +39,8 @@ import org.springframework.context.annotation.Configuration;
@Configuration(proxyBeanMethods = false)
@ConditionalOnWebApplication(type = Type.SERVLET)
@ConditionalOnClass(WebServlet.class)
@ConditionalOnProperty(prefix = "spring.h2.console", name = "enabled", havingValue = "true", matchIfMissing = false)
@ConditionalOnProperty(prefix = "spring.h2.console", name = "enabled",
havingValue = "true", matchIfMissing = false)
@EnableConfigurationProperties(H2ConsoleProperties.class)
public class H2ConsoleAutoConfiguration {

@ -46,7 +46,8 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl
public class HypermediaHttpMessageConverterConfiguration {
@Bean
@ConditionalOnProperty(prefix = "spring.hateoas", name = "use-hal-as-default-json-media-type", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.hateoas",
name = "use-hal-as-default-json-media-type", matchIfMissing = true)
public static HalMessageConverterSupportedMediaTypesCustomizer halMessageConverterSupportedMediaTypeCustomizer() {
return new HalMessageConverterSupportedMediaTypesCustomizer();
}

@ -63,7 +63,9 @@ class GsonHttpMessageConvertersConfiguration {
super(ConfigurationPhase.REGISTER_BEAN);
}
@ConditionalOnProperty(name = HttpMessageConvertersAutoConfiguration.PREFERRED_MAPPER_PROPERTY, havingValue = "gson")
@ConditionalOnProperty(
name = HttpMessageConvertersAutoConfiguration.PREFERRED_MAPPER_PROPERTY,
havingValue = "gson")
static class GsonPreferred {
}
@ -87,7 +89,9 @@ class GsonHttpMessageConvertersConfiguration {
}
@ConditionalOnProperty(name = HttpMessageConvertersAutoConfiguration.PREFERRED_MAPPER_PROPERTY, havingValue = "jsonb")
@ConditionalOnProperty(
name = HttpMessageConvertersAutoConfiguration.PREFERRED_MAPPER_PROPERTY,
havingValue = "jsonb")
static class JsonbPreferred {
}

@ -41,13 +41,16 @@ class JacksonHttpMessageConvertersConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(ObjectMapper.class)
@ConditionalOnBean(ObjectMapper.class)
@ConditionalOnProperty(name = HttpMessageConvertersAutoConfiguration.PREFERRED_MAPPER_PROPERTY, havingValue = "jackson", matchIfMissing = true)
@ConditionalOnProperty(
name = HttpMessageConvertersAutoConfiguration.PREFERRED_MAPPER_PROPERTY,
havingValue = "jackson", matchIfMissing = true)
protected static class MappingJackson2HttpMessageConverterConfiguration {
@Bean
@ConditionalOnMissingBean(value = MappingJackson2HttpMessageConverter.class, ignoredType = {
"org.springframework.hateoas.server.mvc.TypeConstrainedMappingJackson2HttpMessageConverter",
"org.springframework.data.rest.webmvc.alps.AlpsJsonHttpMessageConverter" })
@ConditionalOnMissingBean(value = MappingJackson2HttpMessageConverter.class,
ignoredType = {
"org.springframework.hateoas.server.mvc.TypeConstrainedMappingJackson2HttpMessageConverter",
"org.springframework.data.rest.webmvc.alps.AlpsJsonHttpMessageConverter" })
public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter(
ObjectMapper objectMapper) {
return new MappingJackson2HttpMessageConverter(objectMapper);

@ -62,7 +62,9 @@ class JsonbHttpMessageConvertersConfiguration {
super(ConfigurationPhase.REGISTER_BEAN);
}
@ConditionalOnProperty(name = HttpMessageConvertersAutoConfiguration.PREFERRED_MAPPER_PROPERTY, havingValue = "jsonb")
@ConditionalOnProperty(
name = HttpMessageConvertersAutoConfiguration.PREFERRED_MAPPER_PROPERTY,
havingValue = "jsonb")
static class JsonbPreferred {
}

@ -66,7 +66,8 @@ public class ProjectInfoAutoConfiguration {
this.properties.getGit().getEncoding()));
}
@ConditionalOnResource(resources = "${spring.info.build.location:classpath:META-INF/build-info.properties}")
@ConditionalOnResource(
resources = "${spring.info.build.location:classpath:META-INF/build-info.properties}")
@ConditionalOnMissingBean
@Bean
public BuildProperties buildProperties() throws Exception {

@ -75,9 +75,11 @@ public class IntegrationAutoConfiguration {
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(EnableIntegrationMBeanExport.class)
@ConditionalOnMissingBean(value = IntegrationMBeanExporter.class, search = SearchStrategy.CURRENT)
@ConditionalOnMissingBean(value = IntegrationMBeanExporter.class,
search = SearchStrategy.CURRENT)
@ConditionalOnBean(MBeanServer.class)
@ConditionalOnProperty(prefix = "spring.jmx", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.jmx", name = "enabled", havingValue = "true",
matchIfMissing = true)
protected static class IntegrationJmxConfiguration {
@Bean
@ -101,7 +103,9 @@ public class IntegrationAutoConfiguration {
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(EnableIntegrationManagement.class)
@ConditionalOnMissingBean(value = IntegrationManagementConfigurer.class, name = IntegrationManagementConfigurer.MANAGEMENT_CONFIGURER_NAME, search = SearchStrategy.CURRENT)
@ConditionalOnMissingBean(value = IntegrationManagementConfigurer.class,
name = IntegrationManagementConfigurer.MANAGEMENT_CONFIGURER_NAME,
search = SearchStrategy.CURRENT)
protected static class IntegrationManagementConfiguration {
@Configuration(proxyBeanMethods = false)

@ -50,7 +50,8 @@ abstract class DataSourceConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(org.apache.tomcat.jdbc.pool.DataSource.class)
@ConditionalOnMissingBean(DataSource.class)
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.tomcat.jdbc.pool.DataSource", matchIfMissing = true)
@ConditionalOnProperty(name = "spring.datasource.type",
havingValue = "org.apache.tomcat.jdbc.pool.DataSource", matchIfMissing = true)
static class Tomcat {
@Bean
@ -77,7 +78,8 @@ abstract class DataSourceConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(HikariDataSource.class)
@ConditionalOnMissingBean(DataSource.class)
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "com.zaxxer.hikari.HikariDataSource", matchIfMissing = true)
@ConditionalOnProperty(name = "spring.datasource.type",
havingValue = "com.zaxxer.hikari.HikariDataSource", matchIfMissing = true)
static class Hikari {
@Bean
@ -99,7 +101,9 @@ abstract class DataSourceConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(org.apache.commons.dbcp2.BasicDataSource.class)
@ConditionalOnMissingBean(DataSource.class)
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.commons.dbcp2.BasicDataSource", matchIfMissing = true)
@ConditionalOnProperty(name = "spring.datasource.type",
havingValue = "org.apache.commons.dbcp2.BasicDataSource",
matchIfMissing = true)
static class Dbcp2 {
@Bean

@ -42,7 +42,8 @@ import org.springframework.jmx.export.MBeanExporter;
* @author Stephane Nicoll
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(prefix = "spring.jmx", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.jmx", name = "enabled", havingValue = "true",
matchIfMissing = true)
class DataSourceJmxConfiguration {
private static final Log logger = LogFactory.getLog(DataSourceJmxConfiguration.class);

@ -132,7 +132,8 @@ public class JerseyAutoConfiguration implements ServletContextAware {
@Bean
@ConditionalOnMissingBean(name = "jerseyFilterRegistration")
@ConditionalOnProperty(prefix = "spring.jersey", name = "type", havingValue = "filter")
@ConditionalOnProperty(prefix = "spring.jersey", name = "type",
havingValue = "filter")
public FilterRegistrationBean<ServletContainer> jerseyFilterRegistration(
JerseyApplicationPath applicationPath) {
FilterRegistrationBean<ServletContainer> registration = new FilterRegistrationBean<>();
@ -157,7 +158,8 @@ public class JerseyAutoConfiguration implements ServletContextAware {
@Bean
@ConditionalOnMissingBean(name = "jerseyServletRegistration")
@ConditionalOnProperty(prefix = "spring.jersey", name = "type", havingValue = "servlet", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.jersey", name = "type",
havingValue = "servlet", matchIfMissing = true)
public ServletRegistrationBean<ServletContainer> jerseyServletRegistration(
JerseyApplicationPath applicationPath) {
ServletRegistrationBean<ServletContainer> registration = new ServletRegistrationBean<>(

@ -86,7 +86,8 @@ class JmsAnnotationDrivenConfiguration {
@Configuration(proxyBeanMethods = false)
@EnableJms
@ConditionalOnMissingBean(name = JmsListenerConfigUtils.JMS_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME)
@ConditionalOnMissingBean(
name = JmsListenerConfigUtils.JMS_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME)
protected static class EnableJmsConfiguration {
}

@ -51,7 +51,8 @@ class ActiveMQConnectionFactoryConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(CachingConnectionFactory.class)
@ConditionalOnProperty(prefix = "spring.activemq.pool", name = "enabled", havingValue = "false", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.activemq.pool", name = "enabled",
havingValue = "false", matchIfMissing = true)
static class SimpleConnectionFactoryConfiguration {
private final ActiveMQProperties properties;
@ -66,7 +67,8 @@ class ActiveMQConnectionFactoryConfiguration {
}
@Bean
@ConditionalOnProperty(prefix = "spring.jms.cache", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.jms.cache", name = "enabled",
havingValue = "true", matchIfMissing = true)
public CachingConnectionFactory cachingJmsConnectionFactory(
JmsProperties jmsProperties) {
JmsProperties.Cache cacheProperties = jmsProperties.getCache();
@ -79,7 +81,8 @@ class ActiveMQConnectionFactoryConfiguration {
}
@Bean
@ConditionalOnProperty(prefix = "spring.jms.cache", name = "enabled", havingValue = "false")
@ConditionalOnProperty(prefix = "spring.jms.cache", name = "enabled",
havingValue = "false")
public ActiveMQConnectionFactory jmsConnectionFactory() {
return createConnectionFactory();
}
@ -97,7 +100,8 @@ class ActiveMQConnectionFactoryConfiguration {
static class PooledConnectionFactoryConfiguration {
@Bean(destroyMethod = "stop")
@ConditionalOnProperty(prefix = "spring.activemq.pool", name = "enabled", havingValue = "true", matchIfMissing = false)
@ConditionalOnProperty(prefix = "spring.activemq.pool", name = "enabled",
havingValue = "true", matchIfMissing = false)
public JmsPoolConnectionFactory pooledJmsConnectionFactory(
ActiveMQProperties properties,
ObjectProvider<ActiveMQConnectionFactoryCustomizer> factoryCustomizers) {

@ -60,7 +60,8 @@ class ActiveMQXAConnectionFactoryConfiguration {
}
@Bean
@ConditionalOnProperty(prefix = "spring.activemq.pool", name = "enabled", havingValue = "false", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.activemq.pool", name = "enabled",
havingValue = "false", matchIfMissing = true)
public ActiveMQConnectionFactory nonXaJmsConnectionFactory(
ActiveMQProperties properties,
ObjectProvider<ActiveMQConnectionFactoryCustomizer> factoryCustomizers) {

@ -45,7 +45,8 @@ class ArtemisConnectionFactoryConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(CachingConnectionFactory.class)
@ConditionalOnProperty(prefix = "spring.artemis.pool", name = "enabled", havingValue = "false", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.artemis.pool", name = "enabled",
havingValue = "false", matchIfMissing = true)
static class SimpleConnectionFactoryConfiguration {
private final ArtemisProperties properties;
@ -59,7 +60,8 @@ class ArtemisConnectionFactoryConfiguration {
}
@Bean
@ConditionalOnProperty(prefix = "spring.jms.cache", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.jms.cache", name = "enabled",
havingValue = "true", matchIfMissing = true)
public CachingConnectionFactory cachingJmsConnectionFactory(
JmsProperties jmsProperties) {
JmsProperties.Cache cacheProperties = jmsProperties.getCache();
@ -72,7 +74,8 @@ class ArtemisConnectionFactoryConfiguration {
}
@Bean
@ConditionalOnProperty(prefix = "spring.jms.cache", name = "enabled", havingValue = "false")
@ConditionalOnProperty(prefix = "spring.jms.cache", name = "enabled",
havingValue = "false")
public ActiveMQConnectionFactory jmsConnectionFactory() {
return createConnectionFactory();
}
@ -89,7 +92,8 @@ class ArtemisConnectionFactoryConfiguration {
static class PooledConnectionFactoryConfiguration {
@Bean(destroyMethod = "stop")
@ConditionalOnProperty(prefix = "spring.artemis.pool", name = "enabled", havingValue = "true", matchIfMissing = false)
@ConditionalOnProperty(prefix = "spring.artemis.pool", name = "enabled",
havingValue = "true", matchIfMissing = false)
public JmsPoolConnectionFactory pooledJmsConnectionFactory(
ListableBeanFactory beanFactory, ArtemisProperties properties) {
ActiveMQConnectionFactory connectionFactory = new ArtemisConnectionFactoryFactory(

@ -43,7 +43,8 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(EmbeddedJMS.class)
@ConditionalOnProperty(prefix = "spring.artemis.embedded", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.artemis.embedded", name = "enabled",
havingValue = "true", matchIfMissing = true)
class ArtemisEmbeddedServerConfiguration {
private final ArtemisProperties properties;

@ -61,7 +61,8 @@ public class JmxAutoConfiguration {
@Bean
@Primary
@ConditionalOnMissingBean(value = MBeanExporter.class, search = SearchStrategy.CURRENT)
@ConditionalOnMissingBean(value = MBeanExporter.class,
search = SearchStrategy.CURRENT)
public AnnotationMBeanExporter mbeanExporter(ObjectNamingStrategy namingStrategy,
BeanFactory beanFactory) {
AnnotationMBeanExporter exporter = new AnnotationMBeanExporter();
@ -76,7 +77,8 @@ public class JmxAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean(value = ObjectNamingStrategy.class, search = SearchStrategy.CURRENT)
@ConditionalOnMissingBean(value = ObjectNamingStrategy.class,
search = SearchStrategy.CURRENT)
public ParentAwareNamingStrategy objectNamingStrategy() {
ParentAwareNamingStrategy namingStrategy = new ParentAwareNamingStrategy(
new AnnotationJmxAttributeSource());

@ -34,9 +34,9 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(Jsonb.class)
@ConditionalOnResource(resources = {
"classpath:META-INF/services/javax.json.bind.spi.JsonbProvider",
"classpath:META-INF/services/javax.json.spi.JsonProvider" })
@ConditionalOnResource(
resources = { "classpath:META-INF/services/javax.json.bind.spi.JsonbProvider",
"classpath:META-INF/services/javax.json.spi.JsonProvider" })
public class JsonbAutoConfiguration {
@Bean

@ -104,7 +104,8 @@ class KafkaAnnotationDrivenConfiguration {
@Configuration(proxyBeanMethods = false)
@EnableKafka
@ConditionalOnMissingBean(name = KafkaListenerConfigUtils.KAFKA_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME)
@ConditionalOnMissingBean(
name = KafkaListenerConfigUtils.KAFKA_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME)
protected static class EnableKafkaConfiguration {
}

@ -42,7 +42,8 @@ import org.springframework.kafka.config.StreamsBuilderFactoryBean;
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(StreamsBuilder.class)
@ConditionalOnBean(name = KafkaStreamsDefaultConfiguration.DEFAULT_STREAMS_BUILDER_BEAN_NAME)
@ConditionalOnBean(
name = KafkaStreamsDefaultConfiguration.DEFAULT_STREAMS_BUILDER_BEAN_NAME)
class KafkaStreamsAnnotationDrivenConfiguration {
private final KafkaProperties properties;

@ -66,7 +66,8 @@ import org.springframework.util.Assert;
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ SpringLiquibase.class, DatabaseChange.class })
@ConditionalOnBean(DataSource.class)
@ConditionalOnProperty(prefix = "spring.liquibase", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.liquibase", name = "enabled",
matchIfMissing = true)
@AutoConfigureAfter({ DataSourceAutoConfiguration.class,
HibernateJpaAutoConfiguration.class })
public class LiquibaseAutoConfiguration {

@ -44,8 +44,8 @@ import org.springframework.core.env.Environment;
public class MongoAutoConfiguration {
@Bean
@ConditionalOnMissingBean(type = { "com.mongodb.MongoClient",
"com.mongodb.client.MongoClient" })
@ConditionalOnMissingBean(
type = { "com.mongodb.MongoClient", "com.mongodb.client.MongoClient" })
public MongoClient mongo(MongoProperties properties,
ObjectProvider<MongoClientOptions> options, Environment environment) {
return new MongoClientFactory(properties, environment)

@ -208,7 +208,8 @@ public abstract class JpaBaseConfiguration implements BeanFactoryAware {
@ConditionalOnMissingBean({ OpenEntityManagerInViewInterceptor.class,
OpenEntityManagerInViewFilter.class })
@ConditionalOnMissingFilterBean(OpenEntityManagerInViewFilter.class)
@ConditionalOnProperty(prefix = "spring.jpa", name = "open-in-view", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.jpa", name = "open-in-view",
havingValue = "true", matchIfMissing = true)
protected static class JpaWebConfiguration {
private static final Log logger = LogFactory.getLog(JpaWebConfiguration.class);

@ -67,7 +67,8 @@ public class UserDetailsServiceAutoConfiguration {
.getLog(UserDetailsServiceAutoConfiguration.class);
@Bean
@ConditionalOnMissingBean(type = "org.springframework.security.oauth2.client.registration.ClientRegistrationRepository")
@ConditionalOnMissingBean(
type = "org.springframework.security.oauth2.client.registration.ClientRegistrationRepository")
@Lazy
public InMemoryUserDetailsManager inMemoryUserDetailsManager(
SecurityProperties properties,

@ -48,7 +48,8 @@ import org.springframework.scheduling.config.TaskManagementConfigUtils;
public class TaskSchedulingAutoConfiguration {
@Bean
@ConditionalOnBean(name = TaskManagementConfigUtils.SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME)
@ConditionalOnBean(
name = TaskManagementConfigUtils.SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME)
@ConditionalOnMissingBean({ SchedulingConfigurer.class, TaskScheduler.class,
ScheduledExecutorService.class })
public ThreadPoolTaskScheduler taskScheduler(TaskSchedulerBuilder builder) {

@ -80,14 +80,16 @@ public class TransactionAutoConfiguration {
@Configuration(proxyBeanMethods = false)
@EnableTransactionManagement(proxyTargetClass = false)
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "false", matchIfMissing = false)
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class",
havingValue = "false", matchIfMissing = false)
public static class JdkDynamicAutoProxyConfiguration {
}
@Configuration(proxyBeanMethods = false)
@EnableTransactionManagement(proxyTargetClass = true)
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class",
havingValue = "true", matchIfMissing = true)
public static class CglibAutoProxyConfiguration {
}

@ -44,7 +44,8 @@ import org.springframework.validation.beanvalidation.MethodValidationPostProcess
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(ExecutableValidator.class)
@ConditionalOnResource(resources = "classpath:META-INF/services/javax.validation.spi.ValidationProvider")
@ConditionalOnResource(
resources = "classpath:META-INF/services/javax.validation.spi.ValidationProvider")
@Import(PrimaryDefaultValidatorPostProcessor.class)
public class ValidationAutoConfiguration {

@ -89,7 +89,8 @@ public class WebFluxAutoConfiguration {
@Bean
@ConditionalOnMissingBean(HiddenHttpMethodFilter.class)
@ConditionalOnProperty(prefix = "spring.webflux.hiddenmethod.filter", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.webflux.hiddenmethod.filter",
name = "enabled", matchIfMissing = true)
public OrderedHiddenHttpMethodFilter hiddenHttpMethodFilter() {
return new OrderedHiddenHttpMethodFilter();
}

@ -61,7 +61,8 @@ public class ErrorWebFluxAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean(value = ErrorWebExceptionHandler.class, search = SearchStrategy.CURRENT)
@ConditionalOnMissingBean(value = ErrorWebExceptionHandler.class,
search = SearchStrategy.CURRENT)
@Order(-1)
public ErrorWebExceptionHandler errorWebExceptionHandler(
ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
@ -79,7 +80,8 @@ public class ErrorWebFluxAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean(value = ErrorAttributes.class, search = SearchStrategy.CURRENT)
@ConditionalOnMissingBean(value = ErrorAttributes.class,
search = SearchStrategy.CURRENT)
public DefaultErrorAttributes errorAttributes() {
return new DefaultErrorAttributes(
this.serverProperties.getError().isIncludeException());

@ -118,7 +118,8 @@ public class DispatcherServletAutoConfiguration {
protected static class DispatcherServletRegistrationConfiguration {
@Bean(name = DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME)
@ConditionalOnBean(value = DispatcherServlet.class, name = DEFAULT_DISPATCHER_SERVLET_BEAN_NAME)
@ConditionalOnBean(value = DispatcherServlet.class,
name = DEFAULT_DISPATCHER_SERVLET_BEAN_NAME)
public DispatcherServletRegistrationBean dispatcherServletRegistration(
DispatcherServlet dispatcherServlet, WebMvcProperties webMvcProperties,
ObjectProvider<MultipartConfigElement> multipartConfig) {

@ -44,7 +44,8 @@ import org.springframework.web.filter.CharacterEncodingFilter;
@EnableConfigurationProperties(HttpProperties.class)
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
@ConditionalOnClass(CharacterEncodingFilter.class)
@ConditionalOnProperty(prefix = "spring.http.encoding", value = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.http.encoding", value = "enabled",
matchIfMissing = true)
public class HttpEncodingAutoConfiguration {
private final HttpProperties.Encoding properties;

@ -51,7 +51,8 @@ import org.springframework.web.servlet.DispatcherServlet;
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ Servlet.class, StandardServletMultipartResolver.class,
MultipartConfigElement.class })
@ConditionalOnProperty(prefix = "spring.servlet.multipart", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.servlet.multipart", name = "enabled",
matchIfMissing = true)
@ConditionalOnWebApplication(type = Type.SERVLET)
@EnableConfigurationProperties(MultipartProperties.class)
public class MultipartAutoConfiguration {

@ -59,7 +59,8 @@ class ServletWebServerFactoryConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ Servlet.class, Tomcat.class, UpgradeProtocol.class })
@ConditionalOnMissingBean(value = ServletWebServerFactory.class, search = SearchStrategy.CURRENT)
@ConditionalOnMissingBean(value = ServletWebServerFactory.class,
search = SearchStrategy.CURRENT)
public static class EmbeddedTomcat {
@Bean
@ -82,7 +83,8 @@ class ServletWebServerFactoryConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ Servlet.class, Server.class, Loader.class,
WebAppContext.class })
@ConditionalOnMissingBean(value = ServletWebServerFactory.class, search = SearchStrategy.CURRENT)
@ConditionalOnMissingBean(value = ServletWebServerFactory.class,
search = SearchStrategy.CURRENT)
public static class EmbeddedJetty {
@Bean
@ -97,7 +99,8 @@ class ServletWebServerFactoryConfiguration {
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ Servlet.class, Undertow.class, SslClientAuthMode.class })
@ConditionalOnMissingBean(value = ServletWebServerFactory.class, search = SearchStrategy.CURRENT)
@ConditionalOnMissingBean(value = ServletWebServerFactory.class,
search = SearchStrategy.CURRENT)
public static class EmbeddedUndertow {
@Bean

@ -154,14 +154,16 @@ public class WebMvcAutoConfiguration {
@Bean
@ConditionalOnMissingBean(HiddenHttpMethodFilter.class)
@ConditionalOnProperty(prefix = "spring.mvc.hiddenmethod.filter", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.mvc.hiddenmethod.filter", name = "enabled",
matchIfMissing = true)
public OrderedHiddenHttpMethodFilter hiddenHttpMethodFilter() {
return new OrderedHiddenHttpMethodFilter();
}
@Bean
@ConditionalOnMissingBean(FormContentFilter.class)
@ConditionalOnProperty(prefix = "spring.mvc.formcontent.filter", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.mvc.formcontent.filter", name = "enabled",
matchIfMissing = true)
public OrderedFormContentFilter formContentFilter() {
return new OrderedFormContentFilter();
}
@ -270,7 +272,8 @@ public class WebMvcAutoConfiguration {
@Bean
@ConditionalOnBean(ViewResolver.class)
@ConditionalOnMissingBean(name = "viewResolver", value = ContentNegotiatingViewResolver.class)
@ConditionalOnMissingBean(name = "viewResolver",
value = ContentNegotiatingViewResolver.class)
public ContentNegotiatingViewResolver viewResolver(BeanFactory beanFactory) {
ContentNegotiatingViewResolver resolver = new ContentNegotiatingViewResolver();
resolver.setContentNegotiationManager(
@ -407,7 +410,8 @@ public class WebMvcAutoConfiguration {
}
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(value = "spring.mvc.favicon.enabled", matchIfMissing = true)
@ConditionalOnProperty(value = "spring.mvc.favicon.enabled",
matchIfMissing = true)
public static class FaviconConfiguration implements ResourceLoaderAware {
private final ResourceProperties resourceProperties;

@ -96,14 +96,16 @@ public class ErrorMvcAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean(value = ErrorAttributes.class, search = SearchStrategy.CURRENT)
@ConditionalOnMissingBean(value = ErrorAttributes.class,
search = SearchStrategy.CURRENT)
public DefaultErrorAttributes errorAttributes() {
return new DefaultErrorAttributes(
this.serverProperties.getError().isIncludeException());
}
@Bean
@ConditionalOnMissingBean(value = ErrorController.class, search = SearchStrategy.CURRENT)
@ConditionalOnMissingBean(value = ErrorController.class,
search = SearchStrategy.CURRENT)
public BasicErrorController basicErrorController(ErrorAttributes errorAttributes,
ObjectProvider<ErrorViewResolver> errorViewResolvers) {
return new BasicErrorController(errorAttributes, this.serverProperties.getError(),
@ -145,7 +147,8 @@ public class ErrorMvcAutoConfiguration {
}
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(prefix = "server.error.whitelabel", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "server.error.whitelabel", name = "enabled",
matchIfMissing = true)
@Conditional(ErrorTemplateMissingCondition.class)
protected static class WhitelabelErrorViewConfiguration {

@ -61,7 +61,9 @@ public class AutoConfigurationExcludeFilterTests {
}
@Configuration(proxyBeanMethods = false)
@ComponentScan(basePackageClasses = ExampleConfiguration.class, excludeFilters = @ComponentScan.Filter(type = FilterType.CUSTOM, classes = TestAutoConfigurationExcludeFilter.class))
@ComponentScan(basePackageClasses = ExampleConfiguration.class,
excludeFilters = @ComponentScan.Filter(type = FilterType.CUSTOM,
classes = TestAutoConfigurationExcludeFilter.class))
static class Config {
}

@ -303,12 +303,14 @@ public class AutoConfigurationImportSelectorTests {
}
@EnableAutoConfiguration(excludeName = "org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration")
@EnableAutoConfiguration(
excludeName = "org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration")
private class EnableAutoConfigurationWithClassNameExclusions {
}
@EnableAutoConfiguration(exclude = MustacheAutoConfiguration.class, excludeName = "org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration")
@EnableAutoConfiguration(exclude = MustacheAutoConfiguration.class,
excludeName = "org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration")
private class EnableAutoConfigurationWithClassAndClassNameExclusions {
}
@ -318,17 +320,20 @@ public class AutoConfigurationImportSelectorTests {
}
@EnableAutoConfiguration(excludeName = "org.springframework.boot.autoconfigure.AutoConfigurationImportSelectorTests.TestConfiguration")
@EnableAutoConfiguration(
excludeName = "org.springframework.boot.autoconfigure.AutoConfigurationImportSelectorTests.TestConfiguration")
private class EnableAutoConfigurationWithFaultyClassNameExclude {
}
@EnableAutoConfiguration(excludeName = "org.springframework.boot.autoconfigure.DoesNotExist1")
@EnableAutoConfiguration(
excludeName = "org.springframework.boot.autoconfigure.DoesNotExist1")
private class EnableAutoConfigurationWithAbsentClassNameExclude {
}
@SpringBootApplication(excludeName = "org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration")
@SpringBootApplication(
excludeName = "org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration")
private class SpringBootApplicationWithClassNameExclusions {
}

@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -237,7 +237,8 @@ public class AutoConfigurationSorterTests {
}
@AutoConfigureAfter(name = "org.springframework.boot.autoconfigure.AutoConfigurationSorterTests$AutoConfigureB")
@AutoConfigureAfter(
name = "org.springframework.boot.autoconfigure.AutoConfigurationSorterTests$AutoConfigureB")
public static class AutoConfigureA2 {
}
@ -266,7 +267,8 @@ public class AutoConfigurationSorterTests {
}
@AutoConfigureBefore(name = "org.springframework.boot.autoconfigure.AutoConfigurationSorterTests$AutoConfigureB")
@AutoConfigureBefore(
name = "org.springframework.boot.autoconfigure.AutoConfigurationSorterTests$AutoConfigureB")
public static class AutoConfigureW2 {
}

@ -102,8 +102,8 @@ public class ImportAutoConfigurationTests {
}
@ImportAutoConfiguration(classes = { ConfigD.class,
ConfigB.class }, exclude = ConfigC.class)
@ImportAutoConfiguration(classes = { ConfigD.class, ConfigB.class },
exclude = ConfigC.class)
@MetaImportAutoConfiguration
static class ExcludingConfig {

@ -701,9 +701,9 @@ public class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationT
"spring.cache.cacheNames[0]=foo",
"spring.cache.cacheNames[1]=bar")
.run((context) ->
// see customizer
assertThat(getCacheManager(context, JCacheCacheManager.class).getCacheNames())
.containsOnly("foo", "custom1"));
// see customizer
assertThat(getCacheManager(context, JCacheCacheManager.class)
.getCacheNames()).containsOnly("foo", "custom1"));
}
finally {
Caching.getCachingProvider(cachingProviderClassName).close();

@ -458,7 +458,8 @@ public class ConditionalOnBeanTests {
static class ParameterizedConditionWithValueConfig {
@Bean
@ConditionalOnBean(value = CustomExampleBean.class, parameterizedContainer = TestParameterizedContainer.class)
@ConditionalOnBean(value = CustomExampleBean.class,
parameterizedContainer = TestParameterizedContainer.class)
public CustomExampleBean conditionalCustomExampleBean() {
return new CustomExampleBean();
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save