Only analyze configurations that we've registered to check

See gh-12784
pull/12960/head
danhyun 7 years ago committed by Andy Wilkinson
parent 806978b8f1
commit 1e447ebfbf

@ -42,6 +42,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootWar;
* @author Phillip Webb * @author Phillip Webb
* @author Dave Syer * @author Dave Syer
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Danny Hyun
*/ */
public class SpringBootPlugin implements Plugin<Project> { public class SpringBootPlugin implements Plugin<Project> {
@ -121,10 +122,14 @@ public class SpringBootPlugin implements Plugin<Project> {
private void unregisterUnresolvedDependenciesAnalyzer(Project project) { private void unregisterUnresolvedDependenciesAnalyzer(Project project) {
UnresolvedDependenciesAnalyzer unresolvedDependenciesAnalyzer = new UnresolvedDependenciesAnalyzer(); UnresolvedDependenciesAnalyzer unresolvedDependenciesAnalyzer = new UnresolvedDependenciesAnalyzer();
project.getConfigurations().all((configuration) -> configuration.getIncoming() project.getConfigurations().all((configuration) -> configuration.getIncoming()
.afterResolve((resolvableDependencies) -> unresolvedDependenciesAnalyzer .afterResolve((resolvableDependencies) -> {
if (configuration.getIncoming().equals(resolvableDependencies)) {
unresolvedDependenciesAnalyzer
.analyze(configuration.getResolvedConfiguration() .analyze(configuration.getResolvedConfiguration()
.getLenientConfiguration() .getLenientConfiguration()
.getUnresolvedModuleDependencies()))); .getUnresolvedModuleDependencies());
}
}));
project.getGradle().buildFinished( project.getGradle().buildFinished(
(buildResult) -> unresolvedDependenciesAnalyzer.buildFinished(project)); (buildResult) -> unresolvedDependenciesAnalyzer.buildFinished(project));
} }

Loading…
Cancel
Save