Jar and War generated by gradle is not "Real JAR" file

Jar and War generated by grade is not “Real JAR” file.

In Jar spec, file name in jar is UTF8. So jar file can be used by any os.

But gradle use os dependent file name encoding. Alphabet is OK, but other language’s file name is broken.

Gradle Jar task is extends Zip Task. Zip task use ZipOutputStream not JarOutputStream. So Jar task is also use ZipOutputStream.

Looking at the OpenJDK source, I don’t see anything obvious that would imply that JarOuputStream handles character encoding differently from the ZipOutputStream.

Do you have an example of where the jar/war generated has mangled the encoding of the file names or the build fails?

Does this describe your problem (and does the workaround work for you)? https://issues.gradle.org/browse/GRADLE-1506