public static Path copyArtifactToDirectory(@Nonnull Path sourceDir, @Nonnull String artifactId, @Nonnull Path dest) throws RuntimeIOException {
Path source = findArtifact(sourceDir, artifactId);
try {
return Files.copy(source, dest.resolve(source.getFileName()));
} catch (IOException e) {
throw new RuntimeIOException("Exception copying " + source.getFileName() + " to " + sourceDir, e);
}
}