Class ClasspathBasedRecommendationProvider

java.lang.Object
netflix.nebula.dependency.recommender.provider.AbstractRecommendationProvider
netflix.nebula.dependency.recommender.provider.ClasspathBasedRecommendationProvider
All Implemented Interfaces:
RecommendationProvider
Direct Known Subclasses:
MavenBomRecommendationProvider

public abstract class ClasspathBasedRecommendationProvider extends AbstractRecommendationProvider
  • Field Details

    • project

      protected org.gradle.api.Project project
    • configuration

      protected org.gradle.api.artifacts.Configuration configuration
    • configName

      protected String configName
    • bomResolverService

      protected org.gradle.api.provider.Provider<BomResolverService> bomResolverService
  • Method Details

    • getBomRecommendations

      protected Map<String,String> getBomRecommendations(Set<String> reasons)
      Retrieves BOM recommendations using the shared BomResolverService.

      This method delegates to the build service to get cached BOM recommendations, avoiding direct configuration resolution that could cause lock conflicts in parallel builds. The build service ensures that all BOM resolution happens during the configuration phase when exclusive locks are available.

      Parameters:
      reasons - a mutable set that will be populated with reasons explaining why specific recommendations were applied
      Returns:
      a map of dependency coordinates (groupId:artifactId) to recommended versions
      Throws:
      RuntimeException - if the build service is not available or BOM resolution fails