Gradle Fatjar构建错误

时间:2018-06-29 19:10:01

标签: java gradle build classpath fatjar

我正在尝试使用eu.appsatori.fatjar插件创建fatJar。

出于某种原因,我继续收到此错误:

Caused by: org.gradle.api.GradleException: Could not expand ZIP '/Users/xxx/.gradle/caches/modules-2/files-2.1/org.apache.storm/storm-core/0.10.0/59bc38e472630eecfe41fec4bd3cc346626a3f24/storm-core-0.10.0.jar'.

Caused by: org.gradle.api.GradleException: Could not copy zip entry /Users/xxx/.gradle/caches/modules-2/files-2.1/org.apache.storm/storm-core/0.10.0/59bc38e472630eecfe41fec4bd3cc346626a3f24/storm-core-0.10.0.jar!META-INF/license/ to '/Users/xxx/path/projectName/build/tmp/expandedArchives/storm-core-0.10.0.jar_awree5slcpd7gxsjwz6rwpmop/META-INF/license'.

Caused by: org.gradle.api.UncheckedIOException: Cannot create directory '/Users/xxx/path/projectName/build/tmp/expandedArchives/storm-core-0.10.0.jar_awree5slcpd7gxsjwz6rwpmop/META-INF/license' as it already exists, but is not a directory

我已经在gradle文件中排除了很多东西:

fatJar {
  zip64 true
  exclude 'META-INF/license/LICENSE.*.txt'
    exclude 'META-INF/*.SF'
    exclude 'META-INF/*.DSA'
    exclude 'META-INF/*.SHA256'
    exclude 'META-INF/*.RSA'
    exclude 'META-INF/*.EC'
    exclude 'META-INF/**'
    exclude 'META-INF/LICENSE'
  exclude '*META-INF/license'
  exclude 'storm-core-0.10.0.jar!META-INF/license'
}
fatJarPrepareFiles {
  exclude 'META-INF/license/LICENSE.*.txt'
  exclude 'META-INF/*.SF'
  exclude 'META-INF/*.DSA'
  exclude 'META-INF/*.SHA256'
  exclude 'META-INF/*.RSA'
  exclude 'META-INF/*.EC'
  exclude 'META-INF/**'
  exclude 'META-INF/LICENSE'
  exclude '*META-INF/license'
  exclude 'storm-core-0.10.0.jar!META-INF/license'
}

但是它仍然无法正常工作,有人知道什么可以解决此错误吗?

0 个答案:

没有答案