On a Linux machine running Java 8 and Gradle 6.3 I need to build a fat jar made of mix of libraries, some sourced from Maven Central, others from a local libs directory located at the root of my repository, together with my build.gradle and the gradlew:
apply plugin: 'java' repositories { mavenCentral() flatDir { dirs 'libs' } } sourceCompatibility = 1.8 targetCompatibility = 1.8 task copyLibs(type: Copy) { from configurations.compile into 'libs' } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) testImplementation "junit:junit:4.12" } After running ./gradlew clean build and cd build/libs, if I unzip myproject.jar I can see that no dependencies have been included in the jar.
My end goal is to make my project executable as java -jar myproject.jar. How can I solve this?