Gradle application plugin produces classpaths containing duplicate entries for JARs


(Dimitar Dimitrov) #1

Typically it is harmless, but when generating start scripts it would be better if the classpath is clean.

In order to fix, you can replace:

generator.classpath = getClasspath().collect { “lib/${it.name}” }

with

generator.classpath = getClasspath().collect { “lib/${it.name}” }.unique()

in org.gradle.api.tasks.application.CreateStartScripts#generate()