in repository/service/src/main/java/org/apache/karaf/cave/repository/service/maven/MavenServlet.java [514:543]
private boolean install(File file, String path) {
Matcher artifactMatcher = ARTIFACT_REQUEST_URL_REGEX.matcher(path);
Matcher metadataMatcher = ARTIFACT_METADATA_URL_REGEX.matcher(path);
if (metadataMatcher.matches()) {
LOGGER.info("Received upload request for maven metadata : {}", path);
try {
MavenCoord coord = convertMetadataPathToCoord(path);
resolver.uploadMetadata(coord.groupId, coord.artifactId, coord.type, coord.version, file);
LOGGER.info("Maven metadata installed: {}", coord.toString());
return true;
} catch (Exception e) {
LOGGER.warn(String.format("Failed to upload metadata: %s due to %s", path, e.getMessage()), e);
return false;
}
//If no matching metadata found return nothing
} else if (artifactMatcher.matches()) {
LOGGER.info("Received upload request for maven artifact : {}", path);
try {
MavenCoord coord = convertArtifactPathToCoord(path);
resolver.upload(coord.groupId, coord.artifactId, coord.classifier, coord.type, coord.version, file);
LOGGER.info("Artifact installed: {}", coord.toString());
return true;
} catch (Exception e) {
LOGGER.warn(String.format("Failed to upload artifact : %s due to %s", path, e.getMessage()), e);
return false;
}
}
return false;
}