in src/main/java/org/apache/sling/feature/io/artifacts/ArtifactManager.java [451:468]
private Path getArtifactFromMvn(final ArtifactId artifactId) {
final Path filePath = Paths.get(config.getMvnHome(), artifactId.toMvnPath().replace("/", java.nio.file.FileSystems.getDefault().getSeparator()));
logger.debug("Trying to fetch artifact {} from local mvn repository {}", artifactId.toMvnId(), filePath);
if (!Files.exists(filePath) || !Files.isRegularFile(filePath) || Files.isReadable(filePath)) {
logger.debug("Trying to download {}", artifactId.toMvnId());
try {
this.downloadArtifact(artifactId);
} catch (final IOException ioe) {
logger.debug("Error downloading file.", ioe);
}
if (!Files.exists(filePath) || !Files.isRegularFile(filePath) || !Files.isReadable(filePath)) {
logger.info("Artifact not found {}", artifactId.toMvnId());
return null;
}
}
return filePath;
}