Skip to content

Commit decf234

Browse files
committed
Move away from ProjectDependency#getDependencyProject()
Closes gh-42870
1 parent b165370 commit decf234

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

buildSrc/src/main/java/org/springframework/boot/build/MavenRepositoryPlugin.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
package org.springframework.boot.build;
1818

1919
import java.io.File;
20-
import java.util.HashMap;
21-
import java.util.Map;
2220

2321
import org.gradle.api.Action;
2422
import org.gradle.api.Plugin;
@@ -97,10 +95,11 @@ private void addMavenRepositoryDependencies(Project project, String sourceConfig
9795
.getDependencies()
9896
.withType(ProjectDependency.class)
9997
.all((dependency) -> {
100-
Map<String, String> dependencyDescriptor = new HashMap<>();
101-
dependencyDescriptor.put("path", dependency.getDependencyProject().getPath());
102-
dependencyDescriptor.put("configuration", MAVEN_REPOSITORY_CONFIGURATION_NAME);
103-
target.add(project.getDependencies().project(dependencyDescriptor));
98+
ProjectDependency copy = dependency.copy();
99+
if (copy.getAttributes().isEmpty()) {
100+
copy.setTargetConfiguration(MAVEN_REPOSITORY_CONFIGURATION_NAME);
101+
}
102+
target.add(copy);
104103
});
105104
}
106105

0 commit comments

Comments
 (0)