protected JarPackageData getJarPackageData(
      IPackageFragmentRoot[] roots, IType mainType, IProgressMonitor monitor) throws CoreException {

    String filePath = getTempJarPath(appModule.getLocalModule());

    if (filePath == null) {
      handleApplicationDeploymentFailure();
    }

    IPath location = new Path(filePath);

    // Note that if no jar builder is specified in the package data
    // then a default one is used internally by the data that does NOT
    // package any jar dependencies.
    JarPackageData packageData = new JarPackageData();

    packageData.setJarLocation(location);

    // Don't create a manifest. A repackager should determine if a generated
    // manifest is necessary
    // or use a user-defined manifest.
    packageData.setGenerateManifest(false);

    // Since user manifest is not used, do not save to manifest (save to
    // manifest saves to user defined manifest)
    packageData.setSaveManifest(false);

    packageData.setManifestMainClass(mainType);
    packageData.setElements(roots);
    return packageData;
  }
 private void xmlReadManifest(JarPackageData jarPackage, Element element)
     throws java.io.IOException {
   if (element.getNodeName().equals("manifest")) { // $NON-NLS-1$
     jarPackage.setManifestVersion(element.getAttribute("manifestVersion")); // $NON-NLS-1$
     jarPackage.setUsesManifest(getBooleanAttribute(element, "usesManifest")); // $NON-NLS-1$
     jarPackage.setReuseManifest(getBooleanAttribute(element, "reuseManifest")); // $NON-NLS-1$
     jarPackage.setSaveManifest(getBooleanAttribute(element, "saveManifest")); // $NON-NLS-1$
     jarPackage.setGenerateManifest(
         getBooleanAttribute(element, "generateManifest")); // $NON-NLS-1$
     jarPackage.setManifestLocation(
         Path.fromPortableString(element.getAttribute("manifestLocation"))); // $NON-NLS-1$
     jarPackage.setManifestMainClass(getMainClass(element));
     xmlReadSealingInfo(jarPackage, element);
   }
 }