File fileWithPermission = new File(TARGET_ZIP_INPUT_DIR, "file.with.permission.sh");
fileWithPermission.setExecutable(true);
File zipFile = new File(TARGET_ZIP_OUTPUT_DIR, ZIP_FILE);
ZipArchiver zipArchiver = new ZipArchiver();
zipArchiver.setDestFile(zipFile);
zipArchiver.setIncludeEmptyDirs(true);
zipArchiver.setCompress(true);
zipArchiver.setForced(true);
zipArchiver.addDirectory(new File(TARGET_ZIP_INPUT_DIR), new String[]{"**/**"}, new String[]{});
zipArchiver.createArchive();
zipArchiver.setIgnorePermissions(false);
zipArchiver.setUseJvmChmod(true);
}