From 31c9d3c17adc487e826b85402605f010dd44ce00 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 26 Mar 2025 20:33:22 +0000 Subject: [PATCH] Create spring-boot-hateoas module --- settings.gradle | 1 + .../build.gradle | 1 + .../WebMvcEndpointIntegrationTests.java | 4 +-- ...ot.autoconfigure.AutoConfiguration.imports | 1 - .../spring-boot-dependencies/build.gradle | 1 + .../spring-boot-docs/build.gradle | 2 ++ .../spring-boot-hateoas/build.gradle | 25 +++++++++++++++++++ .../autoconfigure}/HateoasProperties.java | 4 +-- .../HypermediaAutoConfiguration.java | 19 +++++--------- .../hateoas/autoconfigure}/package-info.java | 4 +-- ...itional-spring-configuration-metadata.json | 4 +++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../HypermediaAutoConfigurationTests.java | 12 ++++----- ...aAutoConfigurationWithoutJacksonTests.java | 9 +++---- .../spring-boot-starter-hateoas/build.gradle | 2 +- .../build.gradle | 1 + ...re.web.servlet.AutoConfigureWebMvc.imports | 12 ++++----- 17 files changed, 63 insertions(+), 40 deletions(-) create mode 100644 spring-boot-project/spring-boot-hateoas/build.gradle rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hateoas => spring-boot-hateoas/src/main/java/org/springframework/boot/hateoas/autoconfigure}/HateoasProperties.java (94%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hateoas => spring-boot-hateoas/src/main/java/org/springframework/boot/hateoas/autoconfigure}/HypermediaAutoConfiguration.java (77%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hateoas => spring-boot-hateoas/src/main/java/org/springframework/boot/hateoas/autoconfigure}/package-info.java (84%) create mode 100644 spring-boot-project/spring-boot-hateoas/src/main/resources/META-INF/additional-spring-configuration-metadata.json create mode 100644 spring-boot-project/spring-boot-hateoas/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hateoas => spring-boot-hateoas/src/test/java/org/springframework/boot/hateoas/autoconfigure}/HypermediaAutoConfigurationTests.java (90%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hateoas => spring-boot-hateoas/src/test/java/org/springframework/boot/hateoas/autoconfigure}/HypermediaAutoConfigurationWithoutJacksonTests.java (77%) diff --git a/settings.gradle b/settings.gradle index 4e9674ab97..53de2a56b8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -65,6 +65,7 @@ include "spring-boot-project:spring-boot-freemarker" include "spring-boot-project:spring-boot-groovy-templates" include "spring-boot-project:spring-boot-gson" include "spring-boot-project:spring-boot-h2console" +include "spring-boot-project:spring-boot-hateoas" include "spring-boot-project:spring-boot-hazelcast" include "spring-boot-project:spring-boot-integration" include "spring-boot-project:spring-boot-jackson" diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index 8fca048e62..0c19a228b9 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -147,6 +147,7 @@ dependencies { optional("org.springframework.session:spring-session-core") optional("redis.clients:jedis") + testImplementation(project(":spring-boot-project:spring-boot-hateoas")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java index d1a8bef36a..c31cfc1bc6 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -32,11 +32,11 @@ import org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandl import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration; -import org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration; import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration; import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; +import org.springframework.boot.hateoas.autoconfigure.HypermediaAutoConfiguration; import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index a7756a1ed8..96e66e8b54 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -35,7 +35,6 @@ org.springframework.boot.autoconfigure.graphql.rsocket.RSocketGraphQlClientAutoC org.springframework.boot.autoconfigure.graphql.security.GraphQlWebFluxSecurityAutoConfiguration org.springframework.boot.autoconfigure.graphql.security.GraphQlWebMvcSecurityAutoConfiguration org.springframework.boot.autoconfigure.graphql.servlet.GraphQlWebMvcAutoConfiguration -org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration org.springframework.boot.autoconfigure.http.client.HttpClientAutoConfiguration org.springframework.boot.autoconfigure.http.client.service.HttpServiceClientAutoConfiguration diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 2cd7373263..22d46d7314 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -1998,6 +1998,7 @@ bom { "spring-boot-groovy-templates", "spring-boot-gson", "spring-boot-h2console", + "spring-boot-hateoas", "spring-boot-hazelcast", "spring-boot-integration", "spring-boot-jackson", diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index fbb6485956..c24db458ce 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -77,6 +77,7 @@ dependencies { autoConfiguration(project(path: ":spring-boot-project:spring-boot-freemarker", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-gson", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-h2console", configuration: "autoConfigurationMetadata")) + autoConfiguration(project(path: ":spring-boot-project:spring-boot-hateoas", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-hazelcast", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-integration", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "autoConfigurationMetadata")) @@ -127,6 +128,7 @@ dependencies { configurationProperties(project(path: ":spring-boot-project:spring-boot-freemarker", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-gson", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-h2console", configuration: "configurationPropertiesMetadata")) + configurationProperties(project(path: ":spring-boot-project:spring-boot-hateoas", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-hazelcast", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-integration", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "configurationPropertiesMetadata")) diff --git a/spring-boot-project/spring-boot-hateoas/build.gradle b/spring-boot-project/spring-boot-hateoas/build.gradle new file mode 100644 index 0000000000..dedead9030 --- /dev/null +++ b/spring-boot-project/spring-boot-hateoas/build.gradle @@ -0,0 +1,25 @@ +plugins { + id "java-library" + id "org.springframework.boot.auto-configuration" + id "org.springframework.boot.configuration-properties" + id "org.springframework.boot.deployed" + id "org.springframework.boot.optional-dependencies" +} + +description = "Spring Boot Hateoas" + +dependencies { + api(project(":spring-boot-project:spring-boot")) + api("org.springframework.hateoas:spring-hateoas") + + implementation("com.fasterxml.jackson.core:jackson-databind") + implementation("org.springframework:spring-webmvc") + + optional(project(":spring-boot-project:spring-boot-autoconfigure")) + + testImplementation(project(":spring-boot-project:spring-boot-test")) + testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + testImplementation("jakarta.servlet:jakarta.servlet-api") + + testRuntimeOnly("ch.qos.logback:logback-classic") +} diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hateoas/HateoasProperties.java b/spring-boot-project/spring-boot-hateoas/src/main/java/org/springframework/boot/hateoas/autoconfigure/HateoasProperties.java similarity index 94% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hateoas/HateoasProperties.java rename to spring-boot-project/spring-boot-hateoas/src/main/java/org/springframework/boot/hateoas/autoconfigure/HateoasProperties.java index d131564ed6..60abd969fe 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hateoas/HateoasProperties.java +++ b/spring-boot-project/spring-boot-hateoas/src/main/java/org/springframework/boot/hateoas/autoconfigure/HateoasProperties.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hateoas; +package org.springframework.boot.hateoas.autoconfigure; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -23,7 +23,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * * @author Phillip Webb * @author Andy Wilkinson - * @since 1.2.1 + * @since 4.0.0 */ @ConfigurationProperties("spring.hateoas") public class HateoasProperties { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfiguration.java b/spring-boot-project/spring-boot-hateoas/src/main/java/org/springframework/boot/hateoas/autoconfigure/HypermediaAutoConfiguration.java similarity index 77% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfiguration.java rename to spring-boot-project/spring-boot-hateoas/src/main/java/org/springframework/boot/hateoas/autoconfigure/HypermediaAutoConfiguration.java index 0027128acb..84b277d95d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfiguration.java +++ b/spring-boot-project/spring-boot-hateoas/src/main/java/org/springframework/boot/hateoas/autoconfigure/HypermediaAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hateoas; +package org.springframework.boot.hateoas.autoconfigure; import com.fasterxml.jackson.databind.ObjectMapper; @@ -24,9 +24,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProp import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration; -import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration; -import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -47,20 +44,17 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl * @author Roy Clarkson * @author Oliver Gierke * @author Andy Wilkinson - * @since 1.1.0 + * @since 4.0.0 */ -@AutoConfiguration( - after = { WebMvcAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class, - RepositoryRestMvcAutoConfiguration.class }, - afterName = "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration") -@ConditionalOnClass({ EntityModel.class, RequestMapping.class, RequestMappingHandlerAdapter.class, Plugin.class }) +@AutoConfiguration +@ConditionalOnClass({ EntityModel.class, RequestMapping.class, RequestMappingHandlerAdapter.class, Plugin.class, + ObjectMapper.class }) @ConditionalOnWebApplication @EnableConfigurationProperties(HateoasProperties.class) public class HypermediaAutoConfiguration { @Bean @ConditionalOnMissingBean - @ConditionalOnClass(name = "com.fasterxml.jackson.databind.ObjectMapper") @ConditionalOnBooleanProperty(name = "spring.hateoas.use-hal-as-default-json-media-type", matchIfMissing = true) HalConfiguration applicationJsonHalConfiguration() { return new HalConfiguration().withMediaType(MediaType.APPLICATION_JSON); @@ -68,9 +62,8 @@ public class HypermediaAutoConfiguration { @Configuration(proxyBeanMethods = false) @ConditionalOnMissingBean(LinkDiscoverers.class) - @ConditionalOnClass(ObjectMapper.class) @EnableHypermediaSupport(type = HypermediaType.HAL) - protected static class HypermediaConfiguration { + static class HypermediaConfiguration { } diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hateoas/package-info.java b/spring-boot-project/spring-boot-hateoas/src/main/java/org/springframework/boot/hateoas/autoconfigure/package-info.java similarity index 84% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hateoas/package-info.java rename to spring-boot-project/spring-boot-hateoas/src/main/java/org/springframework/boot/hateoas/autoconfigure/package-info.java index 448e6f4e09..f915282aa5 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hateoas/package-info.java +++ b/spring-boot-project/spring-boot-hateoas/src/main/java/org/springframework/boot/hateoas/autoconfigure/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -17,4 +17,4 @@ /** * Auto-configuration for Spring HATEOAS. */ -package org.springframework.boot.autoconfigure.hateoas; +package org.springframework.boot.hateoas.autoconfigure; diff --git a/spring-boot-project/spring-boot-hateoas/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-hateoas/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 0000000000..671fd2520c --- /dev/null +++ b/spring-boot-project/spring-boot-hateoas/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,4 @@ +{ + "groups": [], + "properties": [] +} diff --git a/spring-boot-project/spring-boot-hateoas/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-hateoas/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000000..71e83fadd8 --- /dev/null +++ b/spring-boot-project/spring-boot-hateoas/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.springframework.boot.hateoas.autoconfigure.HypermediaAutoConfiguration diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfigurationTests.java b/spring-boot-project/spring-boot-hateoas/src/test/java/org/springframework/boot/hateoas/autoconfigure/HypermediaAutoConfigurationTests.java similarity index 90% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfigurationTests.java rename to spring-boot-project/spring-boot-hateoas/src/test/java/org/springframework/boot/hateoas/autoconfigure/HypermediaAutoConfigurationTests.java index d741b8487a..a38b9dfc14 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-hateoas/src/test/java/org/springframework/boot/hateoas/autoconfigure/HypermediaAutoConfigurationTests.java @@ -14,17 +14,14 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hateoas; +package org.springframework.boot.hateoas.autoconfigure; import java.util.Optional; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration.HypermediaConfiguration; -import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration; -import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; -import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; +import org.springframework.boot.hateoas.autoconfigure.HypermediaAutoConfiguration.HypermediaConfiguration; import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.context.annotation.Configuration; @@ -38,6 +35,7 @@ import org.springframework.hateoas.mediatype.hal.HalLinkDiscoverer; import org.springframework.hateoas.server.EntityLinks; import org.springframework.http.MediaType; import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter; import static org.assertj.core.api.Assertions.assertThat; @@ -117,8 +115,8 @@ class HypermediaAutoConfigurationTests { }); } - @ImportAutoConfiguration({ HttpMessageConvertersAutoConfiguration.class, WebMvcAutoConfiguration.class, - JacksonAutoConfiguration.class, HypermediaAutoConfiguration.class }) + @EnableWebMvc + @ImportAutoConfiguration(HypermediaAutoConfiguration.class) static class BaseConfig { } diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfigurationWithoutJacksonTests.java b/spring-boot-project/spring-boot-hateoas/src/test/java/org/springframework/boot/hateoas/autoconfigure/HypermediaAutoConfigurationWithoutJacksonTests.java similarity index 77% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfigurationWithoutJacksonTests.java rename to spring-boot-project/spring-boot-hateoas/src/test/java/org/springframework/boot/hateoas/autoconfigure/HypermediaAutoConfigurationWithoutJacksonTests.java index 63782cd138..5ed30d82a4 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfigurationWithoutJacksonTests.java +++ b/spring-boot-project/spring-boot-hateoas/src/test/java/org/springframework/boot/hateoas/autoconfigure/HypermediaAutoConfigurationWithoutJacksonTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,13 +14,11 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hateoas; +package org.springframework.boot.hateoas.autoconfigure; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration; -import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; import org.springframework.boot.testsupport.classpath.ClassPathExclusions; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; import org.springframework.mock.web.MockServletContext; @@ -43,8 +41,7 @@ class HypermediaAutoConfigurationWithoutJacksonTests { this.context.refresh(); } - @ImportAutoConfiguration({ HttpMessageConvertersAutoConfiguration.class, WebMvcAutoConfiguration.class, - HypermediaAutoConfiguration.class }) + @ImportAutoConfiguration(HypermediaAutoConfiguration.class) static class BaseConfig { } diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-hateoas/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-hateoas/build.gradle index a4d3560b1b..4b8a7019c3 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-hateoas/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-hateoas/build.gradle @@ -5,6 +5,6 @@ plugins { description = "Starter for building hypermedia-based RESTful web application with Spring MVC and Spring HATEOAS" dependencies { + api(project(":spring-boot-project:spring-boot-hateoas")) api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) - api("org.springframework.hateoas:spring-hateoas") } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle index e7463c84b3..485805aa85 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle @@ -44,6 +44,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-elasticsearch")) optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-groovy-templates")) + optional(project(":spring-boot-project:spring-boot-hateoas")) optional(project(":spring-boot-project:spring-boot-jackson")) optional(project(":spring-boot-project:spring-boot-jdbc")) optional(project(":spring-boot-project:spring-boot-jooq")) diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc.imports b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc.imports index 266e3acd29..f2ffb5589e 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc.imports +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc.imports @@ -1,14 +1,14 @@ # AutoConfigureWebMvc auto-configuration imports +optional:org.springframework.boot.freemarker.autoconfigure.FreeMarkerAutoConfiguration +optional:org.springframework.boot.groovy.template.autoconfigure.GroovyTemplateAutoConfiguration +optional:org.springframework.boot.hateoas.autoconfigure.HypermediaAutoConfiguration +optional:org.springframework.boot.mustache.autoconfigure.MustacheAutoConfiguration +optional:org.springframework.boot.thymeleaf.autoconfigure.ThymeleafAutoConfiguration +optional:org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration -optional:org.springframework.boot.freemarker.autoconfigure.FreeMarkerAutoConfiguration -org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration -optional:org.springframework.boot.mustache.autoconfigure.MustacheAutoConfiguration org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration -optional:org.springframework.boot.thymeleaf.autoconfigure.ThymeleafAutoConfiguration -optional:org.springframework.boot.groovy.template.autoconfigure.GroovyTemplateAutoConfiguration -optional:org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration