@Test void reportWithMavenAndFiles() throws Exception { List<Artifact> artifacts = readIQDataToArtifacts("ReportWithMavenAndFiles.json"); Map<String, IAttachable> map = generator.produce(artifacts); IAttachable attachable = map.get("cyclonedx-bom"); File bomFile = attachable.getFile(); Bom bom = new BomParser().parse(bomFile); assertThat(bom.getComponents()).hasSize(30); }
@Override public Map<String, IAttachable> produce(Collection<Artifact> artifacts) throws ExecutionException { LOG.debug("Created a cyclone-dx bill-of-material for {} artifacts", artifacts.size()); List<Component> components = toComponents(artifacts); Bom bom = new Bom(); bom.setComponents(components); BomGenerator gen = BomGeneratorFactory.create(CycloneDxSchema.Version.VERSION_11, bom); File targetFile = createTargetFile(); doGenerate(gen, targetFile); LOG.debug("Bill-of-material created in {}", targetFile); return Collections.singletonMap("cyclonedx-bom", new Attachable("xml", "cyclonedx-bom", targetFile)); }
CycloneDXGenerator extends AbstractGenerator { @Override public Map<String, IAttachable> produce(Collection<Artifact> artifacts) throws ExecutionException { LOG.debug("Created a cyclone-dx bill-of-material for {} artifacts", artifacts.size()); List<Component> components = toComponents(artifacts); Bom bom = new Bom(); bom.setComponents(components); BomGenerator gen = BomGeneratorFactory.create(CycloneDxSchema.Version.VERSION_11, bom); File targetFile = createTargetFile(); doGenerate(gen, targetFile); LOG.debug("Bill-of-material created in {}", targetFile); return Collections.singletonMap("cyclonedx-bom", new Attachable("xml", "cyclonedx-bom", targetFile)); } }
CycloneDXGenerator extends AbstractGenerator { @Override public Map<String, IAttachable> produce(Collection<Artifact> artifacts) throws ExecutionException { LOG.debug("Created a cyclone-dx bill-of-material for {} artifacts", artifacts.size()); List<Component> components = toComponents(artifacts); Bom bom = new Bom(); bom.setComponents(components); BomGenerator gen = BomGeneratorFactory.create(CycloneDxSchema.Version.VERSION_11, bom); File targetFile = createTargetFile(); doGenerate(gen, targetFile); LOG.debug("Bill-of-material created in {}", targetFile); return Collections.singletonMap("cyclonedx-bom", new Attachable("xml", "cyclonedx-bom", targetFile)); }  }
CycloneDXGenerator extends AbstractGenerator { @Override public Map<String, IAttachable> produce(Collection<Artifact> artifacts) throws ExecutionException { LOG.debug("Created a cyclone-dx bill-of-material for {} artifacts", artifacts.size()); List<Component> components = toComponents(artifacts); Bom bom = new Bom(); bom.setComponents(components); BomGenerator gen = BomGeneratorFactory.create(CycloneDxSchema.Version.VERSION_11, bom); File targetFile = createTargetFile(); doGenerate(gen, targetFile); LOG.debug("Bill-of-material created in {}", targetFile); return Collections.singletonMap("cyclonedx-bom", new Attachable("xml", "cyclonedx-bom", targetFile)); }  @Override Map<String, IAttachable> produce(Collection<Artifact> artifacts); }
CycloneDXGenerator extends AbstractGenerator { @Override public Map<String, IAttachable> produce(Collection<Artifact> artifacts) throws ExecutionException { LOG.debug("Created a cyclone-dx bill-of-material for {} artifacts", artifacts.size()); List<Component> components = toComponents(artifacts); Bom bom = new Bom(); bom.setComponents(components); BomGenerator gen = BomGeneratorFactory.create(CycloneDxSchema.Version.VERSION_11, bom); File targetFile = createTargetFile(); doGenerate(gen, targetFile); LOG.debug("Bill-of-material created in {}", targetFile); return Collections.singletonMap("cyclonedx-bom", new Attachable("xml", "cyclonedx-bom", targetFile)); }  @Override Map<String, IAttachable> produce(Collection<Artifact> artifacts);  }