private < P extends MavenDependentDescriptor , D extends AbstractDependencyDescriptor > List < MavenDependencyDescriptor > getDependencies ( P dependent , List < Dependency > dependencies , Class < D > dependsOnType , ScannerContext scannerContext ) { Store store = scannerContext . getStore ( ) ; List < MavenDependencyDescriptor > dependencyDescriptors = new ArrayList <> ( dependencies . size ( ) ) ; for ( Dependency dependency : dependencies ) { MavenArtifactDescriptor dependencyArtifactDescriptor = getMavenArtifactDescriptor ( dependency , scannerContext ) ; // Deprecated graph structure D dependsOnDescriptor = store . create ( dependent , dependsOnType , dependencyArtifactDescriptor ) ; dependsOnDescriptor . setOptional ( dependency . isOptional ( ) ) ; dependsOnDescriptor . setScope ( dependency . getScope ( ) ) ; // New graph structure supporting exclusions MavenDependencyDescriptor dependencyDescriptor = store . create ( MavenDependencyDescriptor . class ) ; dependencyDescriptor . setToArtifact ( dependencyArtifactDescriptor ) ; dependencyDescriptor . setOptional ( dependency . isOptional ( ) ) ; dependencyDescriptor . setScope ( dependency . getScope ( ) ) ; for ( Exclusion exclusion : dependency . getExclusions ( ) ) { MavenExcludesDescriptor mavenExcludesDescriptor = store . create ( MavenExcludesDescriptor . class ) ; mavenExcludesDescriptor . setGroupId ( exclusion . getGroupId ( ) ) ; mavenExcludesDescriptor . setArtifactId ( exclusion . getArtifactId ( ) ) ; dependencyDescriptor . getExclusions ( ) . add ( mavenExcludesDescriptor ) ; } dependencyDescriptors . add ( dependencyDescriptor ) ; } return dependencyDescriptors ; }
Adds information about artifact dependencies .