Howto copy dependencies to project folder and link them to *.ipr/*.iml via idea plugin instead from sha1sum folders

Hello all,

is there a possibility to disable creation of sub folders with sha1sum of jar’s in gradle cache? Using jogl, gluegen and homemade jni-bindings to native dyn-libs via gluegen does not work as expected because native libs (using gluegen naming convention) are not found (and libs could not be loaded).

e.g.
2016-07-12T11:57:04.270+0200 [AWT-EventQueue-0] ERROR c.jogamp.common.jvm.JNILibLoaderBase - JNILibLoaderBase: addNativeJarLibsImpl: initial: file:/home/vee/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/99e0f64bb8882f054825ae4a8a527a17b544a0b5/jogl-all-2.3.2.jar -> file:/home/vee/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/99e0f64bb8882f054825ae4a8a527a17b544a0b5/
2016-07-12T11:57:04.270+0200 [AWT-EventQueue-0] ERROR c.jogamp.common.jvm.JNILibLoaderBase - JNILibLoaderBase: addNativeJarLibsImpl: nativeLibraryPath: natives/linux-amd64/
2016-07-12T11:57:04.270+0200 [AWT-EventQueue-0] ERROR c.jogamp.common.jvm.JNILibLoaderBase - JNILibLoaderBase: addNativeJarLibsImpl: module: jogl-all-2.3.2-natives-linux-amd64.jar -> jar:file:/home/vee/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/99e0f64bb8882f054825ae4a8a527a17b544a0b5/jogl-all-2.3.2-natives-linux-amd64.jar!/
2016-07-12T11:57:04.270+0200 [AWT-EventQueue-0] ERROR c.jogamp.common.jvm.JNILibLoaderBase - JNILibLoaderBase: addNativeJarLibsImpl: Caught TempJarCache: addNativeLibs: jar:file:/home/vee/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/99e0f64bb8882f054825ae4a8a527a17b544a0b5/jogl-all-2.3.2-natives-linux-amd64.jar!/, previous load attempt failed
2016-07-12T11:57:04.270+0200 [AWT-EventQueue-0] ERROR java.lang.Throwable - java.io.IOException: TempJarCache: addNativeLibs: jar:file:/home/vee/.gradle/caches/modules-2/files-2.1/org.jogamp.jogl/jogl-all/2.3.2/99e0f64bb8882f054825ae4a8a527a17b544a0b5/jogl-all-2.3.2-natives-linux-amd64.jar!/, previous load attempt failed

obviously, because
find . -name “*.jar” -exec sha1sum {} ;
99e0f64bb8882f054825ae4a8a527a17b544a0b5 ./99e0f64bb8882f054825ae4a8a527a17b544a0b5/jogl-all-2.3.2.jar
166147f43cf7419c4d858cd31f4b5922d6d10c81 ./166147f43cf7419c4d858cd31f4b5922d6d10c81/jogl-all-2.3.2-natives-android-aarch64.jar
ab2c18b8a1327255cc354c19c720807d262baa75 ./ab2c18b8a1327255cc354c19c720807d262baa75/jogl-all-2.3.2-natives-android-armv6.jar
ffd1c6bd5f6fb088df6cad25e25721eb55ad2228 ./ffd1c6bd5f6fb088df6cad25e25721eb55ad2228/jogl-all-2.3.2-natives-linux-amd64.jar
6d14f46336be9e2dc5f85d5df17490cee5d09a90 ./6d14f46336be9e2dc5f85d5df17490cee5d09a90/jogl-all-2.3.2-natives-linux-armv6.jar
2c434c560dbd821b0ed569e44d3d441727491dac ./2c434c560dbd821b0ed569e44d3d441727491dac/jogl-all-2.3.2-natives-linux-armv6hf.jar
59b7a336c0ee54161e33662d2ca8ac9d8f6c476d ./59b7a336c0ee54161e33662d2ca8ac9d8f6c476d/jogl-all-2.3.2-natives-linux-i586.jar
2da2215dbe1091c54cb83cf2484f8a54a4d0cf7a ./2da2215dbe1091c54cb83cf2484f8a54a4d0cf7a/jogl-all-2.3.2-natives-macosx-universal.jar
bde11ff064181af9c307180d8f3f1744b7bdc11d ./bde11ff064181af9c307180d8f3f1744b7bdc11d/jogl-all-2.3.2-natives-solaris-amd64.jar
94d1ed501fe53b7f75eab0f712f39802390d0f5b ./94d1ed501fe53b7f75eab0f712f39802390d0f5b/jogl-all-2.3.2-natives-solaris-i586.jar
becd519b1f741176561d93645abd90971ca0dca0 ./becd519b1f741176561d93645abd90971ca0dca0/jogl-all-2.3.2-natives-windows-amd64.jar
5db8db5eca6b4445db6cd14f68938736630ae976 ./5db8db5eca6b4445db6cd14f68938736630ae976/jogl-all-2.3.2-natives-windows-i586.jar
677f26584c8860b8ac2091a09b08b5facedc6d68 ./677f26584c8860b8ac2091a09b08b5facedc6d68/jogl-all-2.3.2-sources.jar

Thank you
Veit Eitner

I forgot to mention that this happens within IntelliJ. The problem might be caused by the idea-plugin. Does anybody know an option to copy the gradle-cached dependencies to a folder (e.g. libs) and add these copies to the generated *.ipr file instead?

repositories {
flatdir {
dirs ‘whatever’
}
}

would require to populate that directory manually which is not an option because the required libs are updated frequently

I’m looking for a solution either to bypass the ‘sha1sum’ folder names of the gradle cache or to copy (some) of the dependencies to such a flatdir and link those in idea-task automatically.

Thank you

Would it be possible to create a sub-project having dependencies on that libraries and a simple copy task?
The main project should then depend on that sub-project but with repositories{flatdir{…}} ???
But that’s just a work around - there should be a simpler solution.