diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWarDeployment.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWarDeployment.java new file mode 100644 index 00000000000..7afa6cfaf76 --- /dev/null +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWarDeployment.java @@ -0,0 +1,40 @@ +/* + * Copyright 2012-2020 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigure.condition; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.springframework.context.annotation.Conditional; + +/** + * {@link Conditional @Conditional} that matches when the application is a traditional WAR + * deployment. For applications with embedded servers, this condition will return false. + * + * @author Madhura Bhave + * @since 2.3.0 + */ +@Target({ ElementType.TYPE, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Conditional(OnWarDeploymentCondition.class) +public @interface ConditionalOnWarDeployment { + +} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWarDeploymentCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWarDeploymentCondition.java new file mode 100644 index 00000000000..faa9949a1fb --- /dev/null +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWarDeploymentCondition.java @@ -0,0 +1,49 @@ +/* + * Copyright 2012-2020 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigure.condition; + +import javax.servlet.ServletContext; + +import org.springframework.context.annotation.Condition; +import org.springframework.context.annotation.ConditionContext; +import org.springframework.core.io.ResourceLoader; +import org.springframework.core.type.AnnotatedTypeMetadata; +import org.springframework.web.context.WebApplicationContext; + +/** + * {@link Condition} that checks if the application is running as a traditional war + * deployment. + * + * @author Madhura Bhave + */ +class OnWarDeploymentCondition extends SpringBootCondition { + + @Override + public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { + ResourceLoader resourceLoader = context.getResourceLoader(); + if (resourceLoader instanceof WebApplicationContext) { + WebApplicationContext applicationContext = (WebApplicationContext) resourceLoader; + ServletContext servletContext = applicationContext.getServletContext(); + if (servletContext != null) { + return ConditionOutcome.match("Application is deployed as a WAR file."); + } + } + return ConditionOutcome.noMatch(ConditionMessage.forCondition(ConditionalOnWarDeployment.class) + .because("the application is not deployed as a WAR file.")); + } + +} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWarDeploymentTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWarDeploymentTests.java new file mode 100644 index 00000000000..9d5ffb15cc6 --- /dev/null +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWarDeploymentTests.java @@ -0,0 +1,79 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigure.condition; + +import org.junit.jupiter.api.Test; + +import org.springframework.boot.test.context.runner.ApplicationContextRunner; +import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link ConditionalOnWarDeployment @ConditionalOnWarDeployment}. + * + * @author Madhura Bhave + */ +class ConditionalOnWarDeploymentTests { + + @Test + void nonWebApplicationShouldNotMatch() { + ApplicationContextRunner contextRunner = new ApplicationContextRunner(); + contextRunner.withUserConfiguration(TestConfiguration.class) + .run((context) -> assertThat(context).doesNotHaveBean("forWar")); + } + + @Test + void reactiveWebApplicationShouldNotMatch() { + ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner(); + contextRunner.withUserConfiguration(TestConfiguration.class) + .run((context) -> assertThat(context).doesNotHaveBean("forWar")); + } + + @Test + void embeddedServletWebApplicationShouldNotMatch() { + WebApplicationContextRunner contextRunner = new WebApplicationContextRunner( + AnnotationConfigServletWebApplicationContext::new); + contextRunner.withUserConfiguration(TestConfiguration.class) + .run((context) -> assertThat(context).doesNotHaveBean("forWar")); + } + + @Test + void warDeployedServletWebApplicationShouldMatch() { + // sets a mock servletContext before context refresh which is what the + // SpringBootServletInitializer does for WAR deployments. + WebApplicationContextRunner contextRunner = new WebApplicationContextRunner(); + contextRunner.withUserConfiguration(TestConfiguration.class) + .run((context) -> assertThat(context).hasBean("forWar")); + } + + @Configuration(proxyBeanMethods = false) + @ConditionalOnWarDeployment + static class TestConfiguration { + + @Bean + String forWar() { + return "forWar"; + } + + } + +} diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc index 52eecab8c4d..7feca3f260d 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc @@ -7606,6 +7606,9 @@ The `@ConditionalOnWebApplication` and `@ConditionalOnNotWebApplication` annotat A servlet-based web application is any application that uses a Spring `WebApplicationContext`, defines a `session` scope, or has a `ConfigurableWebEnvironment`. A reactive web application is any application that uses a `ReactiveWebApplicationContext`, or has a `ConfigurableReactiveWebEnvironment`. +The `@ConditionalOnWarDeployment` annotation lets configuration be included depending on whether the application is a traditional WAR application that is deployed to a container. +This condition will not match for applications that are run with an embedded server. + [[boot-features-spel-conditions]] diff --git a/spring-boot-tests/spring-boot-deployment-tests/build.gradle b/spring-boot-tests/spring-boot-deployment-tests/build.gradle index f5e564ba0d2..98ddc1ce935 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/build.gradle +++ b/spring-boot-tests/spring-boot-deployment-tests/build.gradle @@ -10,6 +10,7 @@ dependencies { implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) { exclude group: "org.hibernate.validator" } + implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-actuator")) intTestImplementation(enforcedPlatform(project(path: ":spring-boot-project:spring-boot-parent"))) intTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) @@ -20,8 +21,6 @@ dependencies { intTestImplementation("org.springframework:spring-web") providedRuntime(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat")) - - runtimeOnly(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-actuator")) } intTest { diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/DeploymentIntegrationTests.java b/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/DeploymentIntegrationTests.java index f6806dddd28..fa83f6844b9 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/DeploymentIntegrationTests.java +++ b/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/DeploymentIntegrationTests.java @@ -66,6 +66,16 @@ class DeploymentIntegrationTests { }); } + @ParameterizedTest + @MethodSource("deployedApplications") + void conditionalOnWarShouldBeTrue(DeployedApplication application) throws Exception { + application.test((rest) -> { + ResponseEntity response = rest.getForEntity("/actuator/war", String.class); + assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); + assertThat(response.getBody()).isEqualTo("{\"hello\":\"world\"}"); + }); + } + static List deployedApplications() { return Arrays.asList(new DeployedApplication("open-liberty:19.0.0.9-webProfile8", "/config/dropins", 9080), new DeployedApplication("tomcat:9.0.29-jdk8-openjdk", "/usr/local/tomcat/webapps", 8080), diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/DeploymentTestApplication.java b/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/app/DeploymentTestApplication.java similarity index 97% rename from spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/DeploymentTestApplication.java rename to spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/app/DeploymentTestApplication.java index 521c762a292..ccef40e62eb 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/DeploymentTestApplication.java +++ b/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/app/DeploymentTestApplication.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package sample; +package sample.app; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/SampleController.java b/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/app/SampleController.java similarity index 97% rename from spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/SampleController.java rename to spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/app/SampleController.java index 64cb24a3374..98233a68c37 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/SampleController.java +++ b/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/app/SampleController.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package sample; +package sample.app; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/autoconfig/ExampleAutoConfiguration.java b/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/autoconfig/ExampleAutoConfiguration.java new file mode 100644 index 00000000000..925cafd6d30 --- /dev/null +++ b/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/autoconfig/ExampleAutoConfiguration.java @@ -0,0 +1,44 @@ +/* + * Copyright 2012-2020 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sample.autoconfig; + +import org.springframework.boot.actuate.endpoint.annotation.Endpoint; +import org.springframework.boot.actuate.endpoint.annotation.ReadOperation; +import org.springframework.boot.autoconfigure.condition.ConditionalOnWarDeployment; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@ConditionalOnWarDeployment +@Configuration +public class ExampleAutoConfiguration { + + @Bean + public TestEndpoint testEndpoint() { + return new TestEndpoint(); + } + + @Endpoint(id = "war") + static class TestEndpoint { + + @ReadOperation + String hello() { + return "{\"hello\":\"world\"}"; + } + + } + +} diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/main/resources/META-INF/spring.factories b/spring-boot-tests/spring-boot-deployment-tests/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000000..5335e6cae91 --- /dev/null +++ b/spring-boot-tests/spring-boot-deployment-tests/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +sample.autoconfig.ExampleAutoConfiguration \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/main/resources/application.yml b/spring-boot-tests/spring-boot-deployment-tests/src/main/resources/application.yml new file mode 100644 index 00000000000..8099f86ce86 --- /dev/null +++ b/spring-boot-tests/spring-boot-deployment-tests/src/main/resources/application.yml @@ -0,0 +1 @@ +management.endpoints.web.exposure.include: '*' diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/build.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/build.gradle index 870db209ede..295e91c98e8 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/build.gradle +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/build.gradle @@ -11,6 +11,7 @@ configurations { dependencies { testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) + testImplementation(project(":spring-boot-project:spring-boot-actuator-autoconfigure")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation("com.samskivert:jmustache") testImplementation("jakarta.servlet:jakarta.servlet-api") @@ -25,6 +26,7 @@ dependencies { testRepository(project(path: ":spring-boot-project:spring-boot-dependencies", configuration: "mavenRepository")) testRepository(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-maven-plugin", configuration: "mavenRepository")) testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter", configuration: "mavenRepository")) + testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-actuator", configuration: "mavenRepository")) testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-jetty", configuration: "mavenRepository")) testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-parent", configuration: "mavenRepository")) testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat", configuration: "mavenRepository")) diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/com/autoconfig/ExampleAutoConfiguration.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/com/autoconfig/ExampleAutoConfiguration.java new file mode 100644 index 00000000000..c0d5650311e --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/com/autoconfig/ExampleAutoConfiguration.java @@ -0,0 +1,44 @@ +/* + * Copyright 2012-2020 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.autoconfig; + +import org.springframework.boot.actuate.endpoint.annotation.Endpoint; +import org.springframework.boot.actuate.endpoint.annotation.ReadOperation; +import org.springframework.boot.autoconfigure.condition.ConditionalOnWarDeployment; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@ConditionalOnWarDeployment +@Configuration +public class ExampleAutoConfiguration { + + @Bean + public TestEndpoint testEndpoint() { + return new TestEndpoint(); + } + + @Endpoint(id = "war") + static class TestEndpoint { + + @ReadOperation + String hello() { + return "{\"hello\":\"world\"}"; + } + + } + +} diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java index 123c79eb8d9..b3e87c5c281 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java @@ -146,6 +146,23 @@ class ApplicationBuilder { srcMainWebapp.mkdirs(); FileCopyUtils.copy("webapp resource", new FileWriter(new File(srcMainWebapp, "webapp-resource.txt"))); } + copyAutoConfigurationFiles(appFolder); + return; + } + + private void copyAutoConfigurationFiles(File appFolder) throws IOException { + File autoConfigPackage = new File(appFolder, "src/main/java/com/autoconfig"); + autoConfigPackage.mkdirs(); + FileCopyUtils.copy(new File("src/test/java/com/autoconfig/ExampleAutoConfiguration.java"), + new File(autoConfigPackage, "ExampleAutoConfiguration.java")); + File srcMainResources = new File(appFolder, "src/main/resources"); + srcMainResources.mkdirs(); + File metaInf = new File(srcMainResources, "META-INF"); + metaInf.mkdirs(); + FileCopyUtils.copy(new File("src/test/resources/META-INF/spring.factories"), + new File(metaInf, "spring.factories")); + FileCopyUtils.copy(new File("src/test/resources/application.yml"), + new File(srcMainResources, "application.yml")); } private void packageApplication(File appFolder, File settingsXml) throws MavenInvocationException { diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerJarPackagingIntegrationTests.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerJarPackagingIntegrationTests.java index b87cdbd4739..0c5d9ab43f1 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerJarPackagingIntegrationTests.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerJarPackagingIntegrationTests.java @@ -79,4 +79,10 @@ class EmbeddedServletContainerJarPackagingIntegrationTests { assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); } + @TestTemplate + void conditionalOnWarDeploymentBeanIsNotAvailableForEmbeddedServer(RestTemplate rest) { + ResponseEntity entity = rest.getForEntity("/actuator/war", String.class); + assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); + } + } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerWarPackagingIntegrationTests.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerWarPackagingIntegrationTests.java index 1ed90bb217b..2cb7ab45017 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerWarPackagingIntegrationTests.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerWarPackagingIntegrationTests.java @@ -102,6 +102,12 @@ class EmbeddedServletContainerWarPackagingIntegrationTests { .noneMatch((resourcePath) -> resourcePath.startsWith("/org/springframework/boot/loader")); } + @TestTemplate + void conditionalOnWarDeploymentBeanIsNotAvailableForEmbeddedServer(RestTemplate rest) { + ResponseEntity entity = rest.getForEntity("/actuator/war", String.class); + assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); + } + private List readLines(String input) { if (input == null) { return Collections.emptyList(); diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/META-INF/spring.factories b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/META-INF/spring.factories new file mode 100644 index 00000000000..3e7307341f7 --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.autoconfig.ExampleAutoConfiguration \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/application.yml b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/application.yml new file mode 100644 index 00000000000..8099f86ce86 --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/application.yml @@ -0,0 +1 @@ +management.endpoints.web.exposure.include: '*' diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/pom-template.xml b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/pom-template.xml index 3b855f17333..546c9cc0653 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/pom-template.xml +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/pom-template.xml @@ -18,7 +18,11 @@ org.springframework.boot - spring-boot-starter + spring-boot-starter-json + + + org.springframework.boot + spring-boot-starter-actuator org.springframework.boot @@ -26,7 +30,7 @@ org.springframework - spring-web + spring-webmvc javax.servlet