Gradle dist not copying all libraries in the lib folder

Greetings,

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:

repositories {
mavenLocal()
mavenCentral()
}

The problem arises from the info.bitrich.xchange-stream.xchange-coinbasepro dependencies. Examining the maven atrifact pom.xml for xchange-stream I see:

<artifactId>xchange-coinbasepro</artifactId>

<dependency>
<groupId>org.knowm.xchange</groupId>
<artifactId>xchange-coinbasepro</artifactId>
<version>${xchange.version}</version>
</dependency>

And the produced jar has a path that looks like:

~/.m2/repository/info/bitrich/xchange-stream/xchange-coinbasepro/4.3.15/xchange-coinbasepro-4.3.15.jar

And examining the pom.xml for the org.knowm.xchange I see:

<artifactId>xchange-coinbasepro</artifactId>

And the produced jar for that has a path that looks like:

~/.m2/repository/org/knowm/xchange/xchange-coinbasepro/4.3.15/xchange-coinbasepro-4.3.15.jar

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?

Maybe I’m missing something, but looking at the pom file forxchange-stream-core and looking at xchange-stream repository’s pom.xml, the artifact ID for xchange-stream-core seems to be xchange-stream-core and the JAR file has a matching name.

I cache the jars locally because I made some modifications to the libraries to add needed functionality.

The above and your caching suggest some issue with your publishing or your handling of artifacts.