Skip to content

Commit 20164d8

Browse files
committed
Create spring-boot-hateoas module
1 parent 30b5e29 commit 20164d8

File tree

17 files changed

+64
-41
lines changed

17 files changed

+64
-41
lines changed

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ include "spring-boot-project:spring-boot-freemarker"
6565
include "spring-boot-project:spring-boot-groovy-templates"
6666
include "spring-boot-project:spring-boot-gson"
6767
include "spring-boot-project:spring-boot-h2"
68+
include "spring-boot-project:spring-boot-hateoas"
6869
include "spring-boot-project:spring-boot-hazelcast"
6970
include "spring-boot-project:spring-boot-integration"
7071
include "spring-boot-project:spring-boot-jackson"

spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ dependencies {
156156
optional("org.springframework.session:spring-session-core")
157157
optional("redis.clients:jedis")
158158

159+
testImplementation(project(":spring-boot-project:spring-boot-hateoas"))
159160
testImplementation(project(":spring-boot-project:spring-boot-test"))
160161
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
161162
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,11 +32,11 @@
3232
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
3333
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
3434
import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration;
35-
import org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration;
3635
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration;
3736
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
3837
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
3938
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
39+
import org.springframework.boot.hateoas.autoconfigure.HypermediaAutoConfiguration;
4040
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
4141
import org.springframework.boot.test.util.TestPropertyValues;
4242
import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext;

spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ org.springframework.boot.autoconfigure.graphql.rsocket.RSocketGraphQlClientAutoC
3535
org.springframework.boot.autoconfigure.graphql.security.GraphQlWebFluxSecurityAutoConfiguration
3636
org.springframework.boot.autoconfigure.graphql.security.GraphQlWebMvcSecurityAutoConfiguration
3737
org.springframework.boot.autoconfigure.graphql.servlet.GraphQlWebMvcAutoConfiguration
38-
org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration
3938
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
4039
org.springframework.boot.autoconfigure.http.client.HttpClientAutoConfiguration
4140
org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,6 +2008,7 @@ bom {
20082008
"spring-boot-groovy-templates",
20092009
"spring-boot-gson",
20102010
"spring-boot-h2",
2011+
"spring-boot-hateoas",
20112012
"spring-boot-hazelcast",
20122013
"spring-boot-integration",
20132014
"spring-boot-jackson",

spring-boot-project/spring-boot-docs/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ dependencies {
7171
autoConfiguration(project(path: ":spring-boot-project:spring-boot-freemarker", configuration: "autoConfigurationMetadata"))
7272
autoConfiguration(project(path: ":spring-boot-project:spring-boot-gson", configuration: "autoConfigurationMetadata"))
7373
autoConfiguration(project(path: ":spring-boot-project:spring-boot-h2", configuration: "autoConfigurationMetadata"))
74+
autoConfiguration(project(path: ":spring-boot-project:spring-boot-hateoas", configuration: "autoConfigurationMetadata"))
7475
autoConfiguration(project(path: ":spring-boot-project:spring-boot-hazelcast", configuration: "autoConfigurationMetadata"))
7576
autoConfiguration(project(path: ":spring-boot-project:spring-boot-integration", configuration: "autoConfigurationMetadata"))
7677
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "autoConfigurationMetadata"))
@@ -121,6 +122,7 @@ dependencies {
121122
configurationProperties(project(path: ":spring-boot-project:spring-boot-freemarker", configuration: "configurationPropertiesMetadata"))
122123
configurationProperties(project(path: ":spring-boot-project:spring-boot-gson", configuration: "configurationPropertiesMetadata"))
123124
configurationProperties(project(path: ":spring-boot-project:spring-boot-h2", configuration: "configurationPropertiesMetadata"))
125+
configurationProperties(project(path: ":spring-boot-project:spring-boot-hateoas", configuration: "configurationPropertiesMetadata"))
124126
configurationProperties(project(path: ":spring-boot-project:spring-boot-hazelcast", configuration: "configurationPropertiesMetadata"))
125127
configurationProperties(project(path: ":spring-boot-project:spring-boot-integration", configuration: "configurationPropertiesMetadata"))
126128
configurationProperties(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "configurationPropertiesMetadata"))
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
plugins {
2+
id "java-library"
3+
id "org.springframework.boot.auto-configuration"
4+
id "org.springframework.boot.configuration-properties"
5+
id "org.springframework.boot.deployed"
6+
id "org.springframework.boot.optional-dependencies"
7+
}
8+
9+
description = "Spring Boot Hateoas"
10+
11+
dependencies {
12+
api(project(":spring-boot-project:spring-boot"))
13+
api("org.springframework.hateoas:spring-hateoas")
14+
15+
implementation("com.fasterxml.jackson.core:jackson-databind")
16+
implementation("org.springframework:spring-webmvc")
17+
18+
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
19+
20+
testImplementation(project(":spring-boot-project:spring-boot-test"))
21+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
22+
testImplementation("jakarta.servlet:jakarta.servlet-api")
23+
24+
testRuntimeOnly("ch.qos.logback:logback-classic")
25+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.hateoas;
17+
package org.springframework.boot.hateoas.autoconfigure;
1818

1919
import org.springframework.boot.context.properties.ConfigurationProperties;
2020

@@ -23,7 +23,7 @@
2323
*
2424
* @author Phillip Webb
2525
* @author Andy Wilkinson
26-
* @since 1.2.1
26+
* @since 4.0.0
2727
*/
2828
@ConfigurationProperties("spring.hateoas")
2929
public class HateoasProperties {
Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.hateoas;
17+
package org.springframework.boot.hateoas.autoconfigure;
1818

1919
import com.fasterxml.jackson.databind.ObjectMapper;
2020

@@ -24,9 +24,6 @@
2424
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2525
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
27-
import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration;
28-
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration;
29-
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
3027
import org.springframework.boot.context.properties.EnableConfigurationProperties;
3128
import org.springframework.context.annotation.Bean;
3229
import org.springframework.context.annotation.Configuration;
@@ -47,30 +44,26 @@
4744
* @author Roy Clarkson
4845
* @author Oliver Gierke
4946
* @author Andy Wilkinson
50-
* @since 1.1.0
47+
* @since 4.0.0
5148
*/
52-
@AutoConfiguration(
53-
after = { WebMvcAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class,
54-
RepositoryRestMvcAutoConfiguration.class },
55-
afterName = "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration")
56-
@ConditionalOnClass({ EntityModel.class, RequestMapping.class, RequestMappingHandlerAdapter.class, Plugin.class })
49+
@AutoConfiguration
50+
@ConditionalOnClass({ EntityModel.class, RequestMapping.class, RequestMappingHandlerAdapter.class, Plugin.class,
51+
ObjectMapper.class })
5752
@ConditionalOnWebApplication
5853
@EnableConfigurationProperties(HateoasProperties.class)
5954
public class HypermediaAutoConfiguration {
6055

6156
@Bean
6257
@ConditionalOnMissingBean
63-
@ConditionalOnClass(name = "com.fasterxml.jackson.databind.ObjectMapper")
6458
@ConditionalOnBooleanProperty(name = "spring.hateoas.use-hal-as-default-json-media-type", matchIfMissing = true)
6559
HalConfiguration applicationJsonHalConfiguration() {
6660
return new HalConfiguration().withMediaType(MediaType.APPLICATION_JSON);
6761
}
6862

6963
@Configuration(proxyBeanMethods = false)
7064
@ConditionalOnMissingBean(LinkDiscoverers.class)
71-
@ConditionalOnClass(ObjectMapper.class)
7265
@EnableHypermediaSupport(type = HypermediaType.HAL)
73-
protected static class HypermediaConfiguration {
66+
static class HypermediaConfiguration {
7467

7568
}
7669

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,4 +17,4 @@
1717
/**
1818
* Auto-configuration for Spring HATEOAS.
1919
*/
20-
package org.springframework.boot.autoconfigure.hateoas;
20+
package org.springframework.boot.hateoas.autoconfigure;

0 commit comments

Comments
 (0)