Class MavenResolutionResult

java.lang.Object
org.openrewrite.maven.tree.MavenResolutionResult
All Implemented Interfaces:
org.openrewrite.marker.Marker

public class MavenResolutionResult extends Object implements org.openrewrite.marker.Marker
  • Constructor Details

    • MavenResolutionResult

      public MavenResolutionResult()
  • Method Details

    • getActiveProfiles

      public List<String> getActiveProfiles()
    • unsafeSetManagedReference

      public MavenResolutionResult unsafeSetManagedReference(Integer id)
    • getResolvedDependency

      @Nullable public @Nullable ResolvedDependency getResolvedDependency(Dependency dependency)
    • findDependencies

      public List<ResolvedDependency> findDependencies(String groupId, String artifactId, @Nullable @Nullable Scope scope)
      Finds dependencies (including any transitive dependencies) in the model that match the provided group and artifact ids. The search can optionally be limited to a given scope.

      Note: It is possible for the same dependency to be returned multiple times if it is present in multiple scopes.

      Parameters:
      groupId - The groupId as a glob expression
      artifactId - The artifactId as a glob expression
      scope - The scope to limit the search to, or null to search all scopes
      Returns:
      A list of matching dependencies
    • findDependencies

      public List<ResolvedDependency> findDependencies(Predicate<ResolvedDependency> matcher, @Nullable @Nullable Scope scope)
      Finds dependencies (including any transitive dependencies) in the model that match the predicate. The search can optionally be limited to a given scope.

      Note: It is possible for the same dependency to be returned multiple times if it is present in multiple scopes.

      Parameters:
      matcher - The predicate to match the dependency
      scope - A scope to limit the search to, or null to search all scopes
      Returns:
      A list of matching dependencies
    • unsafeSet

      public void unsafeSet(UUID id, ResolvedPom pom, List<MavenResolutionResult> modules, @Nullable @Nullable MavenResolutionResult parent, Map<Scope,List<ResolvedDependency>> dependencies)
    • unsafeSetParent

      public void unsafeSetParent(MavenResolutionResult parent)
    • unsafeSetModules

      public void unsafeSetModules(@Nullable @Nullable List<MavenResolutionResult> modules)
    • getResolvedManagedDependency

      @Nullable public @Nullable ResolvedManagedDependency getResolvedManagedDependency(ManagedDependency dependency)
    • resolveDependencies

      public MavenResolutionResult resolveDependencies(MavenPomDownloader downloader, org.openrewrite.ExecutionContext ctx) throws MavenDownloadingExceptions
      Throws:
      MavenDownloadingExceptions
    • getProjectPoms

      public Map<Path,Pom> getProjectPoms()