A NPE terminates the jar task if a zipgroupfileset is used to add a jar file that doesn't contain a valid MANIFEST.MF entry. <jar destfile="bfj.jar" filesetmanifest="merge"> <zipgroupfileset refid="manyjars.fileset" /> </jar> Source : ant/src/main/org/apache/tools/ant/taskdefs/Jar.java private Manifest getManifest(Reader r) { Manifest newManifest = null; try { newManifest = new Manifest(r); } catch (ManifestException e) { log("Manifest is invalid: " + e.getMessage(), Project.MSG_ERR); //throw new BuildException("Invalid Manifest: " + manifestFile, e, getLocation()); // <-- here! return null; // <-- and here! } catch (IOException e) { throw new BuildException("Unable to read manifest file" + " (" + e.getMessage() + ")", e); } return newManifest; } The method getManifest(Reader) throws a BuildException if a source jar has a invalid manifest, this is correct but can be annoying if you want to merge in the jar file despite the invalid entry. Perhaps an option should decide wheiter this function should throw an exception or just return null to allow merging of third party jars with invalid manifests.
Changing title as NPE happens only if you change the code.