I am having an issue with a jar produced by gradle. Forgive me for the length of this post as I try to lay out all the legwork I’ve put into reproducing the issue so far.
The jar produced by gradle is different in size from the one I create by hand with the jar command. The one produced by Gradle throws exceptions about non-zero directory length when used in my Oracle application whereas the one produced by hand does not through those exceptions.
Gradle produces a jar of 12,939 bytes. It has a very simple one line MANIFEST.MF file. When I use that jar in my application the app server throws many exceptions. This is where it gets interesting. If I extract the manifest and then update the manifest in the jar the app server stops throwing the exceptions.
Here are the steps I’m taking to extract/update the jar.
First, I execute:
jar xvf my.jar META-INF/MANIFEST.MF
Then, I execute:
jar uvfm my.jar META-INF/MANIFEST.MF
This “works”, though it throws a warning because the line in the MANIFEST.MF that I’m updating with already exists in the MANIFEST.MF in the jar. However, the end result is that the jar has also now changed size. And, interestingly, it no longer throws exceptions either.
So, I’m looking for tools to help me compare these jars. They should be (in my humble opinion) the same, but they are not. The questions I’m trying to ask are:
- Why are they not the same?
- What is different about them?
I am using Gradle 2.3 and 2.4, I’ve not tried to reproduce this with other versions of gradle.