diff --git a/build.gradle b/build.gradle index 66a8d3b7c..5898f870e 100644 --- a/build.gradle +++ b/build.gradle @@ -20,13 +20,14 @@ versionFile << version repositories { maven { url "https://sig-repo.synopsys.com/bds-bdio-release" } + mavenLocal() } dependencies { api 'com.synopsys.integration:blackduck-common-api:2022.10.4' api 'com.synopsys.integration:phone-home-client:5.1.7' - api 'com.synopsys.integration:integration-bdio:26.0.7' + api 'com.synopsys.integration:integration-bdio:26.0.8-SNAPSHOT' api 'com.blackducksoftware.bdio:bdio2:3.2.5' diff --git a/src/main/java/com/synopsys/integration/blackduck/bdio2/util/Bdio2Factory.java b/src/main/java/com/synopsys/integration/blackduck/bdio2/util/Bdio2Factory.java index d7ae5690d..850a3b01c 100644 --- a/src/main/java/com/synopsys/integration/blackduck/bdio2/util/Bdio2Factory.java +++ b/src/main/java/com/synopsys/integration/blackduck/bdio2/util/Bdio2Factory.java @@ -179,7 +179,13 @@ private Pair, List> createAndLinkComponentsFromGraph( } } else { Component component = componentFromDependency(dependency); - linkComponentDependency.dependency(new com.blackducksoftware.bdio2.model.Dependency().dependsOn(component)); + com.blackducksoftware.bdio2.model.Dependency dependencyEntry = new com.blackducksoftware.bdio2.model.Dependency().dependsOn(component); + + if (dependency.getScope() != null) { + dependencyEntry = dependencyEntry.scope(dependency.getScope()); + } + + linkComponentDependency.dependency(dependencyEntry); if (!existingComponents.containsKey(dependency.getExternalId())) { addedComponents.add(component); diff --git a/src/test/java/com/synopsys/integration/blackduck/bdio2/util/Bdio2FactoryTest.java b/src/test/java/com/synopsys/integration/blackduck/bdio2/util/Bdio2FactoryTest.java index e76b606da..26af97c33 100644 --- a/src/test/java/com/synopsys/integration/blackduck/bdio2/util/Bdio2FactoryTest.java +++ b/src/test/java/com/synopsys/integration/blackduck/bdio2/util/Bdio2FactoryTest.java @@ -44,7 +44,7 @@ void testCreateAndLinkComponents() { DependencyGraph dependencyGraph = Mockito.mock(DependencyGraph.class); Set dependencies = new HashSet<>(); ProjectDependency subProjectDependency = new ProjectDependency(subProjectName, subProjectVersion, subProjectExternalId); - Dependency componentDependency = new Dependency(componentExternalId); + Dependency componentDependency = new Dependency(componentExternalId, null); dependencies.add(subProjectDependency); dependencies.add(componentDependency); Mockito.when(dependencyGraph.getDirectDependencies()).thenReturn(dependencies);