How to build multiproject javafx app with lib folder

I have just started using gradle and can’t wrap my head around how to get this done…
I got following project structure:

  1. root_project
    1.1 subproject_A
    1.2 subproject_B using sub_A
    1.3 javafx_app using sub_B
    1.4 native_libs -> folder with 2 native libs and corresponding java wrappers

Running the software from IDE (intelliJ) works fine, all dependencies are successfully loaded. I just don’t know how i can build a jar and the dependencies. I am using the javafx gradle plug-in in the javafx-app and the normal java plug-in in the other two projects. My ultimate goal would be to have the javafx app as jar and all dependencies, including the native ones, in a lib folder next to the jar. Do I have to edit the root_projects build file or the one for the javafx app?
Thank you in advance!