private AetherRepositoryWriter() {
}
public static void write(Set<Artifact> artifacts, String targetDirectory) throws MojoExecutionException {
RepositoryLayout m2layout = new MavenDefaultLayout();
for (Artifact artifact : artifacts) {
File src = artifact.getFile();
// set the version (which could be a resolved snapshot) to the base version (which in that case would be
// literally SNAPSHOT), because that is what lily runtime expects.
artifact = artifact.setVersion(artifact.getBaseVersion());
File dest = new File(targetDirectory, m2layout.getPath(artifact).getPath());
try {
System.out.println("Copying " + src + " to " + dest);
FileUtils.copyFile(src, dest);
} catch (IOException e) {
throw new MojoExecutionException("Error copying file " + src + " to " + dest);