use of org.codehaus.plexus.archiver.ArchiverException in project project-build-plugin by axonivy.
the class IarPackagingMojo method createIvyArchive.
private void createIvyArchive(File sourceDir, File targetIar) throws MojoExecutionException {
ZipArchiver archiver = new ZipArchiver();
archiver.setDestFile(targetIar);
archiver.addFileSet(getDefaultFileset(sourceDir));
FileSetConverter fsConverter = new FileSetConverter(project.getBasedir());
for (org.codehaus.plexus.archiver.FileSet fs : fsConverter.toPlexusFileSets(iarFileSets)) {
archiver.addFileSet(fs);
}
try {
archiver.createArchive();
} catch (ArchiverException | IOException ex) {
throw new MojoExecutionException("Failed to create IAR: " + targetIar.getAbsolutePath(), ex);
}
}
Aggregations