Search in sources :

Example 46 with Dependency

use of com.synopsys.integration.bdio.model.dependency.Dependency in project hub-detect by blackducksoftware.

the class BazelCodeLocationBuilder method addDependency.

public BazelCodeLocationBuilder addDependency(final BazelExternalId bazelExternalId) {
    try {
        logger.debug(String.format("Adding dependency from external id: %s", bazelExternalId));
        final ExternalId externalId = externalIdFactory.createMavenExternalId(bazelExternalId.getGroup(), bazelExternalId.getArtifact(), bazelExternalId.getVersion());
        Dependency artifactDependency = new Dependency(bazelExternalId.getArtifact(), bazelExternalId.getVersion(), externalId);
        dependencyGraph.addChildToRoot(artifactDependency);
    } catch (Exception e) {
        logger.error(String.format("Unable to parse group:artifact:version from %s", bazelExternalId));
    }
    return this;
}
Also used : ExternalId(com.synopsys.integration.bdio.model.externalid.ExternalId) Dependency(com.synopsys.integration.bdio.model.dependency.Dependency)

Aggregations

Dependency (com.synopsys.integration.bdio.model.dependency.Dependency)46 ExternalId (com.synopsys.integration.bdio.model.externalid.ExternalId)23 ExternalIdFactory (com.synopsys.integration.bdio.model.externalid.ExternalIdFactory)12 MutableMapDependencyGraph (com.synopsys.integration.bdio.graph.MutableMapDependencyGraph)11 Test (org.junit.Test)11 MutableDependencyGraph (com.synopsys.integration.bdio.graph.MutableDependencyGraph)10 DetectCodeLocation (com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocation)9 DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)5 File (java.io.File)5 DependencyHistory (com.blackducksoftware.integration.hub.detect.util.DependencyHistory)4 ArrayList (java.util.ArrayList)3 Extraction (com.blackducksoftware.integration.hub.detect.workflow.extraction.Extraction)2 Gson (com.google.gson.Gson)2 Forge (com.synopsys.integration.bdio.model.Forge)2 NpmDependency (com.blackducksoftware.integration.hub.detect.detector.npm.model.NpmDependency)1 PackageLockDependency (com.blackducksoftware.integration.hub.detect.detector.npm.model.PackageLockDependency)1 DetectUserFriendlyException (com.blackducksoftware.integration.hub.detect.exception.DetectUserFriendlyException)1 DetectCodeLocationType (com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocationType)1 JsonObject (com.google.gson.JsonObject)1 JsonPrimitive (com.google.gson.JsonPrimitive)1