gpt4 book ai didi

gradle - Gradle构建错误

转载 作者:行者123 更新时间:2023-12-03 03:30:30 24 4
gpt4 key购买 nike

不幸的是,我尝试使用gradle构建fatJar。给我这个错误

Cannot create directory 'C:\Users\User\build\tmp\expandedArchives\maven-toolchain-1.0.jar_6m0pv69i8jujen0j76d9kruaz\META-INF' as it already exists, but is not a directory
Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.2.1-bin.zip'.

这是什么错误呢?

我有以下代码:
jar {
from {
(configurations.runtime).collect {
it.isDirectory() ? it : zipTree(it)
}
}
}

最佳答案

我通过使用这种“模式”解决了这个问题。

jar {

archiveName = "myjar.jar"

manifest {
attributes 'Implementation-Title': 'myjar.jar',
'Implementation-Version': version
}
// adds runtime dependencies to jar package
from(configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }) {
// remove all signature files
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}

}

关于gradle - Gradle构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38010008/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com