if ("tar.gz".equals(artifact.getType())) {
archiver = new TarArchiver();
TarArchiver.TarCompressionMethod tarCompressionMethod = new TarArchiver.TarCompressionMethod();
tarCompressionMethod.setValue("gzip");
((TarArchiver) archiver).setCompression(tarCompressionMethod);
TarLongFileMode fileMode = new TarLongFileMode();
fileMode.setValue(TarLongFileMode.GNU);
((TarArchiver) archiver).setLongfile(fileMode);
} else if ("zip".equals(artifact.getType())) {
archiver = new ZipArchiver();
} else {
throw new IllegalArgumentException("Unknown target type: " + artifact.getType());