From 322ff2b841acc8c1b5c5d7fe2c13d9186cbfb79e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Fri, 21 Mar 2025 16:27:03 +0100 Subject: [PATCH] Create spring-boot-hazelcast module See gh-46099 --- settings.gradle | 1 + .../build.gradle | 2 +- ...astHealthContributorAutoConfiguration.java | 2 +- ...utorAutoConfigurationIntegrationTests.java | 2 +- ...althContributorAutoConfigurationTests.java | 2 +- ...intsAutoConfigurationIntegrationTests.java | 2 +- .../spring-boot-actuator/build.gradle | 2 +- .../HazelcastHealthIndicatorTests.java | 2 +- .../build.gradle | 2 +- .../cache/CacheAutoConfiguration.java | 8 ++-- .../cache/HazelcastCacheConfiguration.java | 4 +- .../session/SessionAutoConfiguration.java | 10 ++--- ...ot.autoconfigure.AutoConfiguration.imports | 2 - .../cache/CacheAutoConfigurationTests.java | 2 +- .../spring-boot-dependencies/build.gradle | 1 + .../spring-boot-docker-compose/build.gradle | 2 +- ...nectionDetailsFactoryIntegrationTests.java | 2 +- ...DockerComposeConnectionDetailsFactory.java | 2 +- .../spring-boot-docs/build.gradle | 2 + .../spring-boot-hazelcast/build.gradle | 42 +++++++++++++++++++ .../HazelcastAutoConfiguration.java | 4 +- ...zelcastClientConfigAvailableCondition.java | 2 +- .../HazelcastClientConfiguration.java | 2 +- .../HazelcastClientInstanceConfiguration.java | 2 +- .../HazelcastConfigCustomizer.java | 4 +- .../HazelcastConfigResourceCondition.java | 4 +- .../HazelcastConnectionDetails.java | 4 +- ...zelcastConnectionDetailsConfiguration.java | 2 +- ...zelcastJpaDependencyAutoConfiguration.java | 6 +-- .../autoconfigure}/HazelcastProperties.java | 4 +- .../HazelcastServerConfiguration.java | 2 +- .../PropertiesHazelcastConnectionDetails.java | 2 +- .../autoconfigure}/package-info.java | 2 +- ...ot.autoconfigure.AutoConfiguration.imports | 2 + ...HazelcastAutoConfigurationClientTests.java | 18 ++++---- ...HazelcastAutoConfigurationServerTests.java | 32 +++++++------- .../HazelcastAutoConfigurationTests.java | 2 +- ...stClientConfigAvailableConditionTests.java | 8 ++-- ...stJpaDependencyAutoConfigurationTests.java | 4 +- .../hazelcast-client-instance.xml | 0 .../hazelcast-client-specific.xml | 0 .../hazelcast-client-specific.yaml | 0 .../hazelcast-client-specific.yml | 0 .../autoconfigure}/hazelcast-specific.xml | 0 .../autoconfigure}/hazelcast-specific.yaml | 0 .../autoconfigure}/hazelcast-specific.yml | 0 .../spring-boot-testcontainers/build.gradle | 3 +- ...nectionDetailsFactoryIntegrationTests.java | 4 +- ...nectionDetailsFactoryIntegrationTests.java | 4 +- ...castContainerConnectionDetailsFactory.java | 2 +- .../spring-boot-smoke-test-cache/build.gradle | 2 +- .../build.gradle | 2 +- 52 files changed, 130 insertions(+), 87 deletions(-) create mode 100644 spring-boot-project/spring-boot-hazelcast/build.gradle rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastAutoConfiguration.java (95%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastClientConfigAvailableCondition.java (98%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastClientConfiguration.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastClientInstanceConfiguration.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastConfigCustomizer.java (93%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastConfigResourceCondition.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastConnectionDetails.java (93%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastConnectionDetailsConfiguration.java (97%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastJpaDependencyAutoConfiguration.java (95%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastProperties.java (95%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastServerConfiguration.java (98%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure}/PropertiesHazelcastConnectionDetails.java (97%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure}/package-info.java (92%) create mode 100644 spring-boot-project/spring-boot-hazelcast/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/hazelcast => spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastAutoConfigurationClientTests.java (94%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastAutoConfigurationServerTests.java (91%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastAutoConfigurationTests.java (97%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastClientConfigAvailableConditionTests.java (91%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure}/HazelcastJpaDependencyAutoConfigurationTests.java (97%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure}/hazelcast-client-instance.xml (100%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure}/hazelcast-client-specific.xml (100%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure}/hazelcast-client-specific.yaml (100%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure}/hazelcast-client-specific.yml (100%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure}/hazelcast-specific.xml (100%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure}/hazelcast-specific.yaml (100%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast => spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure}/hazelcast-specific.yml (100%) diff --git a/settings.gradle b/settings.gradle index 416e46c5067..79c79e097fe 100644 --- a/settings.gradle +++ b/settings.gradle @@ -72,6 +72,7 @@ include "spring-boot-project:spring-boot-elasticsearch" include "spring-boot-project:spring-boot-flyway" include "spring-boot-project:spring-boot-freemarker" include "spring-boot-project:spring-boot-groovy-templates" +include "spring-boot-project:spring-boot-hazelcast" include "spring-boot-project:spring-boot-integration" include "spring-boot-project:spring-boot-jackson" include "spring-boot-project:spring-boot-jdbc" diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index 6c5954a4314..6774a2e390b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -39,6 +39,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-data-jpa")) optional(project(":spring-boot-project:spring-boot-elasticsearch")) optional(project(":spring-boot-project:spring-boot-flyway")) + optional(project(":spring-boot-project:spring-boot-hazelcast")) optional(project(":spring-boot-project:spring-boot-integration")) optional(project(":spring-boot-project:spring-boot-jackson")) optional(project(":spring-boot-project:spring-boot-jdbc")) @@ -58,7 +59,6 @@ dependencies { } optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") optional("com.github.ben-manes.caffeine:caffeine") - optional("com.hazelcast:hazelcast") optional("com.hazelcast:hazelcast-spring") optional("com.zaxxer:HikariCP") optional("io.lettuce:lettuce-core") diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/hazelcast/HazelcastHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/hazelcast/HazelcastHealthContributorAutoConfiguration.java index 7441b498bc0..b4fdaeca40a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/hazelcast/HazelcastHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/hazelcast/HazelcastHealthContributorAutoConfiguration.java @@ -28,7 +28,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration; import org.springframework.context.annotation.Bean; /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/hazelcast/HazelcastHealthContributorAutoConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/hazelcast/HazelcastHealthContributorAutoConfigurationIntegrationTests.java index 38decd0efcd..e4b03e5d041 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/hazelcast/HazelcastHealthContributorAutoConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/hazelcast/HazelcastHealthContributorAutoConfigurationIntegrationTests.java @@ -24,7 +24,7 @@ import org.springframework.boot.actuate.hazelcast.HazelcastHealthIndicator; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Status; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.testsupport.classpath.resources.WithResource; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/hazelcast/HazelcastHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/hazelcast/HazelcastHealthContributorAutoConfigurationTests.java index 01015a5d3b1..e9933d31b0a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/hazelcast/HazelcastHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/hazelcast/HazelcastHealthContributorAutoConfigurationTests.java @@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.hazelcast.HazelcastHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.testsupport.classpath.resources.WithResource; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java index 2395a4b5de8..0e10a3b36e0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java @@ -34,11 +34,11 @@ import org.springframework.boot.autoconfigure.data.neo4j.Neo4jRepositoriesAutoCo import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration; import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; import org.springframework.boot.autoconfigure.mongo.MongoReactiveAutoConfiguration; import org.springframework.boot.context.annotation.UserConfigurations; import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration; import org.springframework.boot.liquibase.autoconfigure.LiquibaseAutoConfiguration; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle index cd76c4fc107..7f75f83f83b 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -56,7 +56,6 @@ dependencies { optional("com.fasterxml.jackson.core:jackson-databind") optional("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") optional("com.github.ben-manes.caffeine:caffeine") - optional("com.hazelcast:hazelcast") optional("com.hazelcast:hazelcast-spring") optional("com.zaxxer:HikariCP") optional("io.lettuce:lettuce-core") @@ -112,6 +111,7 @@ dependencies { optional("org.springframework.session:spring-session-core") testImplementation(project(":spring-boot-project:spring-boot-autoconfigure-all")) + testImplementation(project(":spring-boot-project:spring-boot-hazelcast")) testImplementation(project(":spring-boot-project:spring-boot-jackson")) testImplementation(project(":spring-boot-project:spring-boot-jsonb")) testImplementation(project(":spring-boot-project:spring-boot-reactor-netty")) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicatorTests.java index e41e0cd09f4..12e6392b07a 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicatorTests.java @@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Status; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.testsupport.classpath.resources.WithResource; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle index f84dcc7df55..20c3659c5a5 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle @@ -63,6 +63,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-data-jpa")) optional(project(":spring-boot-project:spring-boot-elasticsearch")) optional(project(":spring-boot-project:spring-boot-flyway")) + optional(project(":spring-boot-project:spring-boot-hazelcast")) optional(project(":spring-boot-project:spring-boot-jackson")) optional(project(":spring-boot-project:spring-boot-jdbc")) optional(project(":spring-boot-project:spring-boot-jsonb")) @@ -81,7 +82,6 @@ dependencies { optional("com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations") optional("com.fasterxml.jackson.module:jackson-module-parameter-names") optional("com.google.code.gson:gson") - optional("com.hazelcast:hazelcast") optional("com.hazelcast:hazelcast-spring") optional("com.h2database:h2") optional("com.nimbusds:oauth2-oidc-sdk") diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java index 88fdd3b4d0c..7d34341dfeb 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java @@ -27,7 +27,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.data.couchbase.CouchbaseDataAutoConfiguration; import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.jpa.autoconfigure.EntityManagerFactoryDependsOnPostProcessor; import org.springframework.cache.CacheManager; @@ -53,10 +52,9 @@ import org.springframework.util.Assert; * @since 1.3.0 * @see EnableCaching */ -@AutoConfiguration( - after = { CouchbaseDataAutoConfiguration.class, HazelcastAutoConfiguration.class, - RedisAutoConfiguration.class }, - afterName = "org.springframework.boot.jpa.autoconfigure.hibernate.HibernateJpaAutoConfiguration") +@AutoConfiguration(after = { CouchbaseDataAutoConfiguration.class, RedisAutoConfiguration.class }, + afterName = { "org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration", + "org.springframework.boot.jpa.autoconfigure.hibernate.HibernateJpaAutoConfiguration" }) @ConditionalOnClass(CacheManager.class) @ConditionalOnBean(CacheAspectSupport.class) @ConditionalOnMissingBean(value = CacheManager.class, name = "cacheResolver") diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastCacheConfiguration.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastCacheConfiguration.java index 15e69cfca90..d6078d8ed25 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastCacheConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastCacheConfiguration.java @@ -22,8 +22,8 @@ import com.hazelcast.spring.cache.HazelcastCacheManager; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastConfigResourceCondition; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastConfigResourceCondition; import org.springframework.cache.CacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java index df39dba1b3f..b51f91234bc 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java @@ -31,7 +31,6 @@ import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfigurat import org.springframework.boot.autoconfigure.data.mongo.MongoReactiveDataAutoConfiguration; import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration; @@ -67,10 +66,11 @@ import org.springframework.session.web.http.HttpSessionIdResolver; * @since 1.4.0 */ @AutoConfiguration( - after = { HazelcastAutoConfiguration.class, MongoDataAutoConfiguration.class, - MongoReactiveDataAutoConfiguration.class, RedisAutoConfiguration.class, - RedisReactiveAutoConfiguration.class, WebSessionIdResolverAutoConfiguration.class }, - afterName = { "org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration", + after = { MongoDataAutoConfiguration.class, MongoReactiveDataAutoConfiguration.class, + RedisAutoConfiguration.class, RedisReactiveAutoConfiguration.class, + WebSessionIdResolverAutoConfiguration.class }, + afterName = { "org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration", + "org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration", "org.springframework.boot.jdbc.autoconfigure.JdbcTemplateAutoConfiguration" }, before = { HttpHandlerAutoConfiguration.class, WebFluxAutoConfiguration.class }) @ConditionalOnClass(Session.class) 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 de2313fac38..6e024778ae0 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 @@ -46,8 +46,6 @@ org.springframework.boot.autoconfigure.graphql.servlet.GraphQlWebMvcAutoConfigur org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration org.springframework.boot.autoconfigure.h2.H2ConsoleAutoConfiguration org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration -org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration -org.springframework.boot.autoconfigure.hazelcast.HazelcastJpaDependencyAutoConfiguration 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-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java index 03bd593cc7a..38501175890 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java @@ -49,7 +49,7 @@ import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.cache.support.MockCachingProvider; import org.springframework.boot.autoconfigure.cache.support.MockCachingProvider.MockCacheManager; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableApplicationContext; import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.cache.Cache; diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 7b950ab908c..5cf0e3d492b 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -2000,6 +2000,7 @@ bom { "spring-boot-flyway", "spring-boot-freemarker", "spring-boot-groovy-templates", + "spring-boot-hazelcast", "spring-boot-integration", "spring-boot-jackson", "spring-boot-jarmode-tools", diff --git a/spring-boot-project/spring-boot-docker-compose/build.gradle b/spring-boot-project/spring-boot-docker-compose/build.gradle index 14dc59d4793..eba73ecf459 100644 --- a/spring-boot-project/spring-boot-docker-compose/build.gradle +++ b/spring-boot-project/spring-boot-docker-compose/build.gradle @@ -33,7 +33,6 @@ dependencies { dockerTestImplementation(project(":spring-boot-project:spring-boot-pulsar")) dockerTestImplementation(project(":spring-boot-project:spring-boot-r2dbc")) dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker")) - dockerTestImplementation("com.hazelcast:hazelcast") dockerTestImplementation("com.redis:testcontainers-redis") dockerTestImplementation("org.assertj:assertj-core") dockerTestImplementation("org.awaitility:awaitility") @@ -58,6 +57,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure")) optional(project(":spring-boot-project:spring-boot-elasticsearch")) optional(project(":spring-boot-project:spring-boot-flyway")) + optional(project(":spring-boot-project:spring-boot-hazelcast")) optional(project(":spring-boot-project:spring-boot-jdbc")) optional(project(":spring-boot-project:spring-boot-liquibase")) optional(project(":spring-boot-project:spring-boot-pulsar")) diff --git a/spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/hazelcast/HazelcastDockerComposeConnectionDetailsFactoryIntegrationTests.java b/spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/hazelcast/HazelcastDockerComposeConnectionDetailsFactoryIntegrationTests.java index 5e8796e33a1..af0d69bbece 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/hazelcast/HazelcastDockerComposeConnectionDetailsFactoryIntegrationTests.java +++ b/spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/hazelcast/HazelcastDockerComposeConnectionDetailsFactoryIntegrationTests.java @@ -24,8 +24,8 @@ import com.hazelcast.config.Config; import com.hazelcast.core.HazelcastInstance; import com.hazelcast.map.IMap; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastConnectionDetails; import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastConnectionDetails; import org.springframework.boot.testsupport.container.TestImage; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/hazelcast/HazelcastDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/hazelcast/HazelcastDockerComposeConnectionDetailsFactory.java index 5f7df5c7d5a..b476be34d1f 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/hazelcast/HazelcastDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/hazelcast/HazelcastDockerComposeConnectionDetailsFactory.java @@ -18,10 +18,10 @@ package org.springframework.boot.docker.compose.service.connection.hazelcast; import com.hazelcast.client.config.ClientConfig; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastConnectionDetails; import org.springframework.boot.docker.compose.core.RunningService; import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionDetailsFactory; import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionSource; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastConnectionDetails; /** * {@link DockerComposeConnectionDetailsFactory} to create diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index 73d35833230..41264439a0a 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -86,6 +86,7 @@ dependencies { 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-freemarker", 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")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-jdbc", configuration: "autoConfigurationMetadata")) @@ -120,6 +121,7 @@ dependencies { configurationProperties(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-flyway", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-freemarker", 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")) configurationProperties(project(path: ":spring-boot-project:spring-boot-jdbc", configuration: "configurationPropertiesMetadata")) diff --git a/spring-boot-project/spring-boot-hazelcast/build.gradle b/spring-boot-project/spring-boot-hazelcast/build.gradle new file mode 100644 index 00000000000..dc1e355106c --- /dev/null +++ b/spring-boot-project/spring-boot-hazelcast/build.gradle @@ -0,0 +1,42 @@ +/* + * 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 Hazelcast" + +dependencies { + api(project(":spring-boot-project:spring-boot")) + api("com.hazelcast:hazelcast") + + optional(project(":spring-boot-project:spring-boot-autoconfigure")) + optional(project(":spring-boot-project:spring-boot-jpa")) + optional("com.hazelcast:hazelcast-spring") + optional("org.slf4j:slf4j-api") + + testImplementation(project(":spring-boot-project:spring-boot-test")) + testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + + testRuntimeOnly("com.h2database:h2") + testRuntimeOnly("ch.qos.logback:logback-classic") +} diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfiguration.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfiguration.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfiguration.java index 56e54ece11b..4477ee2c467 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfiguration.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import com.hazelcast.core.HazelcastInstance; @@ -31,7 +31,7 @@ import org.springframework.context.annotation.Import; * * @author Stephane Nicoll * @author Vedran Pavic - * @since 1.3.0 + * @since 4.0.0 * @see HazelcastConfigResourceCondition */ @AutoConfiguration diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientConfigAvailableCondition.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastClientConfigAvailableCondition.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientConfigAvailableCondition.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastClientConfigAvailableCondition.java index f91b5aeb79a..6f3ca62e7e3 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientConfigAvailableCondition.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastClientConfigAvailableCondition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import java.io.IOException; import java.io.InputStream; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientConfiguration.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastClientConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientConfiguration.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastClientConfiguration.java index 5afd2c13a9b..ef27d2642e5 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientConfiguration.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastClientConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import com.hazelcast.client.HazelcastClient; import com.hazelcast.core.HazelcastInstance; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientInstanceConfiguration.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastClientInstanceConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientInstanceConfiguration.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastClientInstanceConfiguration.java index 814c36f2c39..7c58ff9a2a3 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientInstanceConfiguration.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastClientInstanceConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import com.hazelcast.client.HazelcastClient; import com.hazelcast.client.config.ClientConfig; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConfigCustomizer.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastConfigCustomizer.java similarity index 93% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConfigCustomizer.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastConfigCustomizer.java index ecfbb7d6e96..7b0b2ab6c5c 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConfigCustomizer.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastConfigCustomizer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import com.hazelcast.config.Config; @@ -24,7 +24,7 @@ import com.hazelcast.config.Config; * * @author Jaromir Hamala * @author Stephane Nicoll - * @since 2.7.0 + * @since 4.0.0 */ @FunctionalInterface public interface HazelcastConfigCustomizer { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConfigResourceCondition.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastConfigResourceCondition.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConfigResourceCondition.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastConfigResourceCondition.java index 2b8a09c3d1b..8ffc22fad29 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConfigResourceCondition.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastConfigResourceCondition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; import org.springframework.boot.autoconfigure.condition.ResourceCondition; @@ -31,7 +31,7 @@ import org.springframework.util.Assert; * @author Stephane Nicoll * @author Madhura Bhave * @author Vedran Pavic - * @since 1.3.0 + * @since 4.0.0 */ public abstract class HazelcastConfigResourceCondition extends ResourceCondition { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConnectionDetails.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastConnectionDetails.java similarity index 93% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConnectionDetails.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastConnectionDetails.java index b18e7d14727..200e7a2ee3f 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConnectionDetails.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastConnectionDetails.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import com.hazelcast.client.config.ClientConfig; @@ -24,7 +24,7 @@ import org.springframework.boot.autoconfigure.service.connection.ConnectionDetai * Details required to establish a client connection to a Hazelcast instance. * * @author Dmytro Nosan - * @since 3.4.0 + * @since 4.0.0 */ public interface HazelcastConnectionDetails extends ConnectionDetails { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConnectionDetailsConfiguration.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastConnectionDetailsConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConnectionDetailsConfiguration.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastConnectionDetailsConfiguration.java index ed7654e5651..05bcdf1bf8b 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConnectionDetailsConfiguration.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastConnectionDetailsConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import com.hazelcast.client.config.ClientConfig; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastJpaDependencyAutoConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastJpaDependencyAutoConfiguration.java index 90b4dbe3c63..e054c69b3d1 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastJpaDependencyAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import com.hazelcast.core.HazelcastInstance; import jakarta.persistence.EntityManagerFactory; @@ -23,7 +23,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastJpaDependencyAutoConfiguration.HazelcastInstanceEntityManagerFactoryDependsOnConfiguration; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastJpaDependencyAutoConfiguration.HazelcastInstanceEntityManagerFactoryDependsOnConfiguration; import org.springframework.boot.jpa.autoconfigure.EntityManagerFactoryDependsOnPostProcessor; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; @@ -36,7 +36,7 @@ import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; * the {@code hazelcastInstance} bean. * * @author Stephane Nicoll - * @since 1.3.2 + * @since 4.0.0 */ @AutoConfiguration(after = HazelcastAutoConfiguration.class, afterName = "org.springframework.boot.jpa.autoconfigure.hibernate.HibernateJpaAutoConfiguration") diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastProperties.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastProperties.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastProperties.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastProperties.java index 208de1fc7d1..f84e2d78ac4 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastProperties.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastProperties.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.core.io.Resource; @@ -24,7 +24,7 @@ import org.springframework.util.Assert; * Configuration properties for the hazelcast integration. * * @author Stephane Nicoll - * @since 1.3.0 + * @since 4.0.0 */ @ConfigurationProperties("spring.hazelcast") public class HazelcastProperties { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastServerConfiguration.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastServerConfiguration.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastServerConfiguration.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastServerConfiguration.java index e1fc883ce6a..94e01d155af 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastServerConfiguration.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastServerConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import java.io.IOException; import java.io.InputStream; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/PropertiesHazelcastConnectionDetails.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/PropertiesHazelcastConnectionDetails.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/PropertiesHazelcastConnectionDetails.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/PropertiesHazelcastConnectionDetails.java index 133c472075c..6c4c23a144c 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/PropertiesHazelcastConnectionDetails.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/PropertiesHazelcastConnectionDetails.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/package-info.java b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/package-info.java similarity index 92% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/package-info.java rename to spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/package-info.java index 3460a8edac0..115a4bd8a7e 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/hazelcast/package-info.java +++ b/spring-boot-project/spring-boot-hazelcast/src/main/java/org/springframework/boot/hazelcast/autoconfigure/package-info.java @@ -17,4 +17,4 @@ /** * Auto-configuration for Hazelcast. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; diff --git a/spring-boot-project/spring-boot-hazelcast/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-hazelcast/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 00000000000..8df7fdbec6a --- /dev/null +++ b/spring-boot-project/spring-boot-hazelcast/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,2 @@ +org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration +org.springframework.boot.hazelcast.autoconfigure.HazelcastJpaDependencyAutoConfiguration diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationClientTests.java b/spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationClientTests.java similarity index 94% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationClientTests.java rename to spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationClientTests.java index 8ff66a3b18d..f9c6331f0da 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationClientTests.java +++ b/spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationClientTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import java.io.File; import java.io.FileReader; @@ -87,7 +87,7 @@ class HazelcastAutoConfigurationClientTests { @Test void systemPropertyWithXml() { File config = prepareConfiguration("src/test/resources/org/springframework/" - + "boot/autoconfigure/hazelcast/hazelcast-client-specific.xml"); + + "boot/hazelcast/autoconfigure/hazelcast-client-specific.xml"); this.contextRunner .withSystemProperties(HazelcastClientConfiguration.CONFIG_SYSTEM_PROPERTY + "=" + config.getAbsolutePath()) .run(assertSpecificHazelcastClient("explicit-xml")); @@ -96,7 +96,7 @@ class HazelcastAutoConfigurationClientTests { @Test void systemPropertyWithYaml() { File config = prepareConfiguration("src/test/resources/org/springframework/" - + "boot/autoconfigure/hazelcast/hazelcast-client-specific.yaml"); + + "boot/hazelcast/autoconfigure/hazelcast-client-specific.yaml"); this.contextRunner .withSystemProperties(HazelcastClientConfiguration.CONFIG_SYSTEM_PROPERTY + "=" + config.getAbsolutePath()) .run(assertSpecificHazelcastClient("explicit-yaml")); @@ -105,7 +105,7 @@ class HazelcastAutoConfigurationClientTests { @Test void systemPropertyWithYml() { File config = prepareConfiguration("src/test/resources/org/springframework/" - + "boot/autoconfigure/hazelcast/hazelcast-client-specific.yml"); + + "boot/hazelcast/autoconfigure/hazelcast-client-specific.yml"); this.contextRunner .withSystemProperties(HazelcastClientConfiguration.CONFIG_SYSTEM_PROPERTY + "=" + config.getAbsolutePath()) .run(assertSpecificHazelcastClient("explicit-yml")); @@ -114,7 +114,7 @@ class HazelcastAutoConfigurationClientTests { @Test void explicitConfigUrlWithXml() throws MalformedURLException { File config = prepareConfiguration("src/test/resources/org/springframework/" - + "boot/autoconfigure/hazelcast/hazelcast-client-specific.xml"); + + "boot/hazelcast/autoconfigure/hazelcast-client-specific.xml"); this.contextRunner.withPropertyValues("spring.hazelcast.config=" + config.toURI().toURL()) .run(assertSpecificHazelcastClient("explicit-xml")); } @@ -122,7 +122,7 @@ class HazelcastAutoConfigurationClientTests { @Test void explicitConfigUrlWithYaml() throws MalformedURLException { File config = prepareConfiguration("src/test/resources/org/springframework/" - + "boot/autoconfigure/hazelcast/hazelcast-client-specific.yaml"); + + "boot/hazelcast/autoconfigure/hazelcast-client-specific.yaml"); this.contextRunner.withPropertyValues("spring.hazelcast.config=" + config.toURI().toURL()) .run(assertSpecificHazelcastClient("explicit-yaml")); } @@ -130,7 +130,7 @@ class HazelcastAutoConfigurationClientTests { @Test void explicitConfigUrlWithYml() throws MalformedURLException { File config = prepareConfiguration("src/test/resources/org/springframework/" - + "boot/autoconfigure/hazelcast/hazelcast-client-specific.yml"); + + "boot/hazelcast/autoconfigure/hazelcast-client-specific.yml"); this.contextRunner.withPropertyValues("spring.hazelcast.config=" + config.toURI().toURL()) .run(assertSpecificHazelcastClient("explicit-yml")); } @@ -170,7 +170,7 @@ class HazelcastAutoConfigurationClientTests { void clientConfigWithInstanceNameCreatesClientIfNecessary() throws MalformedURLException { assertThat(HazelcastClient.getHazelcastClientByName("spring-boot")).isNull(); File config = prepareConfiguration("src/test/resources/org/springframework/" - + "boot/autoconfigure/hazelcast/hazelcast-client-instance.xml"); + + "boot/hazelcast/autoconfigure/hazelcast-client-instance.xml"); this.contextRunner.withPropertyValues("spring.hazelcast.config=" + config.toURI().toURL()) .run((context) -> assertThat(context).getBean(HazelcastInstance.class) .extracting(HazelcastInstance::getName) @@ -180,7 +180,7 @@ class HazelcastAutoConfigurationClientTests { @Test void autoConfiguredClientConfigUsesApplicationClassLoader() throws MalformedURLException { File config = prepareConfiguration("src/test/resources/org/springframework/" - + "boot/autoconfigure/hazelcast/hazelcast-client-specific.xml"); + + "boot/hazelcast/autoconfigure/hazelcast-client-specific.xml"); this.contextRunner.withPropertyValues("spring.hazelcast.config=" + config.toURI().toURL()).run((context) -> { HazelcastInstance hazelcast = context.getBean(HazelcastInstance.class); assertThat(hazelcast).isInstanceOf(HazelcastClientProxy.class); diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationServerTests.java b/spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationServerTests.java similarity index 91% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationServerTests.java rename to spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationServerTests.java index f171949bd3d..baf7d8fc817 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationServerTests.java +++ b/spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationServerTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -73,7 +73,7 @@ class HazelcastAutoConfigurationServerTests { void systemPropertyWithXml() { this.contextRunner .withSystemProperties(HazelcastServerConfiguration.CONFIG_SYSTEM_PROPERTY - + "=classpath:org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.xml") + + "=classpath:org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.xml") .run((context) -> { Config config = context.getBean(HazelcastInstance.class).getConfig(); assertThat(config.getMapConfigs().keySet()).containsOnly("foobar"); @@ -84,7 +84,7 @@ class HazelcastAutoConfigurationServerTests { void systemPropertyWithYaml() { this.contextRunner .withSystemProperties(HazelcastServerConfiguration.CONFIG_SYSTEM_PROPERTY - + "=classpath:org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.yaml") + + "=classpath:org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.yaml") .run((context) -> { Config config = context.getBean(HazelcastInstance.class).getConfig(); assertThat(config.getMapConfigs().keySet()).containsOnly("foobar"); @@ -95,7 +95,7 @@ class HazelcastAutoConfigurationServerTests { void systemPropertyWithYml() { this.contextRunner .withSystemProperties(HazelcastServerConfiguration.CONFIG_SYSTEM_PROPERTY - + "=classpath:org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.yml") + + "=classpath:org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.yml") .run((context) -> { Config config = context.getBean(HazelcastInstance.class).getConfig(); assertThat(config.getMapConfigs().keySet()).containsOnly("foobar"); @@ -105,55 +105,55 @@ class HazelcastAutoConfigurationServerTests { @Test void explicitConfigFileWithXml() { this.contextRunner - .withPropertyValues("spring.hazelcast.config=org/springframework/boot/autoconfigure/hazelcast/" + .withPropertyValues("spring.hazelcast.config=org/springframework/boot/hazelcast/autoconfigure/" + "hazelcast-specific.xml") .run(assertSpecificHazelcastServer( - "org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.xml")); + "org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.xml")); } @Test void explicitConfigFileWithYaml() { this.contextRunner - .withPropertyValues("spring.hazelcast.config=org/springframework/boot/autoconfigure/hazelcast/" + .withPropertyValues("spring.hazelcast.config=org/springframework/boot/hazelcast/autoconfigure/" + "hazelcast-specific.yaml") .run(assertSpecificHazelcastServer( - "org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.yaml")); + "org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.yaml")); } @Test void explicitConfigFileWithYml() { this.contextRunner - .withPropertyValues("spring.hazelcast.config=org/springframework/boot/autoconfigure/hazelcast/" + .withPropertyValues("spring.hazelcast.config=org/springframework/boot/hazelcast/autoconfigure/" + "hazelcast-specific.yml") .run(assertSpecificHazelcastServer( - "org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.yml")); + "org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.yml")); } @Test void explicitConfigUrlWithXml() { this.contextRunner .withPropertyValues("spring.hazelcast.config=classpath:org/springframework/" - + "boot/autoconfigure/hazelcast/hazelcast-specific.xml") + + "boot/hazelcast/autoconfigure/hazelcast-specific.xml") .run(assertSpecificHazelcastServer( - "org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.xml")); + "org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.xml")); } @Test void explicitConfigUrlWithYaml() { this.contextRunner .withPropertyValues("spring.hazelcast.config=classpath:org/springframework/" - + "boot/autoconfigure/hazelcast/hazelcast-specific.yaml") + + "boot/hazelcast/autoconfigure/hazelcast-specific.yaml") .run(assertSpecificHazelcastServer( - "org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.yaml")); + "org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.yaml")); } @Test void explicitConfigUrlWithYml() { this.contextRunner .withPropertyValues("spring.hazelcast.config=classpath:org/springframework/" - + "boot/autoconfigure/hazelcast/hazelcast-specific.yml") + + "boot/hazelcast/autoconfigure/hazelcast-specific.yml") .run(assertSpecificHazelcastServer( - "org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.yml")); + "org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.yml")); } private ContextConsumer assertSpecificHazelcastServer(String location) { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationTests.java b/spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationTests.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationTests.java rename to spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationTests.java index 6c2ecb96701..9248b5f0433 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import com.hazelcast.config.Config; import com.hazelcast.core.HazelcastInstance; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientConfigAvailableConditionTests.java b/spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastClientConfigAvailableConditionTests.java similarity index 91% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientConfigAvailableConditionTests.java rename to spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastClientConfigAvailableConditionTests.java index a97148a2c09..ecf965b7b70 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientConfigAvailableConditionTests.java +++ b/spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastClientConfigAvailableConditionTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import org.junit.jupiter.api.Test; @@ -41,7 +41,7 @@ class HazelcastClientConfigAvailableConditionTests { @Test void explicitConfigurationWithClientConfigMatches() { ConditionOutcome outcome = getMatchOutcome(new MockEnvironment().withProperty("spring.hazelcast.config", - "classpath:org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-specific.xml")); + "classpath:org/springframework/boot/hazelcast/autoconfigure/hazelcast-client-specific.xml")); assertThat(outcome.isMatch()).isTrue(); assertThat(outcome.getMessage()).contains("Hazelcast client configuration detected"); } @@ -49,7 +49,7 @@ class HazelcastClientConfigAvailableConditionTests { @Test void explicitConfigurationWithServerConfigDoesNotMatch() { ConditionOutcome outcome = getMatchOutcome(new MockEnvironment().withProperty("spring.hazelcast.config", - "classpath:org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.xml")); + "classpath:org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.xml")); assertThat(outcome.isMatch()).isFalse(); assertThat(outcome.getMessage()).contains("Hazelcast server configuration detected"); } @@ -57,7 +57,7 @@ class HazelcastClientConfigAvailableConditionTests { @Test void explicitConfigurationWithMissingConfigDoesNotMatch() { ConditionOutcome outcome = getMatchOutcome(new MockEnvironment().withProperty("spring.hazelcast.config", - "classpath:org/springframework/boot/autoconfigure/hazelcast/test-config-does-not-exist.xml")); + "classpath:org/springframework/boot/hazelcast/autoconfigure/test-config-does-not-exist.xml")); assertThat(outcome.isMatch()).isFalse(); assertThat(outcome.getMessage()).contains("Hazelcast configuration does not exist"); } diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java b/spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastJpaDependencyAutoConfigurationTests.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java rename to spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastJpaDependencyAutoConfigurationTests.java index 97ce0aa1994..cca41861f66 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastJpaDependencyAutoConfigurationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.hazelcast; +package org.springframework.boot.hazelcast.autoconfigure; import java.util.Arrays; import java.util.Collections; @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastJpaDependencyAutoConfiguration.HazelcastInstanceEntityManagerFactoryDependsOnPostProcessor; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastJpaDependencyAutoConfiguration.HazelcastInstanceEntityManagerFactoryDependsOnPostProcessor; import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration; import org.springframework.boot.jpa.autoconfigure.EntityManagerFactoryDependsOnPostProcessor; import org.springframework.boot.jpa.autoconfigure.hibernate.HibernateJpaAutoConfiguration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-instance.xml b/spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-client-instance.xml similarity index 100% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-instance.xml rename to spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-client-instance.xml diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-specific.xml b/spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-client-specific.xml similarity index 100% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-specific.xml rename to spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-client-specific.xml diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-specific.yaml b/spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-client-specific.yaml similarity index 100% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-specific.yaml rename to spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-client-specific.yaml diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-specific.yml b/spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-client-specific.yml similarity index 100% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-specific.yml rename to spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-client-specific.yml diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.xml b/spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.xml similarity index 100% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.xml rename to spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.xml diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.yaml b/spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.yaml similarity index 100% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.yaml rename to spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.yaml diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.yml b/spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.yml similarity index 100% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.yml rename to spring-boot-project/spring-boot-hazelcast/src/test/resources/org/springframework/boot/hazelcast/autoconfigure/hazelcast-specific.yml diff --git a/spring-boot-project/spring-boot-testcontainers/build.gradle b/spring-boot-project/spring-boot-testcontainers/build.gradle index 52ea9c52371..3cb623a799c 100644 --- a/spring-boot-project/spring-boot-testcontainers/build.gradle +++ b/spring-boot-project/spring-boot-testcontainers/build.gradle @@ -41,7 +41,6 @@ dependencies { dockerTestImplementation("ch.qos.logback:logback-classic") dockerTestImplementation("co.elastic.clients:elasticsearch-java") dockerTestImplementation("com.couchbase.client:java-client") - dockerTestImplementation("com.hazelcast:hazelcast") dockerTestImplementation("io.micrometer:micrometer-registry-otlp") dockerTestImplementation("io.rest-assured:rest-assured") dockerTestImplementation("org.apache.cassandra:java-driver-core") { @@ -78,6 +77,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure")) optional(project(":spring-boot-project:spring-boot-elasticsearch")) optional(project(":spring-boot-project:spring-boot-flyway")) + optional(project(":spring-boot-project:spring-boot-hazelcast")) optional(project(":spring-boot-project:spring-boot-jdbc")) optional(project(":spring-boot-project:spring-boot-kafka")) optional(project(":spring-boot-project:spring-boot-liquibase")) @@ -109,7 +109,6 @@ dependencies { optional("org.testcontainers:redpanda") optional("org.testcontainers:r2dbc") optional("com.redis:testcontainers-redis") - optional("com.hazelcast:hazelcast") testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) diff --git a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/CustomClusterNameHazelcastContainerConnectionDetailsFactoryIntegrationTests.java b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/CustomClusterNameHazelcastContainerConnectionDetailsFactoryIntegrationTests.java index 39db9b25a71..2c3b64798ac 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/CustomClusterNameHazelcastContainerConnectionDetailsFactoryIntegrationTests.java +++ b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/CustomClusterNameHazelcastContainerConnectionDetailsFactoryIntegrationTests.java @@ -29,8 +29,8 @@ import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastConnectionDetails; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastConnectionDetails; import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.springframework.boot.testsupport.container.HazelcastContainer; import org.springframework.boot.testsupport.container.TestImage; diff --git a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactoryIntegrationTests.java b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactoryIntegrationTests.java index cd3dcdd2ffd..c7e143a2ca9 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactoryIntegrationTests.java +++ b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactoryIntegrationTests.java @@ -26,8 +26,8 @@ import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastConnectionDetails; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastConnectionDetails; import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.springframework.boot.testsupport.container.HazelcastContainer; import org.springframework.boot.testsupport.container.TestImage; diff --git a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactory.java b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactory.java index 811db195865..3fe37b6559d 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/hazelcast/HazelcastContainerConnectionDetailsFactory.java @@ -22,7 +22,7 @@ import com.hazelcast.client.config.ClientConfig; import org.testcontainers.containers.Container; import org.testcontainers.containers.GenericContainer; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastConnectionDetails; +import org.springframework.boot.hazelcast.autoconfigure.HazelcastConnectionDetails; import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory; import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource; import org.springframework.boot.testcontainers.service.connection.ServiceConnection; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle index 84f5ab654c1..bffc2c5dd01 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle @@ -55,7 +55,7 @@ dependencies { ehcache("org.ehcache:ehcache::jakarta") hazelcast(enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies"))) - hazelcast("com.hazelcast:hazelcast") + hazelcast(project(":spring-boot-project:spring-boot-hazelcast")) hazelcast("com.hazelcast:hazelcast-spring") implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-actuator")) diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-hazelcast/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-hazelcast/build.gradle index 2e4bcd10a7c..2f58062b4b8 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-hazelcast/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-hazelcast/build.gradle @@ -21,10 +21,10 @@ plugins { description = "Spring Boot Session smoke test" dependencies { + implementation(project(":spring-boot-project:spring-boot-hazelcast")) implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-actuator")) implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-security")) implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) - implementation("com.hazelcast:hazelcast") implementation("org.springframework.session:spring-session-hazelcast") { exclude group: "javax.annotation", module: "javax.annotation-api" }