diff --git a/src/main/groovy/netflix/nebula/dependency/recommender/DependencyRecommendationsPlugin.java b/src/main/groovy/netflix/nebula/dependency/recommender/DependencyRecommendationsPlugin.java index 855cdfc..9ac0bc0 100644 --- a/src/main/groovy/netflix/nebula/dependency/recommender/DependencyRecommendationsPlugin.java +++ b/src/main/groovy/netflix/nebula/dependency/recommender/DependencyRecommendationsPlugin.java @@ -34,24 +34,24 @@ public void execute(ResolvableDependencies resolvableDependencies) { for (Dependency dependency : resolvableDependencies.getDependencies()) { rsFactory.getRecommendationStrategy().inspectDependency(dependency); } - } - }); - conf.getResolutionStrategy().eachDependency(new Action() { - @Override - public void execute(DependencyResolveDetails details) { - ModuleVersionSelector requested = details.getRequested(); + conf.getResolutionStrategy().eachDependency(new Action() { + @Override + public void execute(DependencyResolveDetails details) { + ModuleVersionSelector requested = details.getRequested(); - // don't interfere with the way forces trump everything - for (ModuleVersionSelector force : conf.getResolutionStrategy().getForcedModules()) { - if (requested.getGroup().equals(force.getGroup()) && requested.getName().equals(force.getName())) { - return; + // don't interfere with the way forces trump everything + for (ModuleVersionSelector force : conf.getResolutionStrategy().getForcedModules()) { + if (requested.getGroup().equals(force.getGroup()) && requested.getName().equals(force.getName())) { + return; + } + } + String version = getRecommendedVersionRecursive(project, requested); + if(rsFactory.getRecommendationStrategy().recommendVersion(details, version)) { + logger.info("Recommending version " + version + " for dependency " + requested.getGroup() + ":" + requested.getName()); + } } - } - String version = getRecommendedVersionRecursive(project, requested); - if(rsFactory.getRecommendationStrategy().recommendVersion(details, version)) { - logger.info("Recommending version " + version + " for dependency " + requested.getGroup() + ":" + requested.getName()); - } + }); } }); }