in src/main/java/org/apache/sling/cli/impl/nexus/RepositoryService.java [220:245]
public Set<Release> getReleases(StagingRepository stagingRepository) throws IOException {
Set<Release> releases = new HashSet<>();
getArtifacts(stagingRepository).stream().filter(artifact -> "pom".equals(artifact.getType())).forEach(pom -> {
try {
XPath xPath = xPathFactory.newXPath();
processArtifactStream(pom, stream -> {
try {
DocumentBuilder builder = builderFactory.newDocumentBuilder();
Document xmlDocument = builder.parse(stream);
String name = (String) xPath.compile("/project/name/text()").evaluate(xmlDocument, XPathConstants.STRING);
String version = (String) xPath.compile("/project/version/text()").evaluate(xmlDocument, XPathConstants.STRING);
try {
releases.addAll(Release.fromString(name + " " + version));
} catch (IllegalArgumentException e) {
LOGGER.error(String.format("Unable to determine a valid release from '%s %s'", name, version), e);
}
} catch (ParserConfigurationException | SAXException | XPathExpressionException | IOException e) {
LOGGER.error(String.format("Unable to process artifact %s.", pom), e);
}
});
} catch (IOException e) {
LOGGER.error(String.format("Unable to process artifact %s.", pom), e);
}
});
return Set.copyOf(releases);
}