Package org.spdx.sbom.gradle.maven
Class PomResolver
java.lang.Object
org.spdx.sbom.gradle.maven.PomResolver
This needs to be run *before* while configuring the task, so use it in the Plugin.
-
Method Summary
Modifier and TypeMethodDescriptioneffectivePoms(List<org.gradle.api.artifacts.result.ResolvedArtifactResult> resolvedPomArtifacts) static PomResolvernewPomResolver(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.
-
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:
- 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. - Resolving Dependencies: With the component identifiers collected, the class then
proceeds to resolve these dependencies. This is done using the
DependencyHandlerto 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 byMavenPomArtifact). - Collecting Artifacts: The final output is a list of
ResolvedArtifactResultinstances, 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:
-
DependencyHandlerResolvedArtifactResult
- 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
-
effectivePoms
-