/** * Sets the suffix that distinguish product artifacts in the repository. * @param suffix Suffix of the product artifacts. */ public void setVersionSuffix(String suffix) { versionParser = new VersionParser(suffix); }
Set<ArtifactDiff> ret = new HashSet<>(); VersionComparator comparator = new VersionComparator(new VersionParser(VersionParser.DEFAULT_SUFFIX)); for(GA ga : allGAs){ String leftVersion = leftGAs.get(ga);
private List<LookupReport> createLookupReports(LookupGAVsRequest request, Map<GA, CompletableFuture<Set<ProductArtifacts>>> gaProductArtifactsMap) throws CommunicationException { List<CompletableFuture<Void>> futures = new ArrayList<>(); List<LookupReport> reports = new ArrayList<>(); String suffix = request.getVersionSuffix(); VersionParser versionParser; if (suffix == null || suffix.isEmpty()) { versionParser = new VersionParser(VersionParser.DEFAULT_SUFFIX); }else{ versionParser = new VersionParser(suffix); } request.getGavs().stream() .distinct() .forEach((gav) -> { LookupReport lr = new LookupReport(gav); reports.add(lr); CompletableFuture<Set<ProductArtifacts>> artifacts = gaProductArtifactsMap.get(gav.getGA()); futures.add(analyzeVersions(versionParser, gav.getVersion(), artifacts).thenAccept(v -> { lr.setAvailableVersions(v.getAvailableVersions()); lr.setBestMatchVersion(v.getBestMatchVersion().orElse(null)); })); futures.add(artifacts.thenAccept(pas -> { lr.setWhitelisted(toWhitelisted(pas)); })); lr.setBlacklisted(blackArtifactService.isArtifactPresent(gav)); }); joinFutures(futures); return reports; }
@Override public Set<BuiltReportModule> getBuiltReport(SCMLocator scml) throws ScmException, PomAnalysisException, CommunicationException { VersionParser versionParser = new VersionParser(VersionParser.DEFAULT_SUFFIX); Map<GA, Set<GAV>> dependenciesOfModules = scmConnector.getDependenciesOfModules( scml.getScmUrl(), scml.getRevision(), scml.getPomPath(), scml.getRepositories()); Set<CompletableFuture<BuiltReportModule>> builtSet = new HashSet<>(); for (Map.Entry<GA, Set<GAV>> e : dependenciesOfModules.entrySet()) { for (GAV gav : e.getValue()) { CompletableFuture<Set<ProductArtifacts>> artifacts = productProvider.getArtifacts(gav.getGA()); artifacts = filterBuiltArtifacts(artifacts); builtSet.add(analyzeVersions(versionParser, gav.getVersion(), artifacts) .thenApply(v -> toBuiltReportModule(gav, v))); } } return joinFutures(builtSet); }
private CompletableFuture<Void> fillArtifactReport(ArtifactReport report, Set<Product> products) { GAV gav = report.getGav(); CompletableFuture<Set<ProductArtifacts>> artifacts = productProvider.getArtifacts(gav .getGA()); artifacts = filterProductArtifacts(products, artifacts); report.setBlacklisted(blackArtifactService.isArtifactPresent(gav)); VersionParser parser = new VersionParser(VersionParser.DEFAULT_SUFFIX); CompletableFuture<Void> fillVersions = analyzeVersions(parser, gav.getVersion(), artifacts) .thenAccept(v -> { report.setAvailableVersions(v.getAvailableVersions()); report.setBestMatchVersion(v.getBestMatchVersion()); }); CompletableFuture<Void> fillWhitelist = artifacts.thenAccept(pas -> { List<Product> whiteProducts = pas.stream() .map(pa -> pa.getProduct()) .filter(p -> !UNKNOWN.equals(p)) .collect(Collectors.toList()); report.setWhitelisted(whiteProducts); }); return CompletableFuture.allOf(fillVersions, fillWhitelist); }
boolean useUnknownProduct, Set<Long> productIds) throws ScmException, PomAnalysisException, CommunicationException { VersionParser versionParser = new VersionParser(VersionParser.DEFAULT_SUFFIX); Map<GA, Set<GAV>> dependenciesOfModules = scmConnector.getDependenciesOfModules( scml.getScmUrl(), scml.getRevision(), scml.getPomPath(), scml.getRepositories());
private void populateAdvancedArtifactReportFields(AdvancedArtifactReport advancedReport, ArtifactReport report, Set<GAV> modulesAnalyzed, File repoFolder) { VersionParser parser = new VersionParser(VersionParser.DEFAULT_SUFFIX);