FilePath target = getArtifactArchivePath(build,groupId,artifactId,version);
FilePath origin = new FilePath(file);
if (!target.exists()) {
listener.getLogger().println("[JENKINS] Archiving "+ file+" to "+target);
origin.copyTo(target);
} else if (!origin.digest().equals(target.digest())) {
listener.getLogger().println("[JENKINS] Re-archiving "+file);
origin.copyTo(target);
} else {
LOGGER.fine("Not actually archiving "+origin+" due to digest match");
}