2
votes

I have simple java (Gradle) project wich depends on several JARs, obtained automatically from Maven repositories.

Now I wish to call my jar with external application (Matlab). Unfortunately, application does not see any dependencies after I call build, jar and similar goals.

Me myself also don't know dependencies, since they are managed automatically with Gradle and may contain nested dependencies, not listed in build.gradle.

Is it possible to collect all required JARs in one place to run them freely?

1

1 Answers

2
votes

You can write a custom task to collect your runtime dependencies into a jar

task copyToLib(type: Copy) {
    into "$buildDir/libs"
    from configurations.runtime
}

You could also look into the application and distribution gradle plugins, that provide similar packaging and distribution functionality