Is there a way to make zipping same content to be exactly the same with distribution plugin?

Hi, I’m using distribution plugin.

distributions.main.contents {

into(‘lib’) {

from(jar)

from(project.configurations.runtime)

} } if I’m running distZip, renaming artifact and then running distZip once again, then 2 zips have different md5sum because they are different(i’ve tried to compare by binary content), however if I extract 2 zips into 2 diff directories the content of them is exactly the same.

Is there way to pass some arguments to the zip task to make it “stable”?(not sure how it’s implemented e.g. in gzip there is -n flag that might cause it, but I assume zipping is done with some java library…)

My intention is to check if something changed in artifact(lib/source whatever), between two builds(think about jenkins, fingerprinting etc)

There is no such option. If you’ve already diffed the extracted directory contents and didn’t find a difference, I’d recommend to find a tool that can diff zips and see what it says.

I have a custom gradle task that can diff two zips. I could probably post it if you are interested.