gradle build fails with duplicate META-INF/LICENSE reference
I'm on Linux Manjaro and I was trying to build decaf from the src and when I would run: gradle build it would fail for the jar task stating something about a duplicate META-INF/LICENSE file. The fix for me was this:
The original snippet of the build.gradle file: `tasks.compileJava.dependsOn tasks.ll1pg
jar { manifest { attributes 'Main-Class': 'decaf.Main' }
// Create a fat JAR with all the dependencies.
from {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}`
I changed it to: `tasks.compileJava.dependsOn tasks.ll1pg
jar { setDuplicatesStrategy(DuplicatesStrategy.INCLUDE); manifest { attributes 'Main-Class': 'decaf.Main' }
// Create a fat JAR with all the dependencies.
from {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}`
and now, despite giving an error about JavaExecHandlerBuilder.setMain(String) method being deprecated, it compiles. I also changed the commons-cli version from 1.5 to 1.5.0 though I'm not sure if that matters.