Browse Source

Create spring-boot-data-web module

See gh-46131
pull/46230/head
Stéphane Nicoll 9 months ago committed by Andy Wilkinson
parent
commit
a4f9f35255
  1. 1
      settings.gradle
  2. 1
      spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  3. 44
      spring-boot-project/spring-boot-data-web/build.gradle
  4. 2
      spring-boot-project/spring-boot-data-web/src/main/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebAutoConfiguration.java
  5. 2
      spring-boot-project/spring-boot-data-web/src/main/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebProperties.java
  6. 0
      spring-boot-project/spring-boot-data-web/src/main/java/org/springframework/boot/autoconfigure/data/web/package-info.java
  7. 4
      spring-boot-project/spring-boot-data-web/src/main/resources/META-INF/additional-spring-configuration-metadata.json
  8. 1
      spring-boot-project/spring-boot-data-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  9. 6
      spring-boot-project/spring-boot-data-web/src/test/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebAutoConfigurationJpaTests.java
  10. 0
      spring-boot-project/spring-boot-data-web/src/test/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebAutoConfigurationTests.java
  11. 2
      spring-boot-project/spring-boot-data-web/src/test/java/org/springframework/boot/autoconfigure/data/web/domain/city/City.java
  12. 15
      spring-boot-project/spring-boot-data-web/src/test/java/org/springframework/boot/autoconfigure/data/web/domain/city/CityRepository.java
  13. 1
      spring-boot-project/spring-boot-dependencies/build.gradle
  14. 2
      spring-boot-project/spring-boot-docs/build.gradle
  15. 1
      spring-boot-project/spring-boot-starters/spring-boot-starter-data-rest/build.gradle
  16. 1
      spring-boot-project/spring-boot-test-autoconfigure/build.gradle
  17. 2
      spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc.imports

1
settings.gradle

@ -79,6 +79,7 @@ include "spring-boot-project:spring-boot-data-neo4j"
include "spring-boot-project:spring-boot-data-r2dbc" include "spring-boot-project:spring-boot-data-r2dbc"
include "spring-boot-project:spring-boot-data-redis" include "spring-boot-project:spring-boot-data-redis"
include "spring-boot-project:spring-boot-data-rest" include "spring-boot-project:spring-boot-data-rest"
include "spring-boot-project:spring-boot-data-web"
include "spring-boot-project:spring-boot-dependencies" include "spring-boot-project:spring-boot-dependencies"
include "spring-boot-project:spring-boot-devtools" include "spring-boot-project:spring-boot-devtools"
include "spring-boot-project:spring-boot-docker-compose" include "spring-boot-project:spring-boot-docker-compose"

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

@ -1,7 +1,6 @@
org.springframework.boot.autoconfigure.aop.AopAutoConfiguration org.springframework.boot.autoconfigure.aop.AopAutoConfiguration
org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration
org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration
org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration
org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration
org.springframework.boot.autoconfigure.graphql.data.GraphQlReactiveQueryByExampleAutoConfiguration org.springframework.boot.autoconfigure.graphql.data.GraphQlReactiveQueryByExampleAutoConfiguration
org.springframework.boot.autoconfigure.graphql.data.GraphQlReactiveQuerydslAutoConfiguration org.springframework.boot.autoconfigure.graphql.data.GraphQlReactiveQuerydslAutoConfiguration

44
spring-boot-project/spring-boot-data-web/build.gradle

@ -0,0 +1,44 @@
/*
* Copyright 2012-present 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.
*/
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 New Project"
dependencies {
api(project(":spring-boot-project:spring-boot-webmvc"))
api("org.springframework.data:spring-data-commons")
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
optional(project(":spring-boot-project:spring-boot-data-rest"))
testImplementation(project(":spring-boot-project:spring-boot-data-jpa"))
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-autoconfigure")))
testRuntimeOnly("ch.qos.logback:logback-classic")
testRuntimeOnly("com.h2database:h2")
testRuntimeOnly("com.zaxxer:HikariCP")
testRuntimeOnly("jakarta.servlet:jakarta.servlet-api")
}

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebAutoConfiguration.java → spring-boot-project/spring-boot-data-web/src/main/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebAutoConfiguration.java

@ -43,7 +43,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Vedran Pavic * @author Vedran Pavic
* @author Yanming Zhou * @author Yanming Zhou
* @since 1.2.0 * @since 4.0.0
*/ */
@AutoConfiguration(afterName = "org.springframework.boot.data.rest.autoconfigure.RepositoryRestMvcAutoConfiguration") @AutoConfiguration(afterName = "org.springframework.boot.data.rest.autoconfigure.RepositoryRestMvcAutoConfiguration")
@EnableSpringDataWebSupport @EnableSpringDataWebSupport

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebProperties.java → spring-boot-project/spring-boot-data-web/src/main/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebProperties.java

@ -24,7 +24,7 @@ import org.springframework.data.web.config.EnableSpringDataWebSupport.PageSerial
* *
* @author Vedran Pavic * @author Vedran Pavic
* @author Yanming Zhou * @author Yanming Zhou
* @since 2.0.0 * @since 4.0.0
*/ */
@ConfigurationProperties("spring.data.web") @ConfigurationProperties("spring.data.web")
public class SpringDataWebProperties { public class SpringDataWebProperties {

0
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/data/web/package-info.java → spring-boot-project/spring-boot-data-web/src/main/java/org/springframework/boot/autoconfigure/data/web/package-info.java

4
spring-boot-project/spring-boot-data-web/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@ -0,0 +1,4 @@
{
"groups": [],
"properties": []
}

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

@ -0,0 +1 @@
org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration

6
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebAutoConfigurationJpaTests.java → spring-boot-project/spring-boot-data-web/src/test/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebAutoConfigurationJpaTests.java

@ -20,8 +20,8 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage; import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.data.alt.jpa.City; import org.springframework.boot.autoconfigure.data.web.domain.city.City;
import org.springframework.boot.autoconfigure.data.alt.jpa.CityJpaRepository; import org.springframework.boot.autoconfigure.data.web.domain.city.CityRepository;
import org.springframework.boot.data.jpa.autoconfigure.JpaRepositoriesAutoConfiguration; import org.springframework.boot.data.jpa.autoconfigure.JpaRepositoriesAutoConfiguration;
import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration;
import org.springframework.boot.jpa.autoconfigure.hibernate.HibernateJpaAutoConfiguration; import org.springframework.boot.jpa.autoconfigure.hibernate.HibernateJpaAutoConfiguration;
@ -52,7 +52,7 @@ class SpringDataWebAutoConfigurationJpaTests {
@Test @Test
void springDataWebIsConfiguredWithJpaRepositories() { void springDataWebIsConfiguredWithJpaRepositories() {
this.contextRunner.withUserConfiguration(TestConfiguration.class).run((context) -> { this.contextRunner.withUserConfiguration(TestConfiguration.class).run((context) -> {
assertThat(context).hasSingleBean(CityJpaRepository.class); assertThat(context).hasSingleBean(CityRepository.class);
assertThat(context).hasSingleBean(PageableHandlerMethodArgumentResolver.class); assertThat(context).hasSingleBean(PageableHandlerMethodArgumentResolver.class);
assertThat(context).hasSingleBean(SortHandlerMethodArgumentResolver.class); assertThat(context).hasSingleBean(SortHandlerMethodArgumentResolver.class);
assertThat(context.getBean(FormattingConversionService.class).canConvert(String.class, Distance.class)) assertThat(context.getBean(FormattingConversionService.class).canConvert(String.class, Distance.class))

0
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebAutoConfigurationTests.java → spring-boot-project/spring-boot-data-web/src/test/java/org/springframework/boot/autoconfigure/data/web/SpringDataWebAutoConfigurationTests.java

2
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/alt/jpa/City.java → spring-boot-project/spring-boot-data-web/src/test/java/org/springframework/boot/autoconfigure/data/web/domain/city/City.java

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.autoconfigure.data.alt.jpa; package org.springframework.boot.autoconfigure.data.web.domain.city;
import java.io.Serializable; import java.io.Serializable;

15
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/alt/jpa/CityJpaRepository.java → spring-boot-project/spring-boot-data-web/src/test/java/org/springframework/boot/autoconfigure/data/web/domain/city/CityRepository.java

@ -14,10 +14,19 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.autoconfigure.data.alt.jpa; package org.springframework.boot.autoconfigure.data.web.domain.city;
import org.springframework.data.repository.Repository; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
public interface CityJpaRepository extends Repository<City, Long> { public interface CityRepository extends JpaRepository<City, Long> {
@Override
Page<City> findAll(Pageable pageable);
Page<City> findByNameLikeAndCountryLikeAllIgnoringCase(String name, String country, Pageable pageable);
City findByNameAndCountryAllIgnoringCase(String name, String country);
} }

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

@ -2007,6 +2007,7 @@ bom {
"spring-boot-data-r2dbc", "spring-boot-data-r2dbc",
"spring-boot-data-redis", "spring-boot-data-redis",
"spring-boot-data-rest", "spring-boot-data-rest",
"spring-boot-data-web",
"spring-boot-devtools", "spring-boot-devtools",
"spring-boot-docker-compose", "spring-boot-docker-compose",
"spring-boot-elasticsearch", "spring-boot-elasticsearch",

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

@ -95,6 +95,7 @@ dependencies {
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-r2dbc", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-r2dbc", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-redis", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-redis", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-rest", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-rest", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-web", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-flyway", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-flyway", configuration: "autoConfigurationMetadata"))
@ -156,6 +157,7 @@ dependencies {
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-r2dbc", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-data-r2dbc", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-redis", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-data-redis", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-rest", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-data-rest", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-web", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-docker-compose", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-docker-compose", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "configurationPropertiesMetadata"))

1
spring-boot-project/spring-boot-starters/spring-boot-starter-data-rest/build.gradle

@ -23,5 +23,6 @@ description = "Starter for exposing Spring Data repositories over REST using Spr
dependencies { dependencies {
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web"))
api(project(":spring-boot-project:spring-boot-data-rest")) api(project(":spring-boot-project:spring-boot-data-rest"))
api(project(":spring-boot-project:spring-boot-data-web"))
api(project(":spring-boot-project:spring-boot-tx")) api(project(":spring-boot-project:spring-boot-tx"))
} }

1
spring-boot-project/spring-boot-test-autoconfigure/build.gradle

@ -63,6 +63,7 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-data-neo4j")) optional(project(":spring-boot-project:spring-boot-data-neo4j"))
optional(project(":spring-boot-project:spring-boot-data-r2dbc")) optional(project(":spring-boot-project:spring-boot-data-r2dbc"))
optional(project(":spring-boot-project:spring-boot-data-redis")) optional(project(":spring-boot-project:spring-boot-data-redis"))
optional(project(":spring-boot-project:spring-boot-data-web"))
optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-flyway"))
optional(project(":spring-boot-project:spring-boot-groovy-templates")) optional(project(":spring-boot-project:spring-boot-groovy-templates"))
optional(project(":spring-boot-project:spring-boot-hateoas")) optional(project(":spring-boot-project:spring-boot-hateoas"))

2
spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc.imports

@ -7,7 +7,7 @@ optional:org.springframework.boot.mustache.autoconfigure.MustacheAutoConfigurati
optional:org.springframework.boot.thymeleaf.autoconfigure.ThymeleafAutoConfiguration optional:org.springframework.boot.thymeleaf.autoconfigure.ThymeleafAutoConfiguration
optional:org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration optional:org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration
org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration
org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration optional:org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration
org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration
org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration
org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration

Loading…
Cancel
Save