Class PomResolver

java.lang.Object
org.spdx.sbom.gradle.maven.PomResolver

public class PomResolver extends Object
This needs to be run *before* while configuring the task, so use it in the Plugin.
  • Method Summary

    Modifier and Type
    Method
    Description
    effectivePoms(List<org.gradle.api.artifacts.result.ResolvedArtifactResult> resolvedPomArtifacts)
     
    newPomResolver(org.gradle.api.artifacts.dsl.DependencyHandler dependencies, org.gradle.api.artifacts.ConfigurationContainer configurations, org.gradle.api.logging.Logger logger)
     
    List<org.gradle.api.artifacts.result.ResolvedArtifactResult>
    resolvePomArtifacts(List<org.gradle.api.artifacts.result.ResolvedComponentResult> rootComponents)
    resolvePomArtifacts identifies and collects the component identifiers for dependencies in a project's dependency graph, focusing specifically on Maven POM artifacts.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • newPomResolver

      public static PomResolver newPomResolver(org.gradle.api.artifacts.dsl.DependencyHandler dependencies, org.gradle.api.artifacts.ConfigurationContainer configurations, org.gradle.api.logging.Logger logger)
    • resolvePomArtifacts

      public List<org.gradle.api.artifacts.result.ResolvedArtifactResult> resolvePomArtifacts(List<org.gradle.api.artifacts.result.ResolvedComponentResult> rootComponents)
      resolvePomArtifacts identifies and collects the component identifiers for dependencies in a project's dependency graph, focusing specifically on Maven POM artifacts.

      Process:

      1. Identifying Component Identifiers: The process starts by identifying the component identifiers of all dependencies in a project's dependency graph. This is achieved by iterating over the root components (instances of ResolvedComponentResult) of the dependency graph. Each root component is analyzed to extract its dependencies and their respective component identifiers.
      2. Resolving Dependencies: With the component identifiers collected, the class then proceeds to resolve these dependencies. This is done using the DependencyHandler to create an artifact resolution query. The query targets the collected component identifiers and specifies the types of artifacts to resolve, in this case, Maven POM artifacts (represented by MavenPomArtifact).
      3. Collecting Artifacts: The final output is a list of ResolvedArtifactResult instances, representing the resolved Maven POM artifacts. Each ResolvedArtifactResult provides access to the artifact file and metadata.

      Result: The outcome is a list of ResolvedArtifactResult, which provides access to the files of resolved Maven POM artifacts, giving detailed insight into the project's Maven dependencies.

      See Also:
      • DependencyHandler
      • ResolvedArtifactResult
    • effectivePoms

      public Map<String,PomInfo> effectivePoms(List<org.gradle.api.artifacts.result.ResolvedArtifactResult> resolvedPomArtifacts)