How to build different distributions for different operating systems?

I am trying to produce several distribution zip files of the same java app, to create executables for different operating systems.
Every distribution must its own dependencies on external libraries(some are common to all).
What is the proper way to do this? The source files are exactly the same for all distributions

I suggest you checkout the distribution plugin shipped with gradle: https://docs.gradle.org/current/userguide/userguide_single.html#distribution_plugin

this plugin allows you to declare different distributions with different naming scheme, content etc.

if you have further question after looking into this plugin let us know. happy to help.

cheers,
René

I already have. The issue is that the distros have the same source files but different external libraries. So i have to change the dependencies and the jars included in distro/lib folder.