OK I will clarify that. A jar file is based on the zip file format. Zip files are organized into a sequence of files. The first or second file in this sequence should be the META-INF/MANIFEST.MF in order for the jar file to be compatible with the JDK standard library utilities.
From JDK’s JarInputStream.java:
// This implementation assumes the META-INF/MANIFEST.MF entry
// should be either the first or the second entry (when preceded
// by the dir META-INF/). It skips the META-INF/ and then
// “consumes” the MANIFEST.MF to initialize the Manifest object.
JarEntry e = (JarEntry)super.getNextEntry();
if (e != null && e.getName().equalsIgnoreCase(“META-INF/”))
e = (JarEntry)super.getNextEntry();
first = checkManifest(e);
The only change that needs to be made is in War.groovy, when adding the WEB-INF, instead of calling rootSpec.addFirst(), call rootSpec.addChild(), which is what was done in Gradle 1.6 and earlier. I have a patched version of 1.7 that does this and there are no apparent issues.