diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudStreamBuildCustomizer.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudStreamBuildCustomizer.java index b9b53745844..213b4110971 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudStreamBuildCustomizer.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudStreamBuildCustomizer.java @@ -19,6 +19,7 @@ import io.spring.initializr.generator.buildsystem.Build; import io.spring.initializr.generator.buildsystem.Dependency; import io.spring.initializr.generator.buildsystem.DependencyScope; +import io.spring.initializr.generator.buildsystem.maven.MavenBuild; import io.spring.initializr.generator.spring.build.BuildCustomizer; /** @@ -53,9 +54,12 @@ public void customize(Build build) { build.dependencies().add("cloud-stream-binder-kafka-streams", "org.springframework.cloud", "spring-cloud-stream-binder-kafka-streams", DependencyScope.COMPILE); } - build.dependencies().add("cloud-stream-test", - Dependency.withCoordinates("org.springframework.cloud", "spring-cloud-stream") - .classifier("test-binder").type("test-jar").scope(DependencyScope.TEST_COMPILE)); + // TODO: https://github.com/spring-io/initializr/issues/1159 + if (build instanceof MavenBuild) { + build.dependencies().add("cloud-stream-test", + Dependency.withCoordinates("org.springframework.cloud", "spring-cloud-stream") + .classifier("test-binder").type("test-jar").scope(DependencyScope.TEST_COMPILE)); + } } } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudStreamBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudStreamBuildCustomizerTests.java index 841326a2a08..c2402c30984 100755 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudStreamBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudStreamBuildCustomizerTests.java @@ -180,6 +180,12 @@ void springCloudTurbineStreamWithAllBinders() { .hasDependenciesSize(9); } + @Test + void springCloudStreamWithGradleBuildDoesNotAddTestDependency() { + ProjectRequest request = createProjectRequest("cloud-stream", "amqp"); + assertThat(gradleBuild(request)).doesNotContain("test-binder"); + } + private static Dependency springCloudStreamTestDependency() { Dependency scsTest = Dependency.withId("cloud-stream-test", "org.springframework.cloud", "spring-cloud-stream", null, Dependency.SCOPE_TEST);