gradle 复制依赖的jar到指定目录
程序员文章站
2022-06-13 19:30:41
...
task copyJars(type: Copy){
from configurations.runtime
into "$buildDir/ libs/deps"
}
compileJava.dependsOn copyJars
// 设置java程序入口
jar{
manifest{
attributes("Main-Class" : "xxx.xxx.App")
attributes("Class-Path": configurations.compile.collect { "deps/$it.name" }.join(' '))
}
}