final File temp = File.createTempFile("maven-smaller", ".dir");
try {
temp.delete();
temp.mkdirs();
final Manifest manifest = writeManifest(temp, configFile);
for (final String includedFile : includedFiles) {
this.logger.debug("Adding " + includedFile + " to zip");
final File target = new File(temp, includedFile);
target.getParentFile().mkdirs();
FileUtils.copyFile(new File(base, includedFile), target);
}
for (final ProcessDescription pd : manifest.getProcessDescriptions()) {
final File target = new File(temp, pd.getInputFile());
target.getParentFile().mkdirs();
FileUtils.copyFile(new File(base, pd.getInputFile()), target);
}
Zip.zip(baos, temp);