melix / jmh-gradle-plugin

Integrates the JMH benchmarking framework with Gradle
Apache License 2.0
662 stars 88 forks source link

Composing fat jar using runtime dependencies is error prone in case of duplicate resources #194

Open reinhapa opened 3 years ago

reinhapa commented 3 years ago

@melix what was the reason to create a fat jar containing all runtime dependencies in the first place?

I have problems with dependencies, that will define specialized resources as META-INF/beans.xml or META-INF/services/xxx files, that exists in multiple dependencies and can have different content. This leads in my case to false behavior in case as there are multiple Java service definitions for the same interface/abstract class or CDI Bean definitions that in one artifact defines a different discovery mode than in an other artifact.

In case of JMH the solution is to add an Class-Path meta info attribute containing the runtime dependencies in oder to work around this problem. This could also mitigate the path length problem on a Windows installation too..

The following issues could maybe benefit of a reconciling this decision: