I ran into an issue with my gradle project’s dist task not properly copying all the required libraries into the distributions’ lib directory.
My specific problem is that there’s two identically named third party jars (not chosen by me). When I run gradle dist it only copies one of them.
Gradle is pulling these from the local maven repository. I cache the jars locally because I made some modifications to the libraries to add needed functionality. Intellij seems to pick up these duplicate jars and executing the java program in intellij seems to work fine.
My build.gradle dependency specification contains the relevant entries:
compile group: ‘info.bitrich.xchange-stream’, name: ‘xchange-coinbasepro’, version: ‘4.3.15’
compile group: ‘info.bitrich.xchange-stream’, name: ‘xchange-stream-core’, version: ‘4.3.15’
My list of repositories looks like:
The problem arises from the info.bitrich.xchange-stream.xchange-coinbasepro dependencies. Examining the maven atrifact pom.xml for xchange-stream I see:
And the produced jar has a path that looks like:
And examining the pom.xml for the org.knowm.xchange I see:
And the produced jar for that has a path that looks like:
I am running gradle 5.4.1.
One temporary workaround would be to modify the artifact ID’s so that the jar names are different, but this seems hacky. Is there another possible way to fix this within gradle itself?