Gradle“条目.classpath是重复的,但没有设置重复的处理策略”
我正在尝试构建一个 gradle 项目,但是当我尝试时,$ gradle build我得到以下输出:
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :jar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jar'.
> Entry .classpath is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.0/dsl/org.gradle.api.file.CopySpec.html#org.gradle.api.file.CopySpec:duplicatesStrategy for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 11s
4 actionable tasks: 2 executed, 2 up-to-date
做完之后Get-ChildItem -Path ./ -Filter .classpath -Recurse -Force我得出结论,.classpath我的项目中甚至没有一个文件名。我该怎么办?
回答
如果你使用 Kotlin DSL 和 Gradle 7.0 可能是由于那个 bug KT-46165
它应该在 1.5.0 版本中修复。
THE END
二维码