code: protected File zipSubfolder(File rootDir, String zipSubFolder, String zipFileName, String archiveFolder)
          throws MojoExecutionException
    {
      int resultCode = 0;
  
      try {
  
        File scriptDirectory = new File(project.getBuild().getDirectory(), "scripts").getCanonicalFile();
        scriptDirectory.deleteOnExit();
  
        if (archiveFolder != null)
        {
          resultCode = ScriptRunner.copyAndExecuteScript(System.out, "/com/sap/prd/mobile/ios/mios/zip-subfolder.sh",
                scriptDirectory, rootDir.getCanonicalPath(), zipSubFolder, zipFileName, archiveFolder);
        }
        else
        {
          resultCode = ScriptRunner.copyAndExecuteScript(System.out, "/com/sap/prd/mobile/ios/mios/zip-subfolder.sh",
                scriptDirectory, rootDir.getCanonicalPath(), zipSubFolder, zipFileName);
        }
      }
      catch (Exception ex) {
        throw new MojoExecutionException("Cannot create zip file " + zipFileName + ". Check log for details.", ex);
      }
      if (resultCode != 0) {
        throw new MojoExecutionException("Cannot create zip file " + zipFileName + ". Check log for details.");
      }
      getLog().info("Zip file '" + zipFileName + "' created.");
      return new File(rootDir, zipFileName);
    }
docs: Calls a shell script in order to zip a folder. We have to call a shell script as Java cannot
  zip symbolic links.
  
  @param rootDir
  the directory where the zip command shall be executed
  @param zipSubFolder
  the subfolder to be zipped
  @param zipFileName
  the name of the zipFile (will be located in the rootDir)
  @param archiveFolder
  an optional folder name if the zipSubFolder folder shall be placed inside the zip into
  a parent folder
  @return the zip file
  @throws MojoExecutionException