This plugin will merge all dependencies that are defined as part of jmh
, runtime
and optionally testRuntime
configurations into a single set from which fat jar will be created when executing jmhJar
task. This is done to ensure that no duplicate dependencies will be added the generated jar.
In addition plugin applies DuplicatesStrategy defined via duplicateClassesStrategy
extension property to every class while creating fat jar. By default this property is set to DuplicatesStrategy.FAIL
which means that upon detection of duplicate classes the task will fail.
It is possible to change this behavior by configuring duplicateClassesStrategy
property via jmh
block, e.g.:
build.gradle
jmh {
duplicateClassesStrategy = 'warn'
}
However if you do encounter problem with defaut value it means that the classpath or sources in your project do contain duplicate classes which means that it is not possible to predict which one will be used when fat jar will generated.