Break cycle in spring-boot-data-* modules
There was a cycle in the spring-boot-data-* modules. SpringDataWebAutoConfiguration (which sits at the spring-data-commons level) referenced RepositoryRestMvcAutoConfiguration (which sits at the spring-data-rest level). This dependency's expressed in the wrong direction as data-rest depends on data-commons. The resulting cycle was not noticable as it was expressed through a String afterName attribute on `@AutoConfiguration`. spring-boot-data-commons was also using spring-boot-data-jpa for its tests, which also results in an inverted dependency relationship. This commit reworks things so that all of the spring-boot-data-* modules depend upon spring-boot-data-commons, mirroring the dependency relationship in Spring Data. The integration tests in spring-boot-data-commons have been reworked to use Spring Data directly, avoiding the need for a circular from spring-boot-data-commons to another spring-boot-data-* module.
This commit is contained in:
committed by
Phillip Webb
parent
e0a6237b8a
commit
9ee79c1bbc
@@ -9,8 +9,9 @@ plugins {
|
||||
description = "Spring Boot Data REST"
|
||||
|
||||
dependencies {
|
||||
api(project(":spring-boot-project:spring-boot-webmvc"))
|
||||
api(project(":spring-boot-project:spring-boot-data-commons"))
|
||||
api(project(":spring-boot-project:spring-boot-jackson"))
|
||||
api(project(":spring-boot-project:spring-boot-webmvc"))
|
||||
api("org.springframework.data:spring-data-rest-webmvc")
|
||||
|
||||
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.data.web.autoconfigure.SpringDataWebAutoConfiguration;
|
||||
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Import;
|
||||
@@ -46,7 +47,7 @@ import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
* @author Andy Wilkinson
|
||||
* @since 4.0.0
|
||||
*/
|
||||
@AutoConfiguration(after = JacksonAutoConfiguration.class)
|
||||
@AutoConfiguration(before = SpringDataWebAutoConfiguration.class, after = JacksonAutoConfiguration.class)
|
||||
@ConditionalOnWebApplication(type = Type.SERVLET)
|
||||
@ConditionalOnMissingBean(RepositoryRestMvcConfiguration.class)
|
||||
@ConditionalOnClass(RepositoryRestMvcConfiguration.class)
|
||||
|
||||
Reference in New Issue
Block a user