Build a fat jar but with jars inside instead of class files

Hi, I am trying to convert some of our ivy/ant scripts to gradle. We had a target that would generate jar files that included all dependency jar files in a lib folder (So its different that fatjar/uberjar/shadowjar) that you include the jars instead of classes in your jar. We need this for one of our older map reduce clusters that requires this jar format to run mapred jobs. Any suggestion how I can do this in gradle? This was my ivy/ant build script

<target name="mapred-jar" depends="mapred-jar-default" description=" make distribution jar, collapses jars and configs and classes directory ">
                  <jar destfile="${build.dir}/${}-${version}-mapred.jar">
                        <fileset dir="${classes.dir}" />
                        <zipfileset dir="${mapredjar.tmp.dir}/lib" prefix="lib">
                                  <!-- <exclude name="commons*.jar" /> -->
                                <!-- <include name="hadoop*.jar" /> -->
                  <delete dir="${mapredjar.tmp.dir}" />

Thanks for your help.

jar {
    into("lib") {
        from configurations.runtime