Search in sources :

Example 1 with CompositeDependencyManagement

use of org.springframework.boot.cli.compiler.dependencies.CompositeDependencyManagement in project spring-boot by spring-projects.

the class DependencyResolutionContext method addDependencyManagement.

public void addDependencyManagement(DependencyManagement dependencyManagement) {
    for (org.springframework.boot.cli.compiler.dependencies.Dependency dependency : dependencyManagement.getDependencies()) {
        List<Exclusion> aetherExclusions = new ArrayList<>();
        for (org.springframework.boot.cli.compiler.dependencies.Dependency.Exclusion exclusion : dependency.getExclusions()) {
            aetherExclusions.add(new Exclusion(exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*"));
        }
        Dependency aetherDependency = new Dependency(new DefaultArtifact(dependency.getGroupId(), dependency.getArtifactId(), "jar", dependency.getVersion()), JavaScopes.COMPILE, false, aetherExclusions);
        this.managedDependencies.add(0, aetherDependency);
        this.managedDependencyByGroupAndArtifact.put(getIdentifier(aetherDependency), aetherDependency);
    }
    this.dependencyManagement = this.dependencyManagement == null ? dependencyManagement : new CompositeDependencyManagement(dependencyManagement, this.dependencyManagement);
    this.artifactCoordinatesResolver = new DependencyManagementArtifactCoordinatesResolver(this.dependencyManagement);
}
Also used : ArrayList(java.util.ArrayList) Dependency(org.eclipse.aether.graph.Dependency) DependencyManagementArtifactCoordinatesResolver(org.springframework.boot.cli.compiler.dependencies.DependencyManagementArtifactCoordinatesResolver) Exclusion(org.eclipse.aether.graph.Exclusion) CompositeDependencyManagement(org.springframework.boot.cli.compiler.dependencies.CompositeDependencyManagement) DefaultArtifact(org.eclipse.aether.artifact.DefaultArtifact)

Aggregations

ArrayList (java.util.ArrayList)1 DefaultArtifact (org.eclipse.aether.artifact.DefaultArtifact)1 Dependency (org.eclipse.aether.graph.Dependency)1 Exclusion (org.eclipse.aether.graph.Exclusion)1 CompositeDependencyManagement (org.springframework.boot.cli.compiler.dependencies.CompositeDependencyManagement)1 DependencyManagementArtifactCoordinatesResolver (org.springframework.boot.cli.compiler.dependencies.DependencyManagementArtifactCoordinatesResolver)1