diff --git a/project-plugin/src/main/java/org/springframework/gradle/propdeps/SpringPropDepsPlugin.java b/project-plugin/src/main/java/org/springframework/gradle/propdeps/SpringPropDepsPlugin.java index 3b9f5df..f8175f4 100644 --- a/project-plugin/src/main/java/org/springframework/gradle/propdeps/SpringPropDepsPlugin.java +++ b/project-plugin/src/main/java/org/springframework/gradle/propdeps/SpringPropDepsPlugin.java @@ -77,8 +77,12 @@ private Configuration addConfiguration(Project project, String name) { JavaPluginExtension java = project.getExtensions().getByType(JavaPluginExtension.class); java.getSourceSets().all((sourceSet) -> { - sourceSet.setCompileClasspath(sourceSet.getCompileClasspath().plus(configuration)); - sourceSet.setRuntimeClasspath(sourceSet.getRuntimeClasspath().plus(configuration)); + project.getConfigurations() + .getByName(sourceSet.getCompileClasspathConfigurationName()) + .extendsFrom(configuration); + project.getConfigurations() + .getByName(sourceSet.getRuntimeClasspathConfigurationName()) + .extendsFrom(configuration); }); return configuration;