@GetMapping(path = "/ui/dependencies", produces = "application/json") public ResponseEntity<String> dependencies( @RequestParam(required = false) String version) { List<DependencyGroup> dependencyGroups = this.metadataProvider.get() .getDependencies().getContent(); List<DependencyItem> content = new ArrayList<>(); Version requestedVersion = (StringUtils.isEmpty(version) ? null : Version.parse(version)); dependencyGroups.forEach((group) -> group.getContent().forEach((dependency) -> { if (requestedVersion != null && dependency.getVersionRange() != null) { if (dependency.match(requestedVersion)) { content.add(new DependencyItem(group.getName(), dependency)); } } else { content.add(new DependencyItem(group.getName(), dependency)); } })); String json = writeDependencies(content); return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON) .eTag(createUniqueId(json)).body(json); }
Map<String, Dependency> dependencies = new LinkedHashMap<>(); for (Dependency dependency : metadata.getDependencies().getAll()) { if (dependency.match(bootVersion)) { dependencies.put(dependency.getId(), dependency.resolve(bootVersion));
if (!it.match(requestedVersion)) { throw new InvalidProjectRequestException( "Dependency '" + it.getId() + "' is not compatible "