From 8757f63360643030b9725f222c60422d7b3f806c Mon Sep 17 00:00:00 2001 From: Vedran Pavic Date: Fri, 10 Jan 2020 21:40:35 +0100 Subject: [PATCH] Reuse optional configuration name constant See gh-19620 --- .../boot/build/optional/OptionalDependenciesPlugin.java | 2 +- .../optional/OptionalDependenciesPluginIntegrationTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/optional/OptionalDependenciesPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/optional/OptionalDependenciesPlugin.java index 0f622fcee8..87ab9c41d5 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/optional/OptionalDependenciesPlugin.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/optional/OptionalDependenciesPlugin.java @@ -44,7 +44,7 @@ public class OptionalDependenciesPlugin implements Plugin { @Override public void apply(Project project) { - Configuration optional = project.getConfigurations().create("optional"); + Configuration optional = project.getConfigurations().create(OPTIONAL_CONFIGURATION_NAME); optional.attributes((attributes) -> attributes.attribute(Usage.USAGE_ATTRIBUTE, project.getObjects().named(Usage.class, Usage.JAVA_RUNTIME))); project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> { diff --git a/buildSrc/src/test/java/org/springframework/boot/build/optional/OptionalDependenciesPluginIntegrationTests.java b/buildSrc/src/test/java/org/springframework/boot/build/optional/OptionalDependenciesPluginIntegrationTests.java index d5585ee9e6..c6bb5f64c3 100644 --- a/buildSrc/src/test/java/org/springframework/boot/build/optional/OptionalDependenciesPluginIntegrationTests.java +++ b/buildSrc/src/test/java/org/springframework/boot/build/optional/OptionalDependenciesPluginIntegrationTests.java @@ -57,7 +57,7 @@ public class OptionalDependenciesPluginIntegrationTests { out.println("}"); } BuildResult buildResult = runGradle("printConfigurations"); - assertThat(buildResult.getOutput()).contains("optional"); + assertThat(buildResult.getOutput()).contains(OptionalDependenciesPlugin.OPTIONAL_CONFIGURATION_NAME); } @Test