如何通过Gradle 7.0 +制作一个具有依赖项的Jar文件?
2022-09-04 08:10:31
我目前的情况如下:jar
build.gradle
jar {
manifest {
attributes "Main-Class": "hoge.Main"
}
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
并且工作良好。
但是,我有一条来自Gradle的消息(也许是因为6 +?
这是实际消息:
The compile configuration has been deprecated for dependency declaration. This will fail with an error in Gradle 7.0. Please use the implementation configuration instead.
该部件已弃用。configurations.compile
我该如何更新它?
如果我更改了
jar {
manifest {
attributes "Main-Class": "hoge.Main"
}
from configurations.implementation.collect { it.isDirectory() ? it : zipTree(it) }
}
格拉德尔 说> Resolving configuration 'implementation' directly is not allowed