// do not deploy snapshots into the repository
return;
}
Dependency asDependency = new Dependency(pom.getCoordinates());
IMavenCache artifactCache = getArtifactCache(pom.isSnapshot());
File cacheRoot = artifactCache.getRootFolder();
File artifactFile = artifactCache.getArtifact(asDependency, asDependency.extension);
File artifactDir = artifactFile.getParentFile();
File sourceDir = build.getConfig().getTargetDirectory();
titleClass(pom.artifactId + "-" + pom.version);
if (asDependency.isSnapshot()) {
deploySnapshot(pom, sourceDir, artifactDir, artifactCache);
} else {
deployRelease(pom, sourceDir, artifactDir, true);
}
// updates the prefixes index
artifactCache.updatePrefixesIndex();
if (generateIndexPage) {
boolean extracted = extractResource(cacheRoot, "maven/index.html", "index.html", false);
extractResource(cacheRoot, "maven/favicon.png", "favicon.png", false);
if (extracted) {
// create JSON repository metadata
String template = readResourceAsString("maven/repository.json").trim();
template = getProject().replaceProperties(template);
FileUtils.writeContent(new File(cacheRoot, "repository.json"), template);
}
// create/update JSON artifact index
String template = readResourceAsString("maven/artifact.json").trim();
StringBuilder sb = new StringBuilder("[\n\n");
String index = artifactCache.generatePomIndex(template, ",\n");
sb.append(index);
sb.append("\n]\n");
FileUtils.writeContent(new File(cacheRoot, "artifacts.json"), sb.toString());
}
}